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

Method IntersectsItself

Source/Engine/Level/Actors/BoxBrush.cpp:205–225  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

203}
204
205bool BoxBrush::IntersectsItself(const Ray& ray, Real& distance, Vector3& normal)
206{
207 bool result = false;
208 Real minDistance = MAX_float;
209 Vector3 minDistanceNormal = Vector3::Up;
210 if (_bounds.Intersects(ray, distance))
211 {
212 for (int32 surfaceIndex = 0; surfaceIndex < 6; surfaceIndex++)
213 {
214 if (Intersects(surfaceIndex, ray, distance, normal) && distance < minDistance)
215 {
216 minDistance = distance;
217 minDistanceNormal = normal;
218 result = true;
219 }
220 }
221 }
222 distance = minDistance;
223 normal = minDistanceNormal;
224 return result;
225}
226
227#if USE_EDITOR
228

Callers

nothing calls this directly

Calls 2

IntersectsFunction · 0.50
IntersectsMethod · 0.45

Tested by

no test coverage detected