mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 13:50:13 +00:00
HPL1: Further Fixes for GCC Shadowing Warnings in Newton Physics Library
These are emitted if -Wshadow is passed to GCC.
This commit is contained in:
parent
af0dea70c0
commit
d60d57f86e
@ -433,14 +433,14 @@ static dgInt32 SortVertices(dgFloat64* const vertexList, dgInt32 stride,
|
||||
if (index == dgInt32(0xffffffff))
|
||||
{
|
||||
dgFloat64 swept = vertexList[m + firstSortAxis] + sweptWindow;
|
||||
dgInt32 k = i * stride + stride;
|
||||
dgInt32 q = i * stride + stride;
|
||||
for (dgInt32 i1 = i + 1; i1 < vertexCount; i1++)
|
||||
{
|
||||
|
||||
index = dgInt32(vertexList[k + 0]);
|
||||
index = dgInt32(vertexList[q + 0]);
|
||||
if (index == dgInt32(0xffffffff))
|
||||
{
|
||||
dgFloat64 val = vertexList[k + firstSortAxis];
|
||||
dgFloat64 val = vertexList[q + firstSortAxis];
|
||||
if (val >= swept)
|
||||
{
|
||||
break;
|
||||
@ -448,15 +448,15 @@ static dgInt32 SortVertices(dgFloat64* const vertexList, dgInt32 stride,
|
||||
bool test = true;
|
||||
for (dgInt32 t = 0; test && (t < compareCount); t++)
|
||||
{
|
||||
dgFloat64 val = fabs(vertexList[m + t + 2] - vertexList[k + t + 2]);
|
||||
test = test && (val <= tol);
|
||||
dgFloat64 v = fabs(vertexList[m + t + 2] - vertexList[k + t + 2]);
|
||||
test = test && (v <= tol);
|
||||
}
|
||||
if (test)
|
||||
{
|
||||
vertexList[k + 0] = dgFloat64(count);
|
||||
vertexList[q + 0] = dgFloat64(count);
|
||||
}
|
||||
}
|
||||
k += stride;
|
||||
q += stride;
|
||||
}
|
||||
|
||||
memcpy(&vertexList[count * stride + 2], &vertexList[m + 2],
|
||||
|
@ -245,8 +245,8 @@ dgUnsigned32 dgBallConstraint::JacobianDerivative(dgContraintDescritor ¶ms)
|
||||
|
||||
if (limits.s.m_twistLimit) {
|
||||
if (angle.m_x > m_twistAngle) {
|
||||
dgVector p0(matrix0.m_posit + matrix0.m_up.Scale(MIN_JOINT_PIN_LENGTH));
|
||||
InitPointParam(pointData, m_stiffness, p0, p0);
|
||||
dgVector pv0(matrix0.m_posit + matrix0.m_up.Scale(MIN_JOINT_PIN_LENGTH));
|
||||
InitPointParam(pointData, m_stiffness, pv0, pv0);
|
||||
|
||||
const dgVector &dir = matrix0.m_right;
|
||||
CalculatePointDerivative(ret, params, dir, pointData, &m_jointForce[ret]);
|
||||
@ -268,8 +268,8 @@ dgUnsigned32 dgBallConstraint::JacobianDerivative(dgContraintDescritor ¶ms)
|
||||
(relVelocErr + penetrationErr) * params.m_invTimestep, params);
|
||||
ret++;
|
||||
} else if (angle.m_x < -m_twistAngle) {
|
||||
dgVector p0(matrix0.m_posit + matrix0.m_up.Scale(MIN_JOINT_PIN_LENGTH));
|
||||
InitPointParam(pointData, m_stiffness, p0, p0);
|
||||
dgVector pv0(matrix0.m_posit + matrix0.m_up.Scale(MIN_JOINT_PIN_LENGTH));
|
||||
InitPointParam(pointData, m_stiffness, pv0, pv0);
|
||||
dgVector dir(matrix0.m_right.Scale(-dgFloat32(1.0f)));
|
||||
CalculatePointDerivative(ret, params, dir, pointData, &m_jointForce[ret]);
|
||||
|
||||
@ -297,9 +297,9 @@ dgUnsigned32 dgBallConstraint::JacobianDerivative(dgContraintDescritor ¶ms)
|
||||
dgFloat32 coneCos;
|
||||
coneCos = matrix0.m_front % matrix1.m_front;
|
||||
if (coneCos < m_coneAngleCos) {
|
||||
dgVector p0(
|
||||
dgVector pm0(
|
||||
matrix0.m_posit + matrix0.m_front.Scale(MIN_JOINT_PIN_LENGTH));
|
||||
InitPointParam(pointData, m_stiffness, p0, p0);
|
||||
InitPointParam(pointData, m_stiffness, pm0, pm0);
|
||||
|
||||
dgVector tangentDir(matrix0.m_front * matrix1.m_front);
|
||||
tangentDir = tangentDir.Scale(
|
||||
|
@ -296,9 +296,9 @@ void dgBody::UpdateCollisionMatrix(dgFloat32 timestep, dgInt32 threadIndex) {
|
||||
dgVector &box1Min = compoundCollision->m_root->m_p0;
|
||||
dgVector &box1Max = compoundCollision->m_root->m_p1;
|
||||
|
||||
dgVector boxSize((box1Max - box1Min).Scale(dgFloat32(0.25f)));
|
||||
dgVector boxSizeC((box1Max - box1Min).Scale(dgFloat32(0.25f)));
|
||||
for (dgInt32 j = 0; j < 3; j++) {
|
||||
if (dgAbsf(step[j]) > boxSize[j]) {
|
||||
if (dgAbsf(step[j]) > boxSizeC[j]) {
|
||||
if (step[j] > dgFloat32(0.0f)) {
|
||||
box1Max[j] += step[j];
|
||||
} else {
|
||||
@ -720,10 +720,10 @@ dgConstraint *dgBody::GetNextJoint(dgConstraint *joint) const {
|
||||
|
||||
if (node->GetInfo().m_joint == joint) {
|
||||
for (node = node->GetNext(); node; node = node->GetNext()) {
|
||||
dgConstraint *joint;
|
||||
joint = node->GetInfo().m_joint;
|
||||
if (joint->GetId() >= dgUnknownConstraintId) {
|
||||
return joint;
|
||||
dgConstraint *jointT;
|
||||
jointT = node->GetInfo().m_joint;
|
||||
if (jointT->GetId() >= dgUnknownConstraintId) {
|
||||
return jointT;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -754,10 +754,10 @@ dgConstraint *dgBody::GetNextContact(dgConstraint *joint) const {
|
||||
|
||||
if (node->GetInfo().m_joint == joint) {
|
||||
for (node = node->GetNext(); node; node = node->GetNext()) {
|
||||
dgConstraint *joint;
|
||||
joint = node->GetInfo().m_joint;
|
||||
if (joint->GetId() == dgContactConstraintId) {
|
||||
return joint;
|
||||
dgConstraint *jointT;
|
||||
jointT = node->GetInfo().m_joint;
|
||||
if (jointT->GetId() == dgContactConstraintId) {
|
||||
return jointT;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user