MCPcopy Create free account
hub / github.com/doldecomp/mkdd / IsHitSphere

Method IsHitSphere

src/Sato/ObjCollision.cpp:82–95  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80}
81
82bool ObjColSphere::IsHitSphere(JGeometry::TVec3f posOther, JGeometry::TVec3f posThis, f32 otherRadius)
83{
84 bool isHit = false;
85 mPos.sub(posThis, posOther);
86 f32 minSeparationSq, distanceSq;
87 if (checkRadialCollisionXYZ(otherRadius, mPos, minSeparationSq, distanceSq)) {
88 f32 minSeparation = JMAFastSqrt(minSeparationSq);
89 f32 distance = JMAFastSqrt(distanceSq);
90 mBoundDepth = minSeparation - distance;
91 stVecNormalize(mPos);
92 isHit = true;
93 }
94 return isHit;
95}
96
97bool ObjColSphere::IsHitCylinder(JGeometry::TVec3f posThis, JGeometry::TVec3f posOther,
98 const ObjColCylinder &cylinderCol)

Callers 2

IsHitKartMethod · 0.80
IsHitObjectMethod · 0.80

Calls 5

JMAFastSqrtFunction · 0.85
stVecNormalizeFunction · 0.85
stDotFunction · 0.85
subMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected