| 197 | } |
| 198 | |
| 199 | bool OrientedBoundingBox::Intersects(const Ray& ray, Vector3& point) const |
| 200 | { |
| 201 | // Put ray in box space |
| 202 | Ray bRay; |
| 203 | Transformation.WorldToLocalVector(ray.Direction, bRay.Direction); |
| 204 | Transformation.WorldToLocal(ray.Position, bRay.Position); |
| 205 | |
| 206 | // Perform a regular ray to BoundingBox check |
| 207 | const BoundingBox bb(-Extents, Extents); |
| 208 | const bool intersects = CollisionsHelper::RayIntersectsBox(bRay, bb, point); |
| 209 | |
| 210 | // Put the result intersection back to world |
| 211 | if (intersects) |
| 212 | Transformation.LocalToWorld(point, point); |
| 213 | |
| 214 | return intersects; |
| 215 | } |
| 216 | |
| 217 | bool OrientedBoundingBox::Intersects(const Ray& ray, Real& distance) const |
| 218 | { |
nothing calls this directly
no test coverage detected