MCPcopy Create free account
hub / github.com/TorqueGameEngines/Torque3D / SquareDistance

Method SquareDistance

Engine/lib/opcode/Ice/IceRay.cpp:65–83  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63using namespace IceMaths;
64
65float Ray::SquareDistance(const Point& point, float* t) const
66{
67 Point Diff = point - mOrig;
68 float fT = Diff | mDir;
69
70 if(fT<=0.0f)
71 {
72 fT = 0.0f;
73 }
74 else
75 {
76 fT /= mDir.SquareMagnitude();
77 Diff -= fT*mDir;
78 }
79
80 if(t) *t = fT;
81
82 return Diff.SquareMagnitude();
83}

Callers 7

InitQueryMethod · 0.45
SphereContainsBoxMethod · 0.45
ComputePointMethod · 0.45
ContainsFunction · 0.45
IntersectFunction · 0.45
ComputeSquareLengthFunction · 0.45
ComputePointMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected