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

Method Intersects

Source/Engine/Level/Actor.cpp:1686–1713  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1684}
1685
1686Actor* Actor::Intersects(const Ray& ray, Real& distance, Vector3& normal)
1687{
1688 if (!_isActive)
1689 return nullptr;
1690
1691 // Check itself
1692 bool result = IntersectsItself(ray, distance, normal);
1693 Actor* minTarget = result ? (Actor*)this : nullptr;
1694 Real minDistance = result ? distance : MAX_Real;
1695 Vector3 minDistanceNormal = result ? normal : Vector3::Up;
1696
1697 // Check all children
1698 for (int32 i = 0; i < Children.Count(); i++)
1699 {
1700 const auto target = Children[i]->Intersects(ray, distance, normal);
1701 if (target && minDistance > distance)
1702 {
1703 minDistanceNormal = normal;
1704 minDistance = distance;
1705 minTarget = target;
1706 result = true;
1707 }
1708 }
1709
1710 distance = minDistance;
1711 normal = minDistanceNormal;
1712 return minTarget;
1713}
1714
1715void Actor::LookAt(const Vector3& worldPos)
1716{

Callers 15

AddDrawCallMethod · 0.45
OnSceneRenderingDirtyMethod · 0.45
DirtyStaticBoundsMethod · 0.45
RenderMethod · 0.45
EmitterUseSortingFunction · 0.45
DrawParticlesMethod · 0.45
DrawMethod · 0.45
RasterizeMethod · 0.45
GenerateTileFunction · 0.45
BuildDirtyBoundsFunction · 0.45
OnBoundsChangedMethod · 0.45
IntersectsItselfMethod · 0.45

Calls 1

CountMethod · 0.45

Tested by

no test coverage detected