mirror of
https://github.com/AxioDL/metaforce.git
synced 2025-05-14 17:51:21 +00:00
CCollidableOBBTree: Eliminate variable shadowing
Resolves a -Wshadow warning.
This commit is contained in:
parent
c3ba3927db
commit
80c6424fd0
@ -190,17 +190,17 @@ bool CCollidableOBBTree::SphereCollideWithLeafMoving(const COBBTree::CLeafData&
|
|||||||
float vtsDotEdge = vertToSphere.dot(edgeVec);
|
float vtsDotEdge = vertToSphere.dot(edgeVec);
|
||||||
zeus::CVector3f vtsRej = vertToSphere - vtsDotEdge * edgeVec;
|
zeus::CVector3f vtsRej = vertToSphere - vtsDotEdge * edgeVec;
|
||||||
if (edgeRejMagSq > 0.f) {
|
if (edgeRejMagSq > 0.f) {
|
||||||
float tmp = 2.f * vtsRej.dot(edgeRej);
|
const float tmp = 2.f * vtsRej.dot(edgeRej);
|
||||||
float tmp2 = 4.f * edgeRejMagSq * (vtsRej.magSquared() - sphere.radius * sphere.radius) - tmp * tmp;
|
const float tmp2 = 4.f * edgeRejMagSq * (vtsRej.magSquared() - sphere.radius * sphere.radius) - tmp * tmp;
|
||||||
if (tmp2 >= 0.f) {
|
if (tmp2 >= 0.f) {
|
||||||
float mag = 0.5f / edgeRejMagSq * (-tmp - std::sqrt(tmp2));
|
const float mag2 = 0.5f / edgeRejMagSq * (-tmp - std::sqrt(tmp2));
|
||||||
if (mag >= 0.f) {
|
if (mag2 >= 0.f) {
|
||||||
float t = mag * dirDotEdge + vtsDotEdge;
|
const float t = mag2 * dirDotEdge + vtsDotEdge;
|
||||||
if (t >= 0.f && t <= edgeVecMag && mag < dOut) {
|
if (t >= 0.f && t <= edgeVecMag && mag2 < dOut) {
|
||||||
zeus::CVector3f point = surf.GetVert(k) + t * edgeVec;
|
zeus::CVector3f point = surf.GetVert(k) + t * edgeVec;
|
||||||
infoOut = CCollisionInfo(point, matList, edgeMat,
|
infoOut = CCollisionInfo(point, matList, edgeMat,
|
||||||
(sphere.position + mag * dir - point).normalized());
|
(sphere.position + mag2 * dir - point).normalized());
|
||||||
dOut = mag;
|
dOut = mag2;
|
||||||
ret = true;
|
ret = true;
|
||||||
testVert[k] = false;
|
testVert[k] = false;
|
||||||
testVert[nextIdx] = false;
|
testVert[nextIdx] = false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user