MCPcopy Create free account
hub / github.com/FlaxEngine/FlaxEngine / Intersects

Method Intersects

Source/Engine/Core/Math/OrientedBoundingBox.cpp:199–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197}
198
199bool 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
217bool OrientedBoundingBox::Intersects(const Ray& ray, Real& distance) const
218{

Callers

nothing calls this directly

Calls 7

DistanceFunction · 0.85
IntersectsFunction · 0.70
WorldToLocalVectorMethod · 0.45
WorldToLocalMethod · 0.45
LocalToWorldMethod · 0.45
LocalToWorldVectorMethod · 0.45
NormalizeMethod · 0.45

Tested by

no test coverage detected