Refactoring: another huge number of changes, renamed methods to start with lower-case.
This commit is contained in:
@@ -73,8 +73,8 @@ bool Epa::Initialize( btSimplexSolverInterface& simplexSolver )
|
||||
btVector3 seperatingAxisInA = -v * m_transformA.getBasis();
|
||||
btVector3 seperatingAxisInB = v * m_transformB.getBasis();
|
||||
|
||||
btVector3 pInA = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA );
|
||||
btVector3 qInB = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB );
|
||||
btVector3 pInA = m_pConvexShapeA->localGetSupportingVertex( seperatingAxisInA );
|
||||
btVector3 qInB = m_pConvexShapeB->localGetSupportingVertex( seperatingAxisInB );
|
||||
|
||||
btPoint3 pWorld = m_transformA( pInA );
|
||||
btPoint3 qWorld = m_transformB( qInB );
|
||||
@@ -189,8 +189,8 @@ bool Epa::Initialize( btSimplexSolverInterface& simplexSolver )
|
||||
btVector3 seperatingAxisInA = v1 * m_transformA.getBasis();
|
||||
btVector3 seperatingAxisInB = -v1 * m_transformB.getBasis();
|
||||
|
||||
btVector3 p = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA );
|
||||
btVector3 q = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB );
|
||||
btVector3 p = m_pConvexShapeA->localGetSupportingVertex( seperatingAxisInA );
|
||||
btVector3 q = m_pConvexShapeB->localGetSupportingVertex( seperatingAxisInB );
|
||||
|
||||
btPoint3 pWorld = m_transformA( p );
|
||||
btPoint3 qWorld = m_transformB( q );
|
||||
@@ -202,8 +202,8 @@ bool Epa::Initialize( btSimplexSolverInterface& simplexSolver )
|
||||
seperatingAxisInA = v2 * m_transformA.getBasis();
|
||||
seperatingAxisInB = -v2 * m_transformB.getBasis();
|
||||
|
||||
p = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA );
|
||||
q = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB );
|
||||
p = m_pConvexShapeA->localGetSupportingVertex( seperatingAxisInA );
|
||||
q = m_pConvexShapeB->localGetSupportingVertex( seperatingAxisInB );
|
||||
|
||||
pWorld = m_transformA( p );
|
||||
qWorld = m_transformB( q );
|
||||
@@ -215,8 +215,8 @@ bool Epa::Initialize( btSimplexSolverInterface& simplexSolver )
|
||||
seperatingAxisInA = v3 * m_transformA.getBasis();
|
||||
seperatingAxisInB = -v3 * m_transformB.getBasis();
|
||||
|
||||
p = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA );
|
||||
q = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB );
|
||||
p = m_pConvexShapeA->localGetSupportingVertex( seperatingAxisInA );
|
||||
q = m_pConvexShapeB->localGetSupportingVertex( seperatingAxisInB );
|
||||
|
||||
pWorld = m_transformA( p );
|
||||
qWorld = m_transformB( q );
|
||||
@@ -265,8 +265,8 @@ bool Epa::Initialize( btSimplexSolverInterface& simplexSolver )
|
||||
btVector3 seperatingAxisInA = triangleNormal * m_transformA.getBasis();
|
||||
btVector3 seperatingAxisInB = -triangleNormal * m_transformB.getBasis();
|
||||
|
||||
btVector3 p = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA );
|
||||
btVector3 q = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB );
|
||||
btVector3 p = m_pConvexShapeA->localGetSupportingVertex( seperatingAxisInA );
|
||||
btVector3 q = m_pConvexShapeB->localGetSupportingVertex( seperatingAxisInB );
|
||||
|
||||
btPoint3 pWorld = m_transformA( p );
|
||||
btPoint3 qWorld = m_transformB( q );
|
||||
@@ -284,8 +284,8 @@ bool Epa::Initialize( btSimplexSolverInterface& simplexSolver )
|
||||
seperatingAxisInA = -triangleNormal * m_transformA.getBasis();
|
||||
seperatingAxisInB = triangleNormal * m_transformB.getBasis();
|
||||
|
||||
p = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA );
|
||||
q = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB );
|
||||
p = m_pConvexShapeA->localGetSupportingVertex( seperatingAxisInA );
|
||||
q = m_pConvexShapeB->localGetSupportingVertex( seperatingAxisInB );
|
||||
|
||||
pWorld = m_transformA( p );
|
||||
qWorld = m_transformB( q );
|
||||
@@ -398,7 +398,7 @@ bool Epa::Initialize( btSimplexSolverInterface& simplexSolver )
|
||||
return true;
|
||||
}
|
||||
|
||||
btScalar Epa::CalcPenDepth( btPoint3& wWitnessOnA, btPoint3& wWitnessOnB )
|
||||
btScalar Epa::calcPenDepth( btPoint3& wWitnessOnA, btPoint3& wWitnessOnB )
|
||||
{
|
||||
btVector3 v;
|
||||
|
||||
@@ -448,8 +448,8 @@ btScalar Epa::CalcPenDepth( btPoint3& wWitnessOnA, btPoint3& wWitnessOnB )
|
||||
btVector3 seperatingAxisInA = v * m_transformA.getBasis();
|
||||
btVector3 seperatingAxisInB = -v * m_transformB.getBasis();
|
||||
|
||||
btVector3 p = m_pConvexShapeA->LocalGetSupportingVertex( seperatingAxisInA );
|
||||
btVector3 q = m_pConvexShapeB->LocalGetSupportingVertex( seperatingAxisInB );
|
||||
btVector3 p = m_pConvexShapeA->localGetSupportingVertex( seperatingAxisInA );
|
||||
btVector3 q = m_pConvexShapeB->localGetSupportingVertex( seperatingAxisInB );
|
||||
|
||||
btPoint3 pWorld = m_transformA( p );
|
||||
btPoint3 qWorld = m_transformB( q );
|
||||
|
||||
@@ -40,7 +40,7 @@ class Epa
|
||||
|
||||
bool Initialize( btSimplexSolverInterface& simplexSolver );
|
||||
|
||||
btScalar CalcPenDepth( btPoint3& wWitnessOnA, btPoint3& wWitnessOnB );
|
||||
btScalar calcPenDepth( btPoint3& wWitnessOnA, btPoint3& wWitnessOnB );
|
||||
|
||||
private :
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ subject to the following restrictions:
|
||||
btScalar g_GJKMaxRelError = 1e-3f;
|
||||
btScalar g_GJKMaxRelErrorSqrd = g_GJKMaxRelError * g_GJKMaxRelError;
|
||||
|
||||
bool EpaPenetrationDepthSolver::CalcPenDepth( btSimplexSolverInterface& simplexSolver,
|
||||
bool EpaPenetrationDepthSolver::calcPenDepth( btSimplexSolverInterface& simplexSolver,
|
||||
btConvexShape* pConvexA, btConvexShape* pConvexB,
|
||||
const btTransform& transformA, const btTransform& transformB,
|
||||
btVector3& v, btPoint3& wWitnessOnA, btPoint3& wWitnessOnB,
|
||||
@@ -79,7 +79,7 @@ bool EpaPenetrationDepthSolver::HybridPenDepth( btSimplexSolverInterface& simple
|
||||
btScalar squaredDistance = SIMD_INFINITY;
|
||||
btScalar delta = 0.f;
|
||||
|
||||
const btScalar margin = pConvexA->GetMargin() + pConvexB->GetMargin();
|
||||
const btScalar margin = pConvexA->getMargin() + pConvexB->getMargin();
|
||||
const btScalar marginSqrd = margin * margin;
|
||||
|
||||
simplexSolver.reset();
|
||||
@@ -93,8 +93,8 @@ bool EpaPenetrationDepthSolver::HybridPenDepth( btSimplexSolverInterface& simple
|
||||
btVector3 seperatingAxisInA = -v * transformA.getBasis();
|
||||
btVector3 seperatingAxisInB = v * transformB.getBasis();
|
||||
|
||||
btVector3 pInA = pConvexA->LocalGetSupportingVertexWithoutMargin( seperatingAxisInA );
|
||||
btVector3 qInB = pConvexB->LocalGetSupportingVertexWithoutMargin( seperatingAxisInB );
|
||||
btVector3 pInA = pConvexA->localGetSupportingVertexWithoutMargin( seperatingAxisInA );
|
||||
btVector3 qInB = pConvexB->localGetSupportingVertexWithoutMargin( seperatingAxisInB );
|
||||
|
||||
btPoint3 pWorld = transformA( pInA );
|
||||
btPoint3 qWorld = transformB( qInB );
|
||||
@@ -119,10 +119,10 @@ bool EpaPenetrationDepthSolver::HybridPenDepth( btSimplexSolverInterface& simple
|
||||
assert( ( squaredDistance > 0 ) && "squaredDistance is zero!" );
|
||||
btScalar vLength = sqrt( squaredDistance );
|
||||
|
||||
wWitnessOnA -= v * ( pConvexA->GetMargin() / vLength );
|
||||
wWitnessOnB += v * ( pConvexB->GetMargin() / vLength );
|
||||
wWitnessOnA -= v * ( pConvexA->getMargin() / vLength );
|
||||
wWitnessOnB += v * ( pConvexB->getMargin() / vLength );
|
||||
|
||||
penDepth = pConvexA->GetMargin() + pConvexB->GetMargin() - vLength;
|
||||
penDepth = pConvexA->getMargin() + pConvexB->getMargin() - vLength;
|
||||
|
||||
// Returning true means that Hybrid's result is ok and there's no need to run EPA
|
||||
return true;
|
||||
@@ -139,10 +139,10 @@ bool EpaPenetrationDepthSolver::HybridPenDepth( btSimplexSolverInterface& simple
|
||||
assert( ( squaredDistance > 0 ) && "squaredDistance is zero!" );
|
||||
btScalar vLength = sqrt( squaredDistance );
|
||||
|
||||
wWitnessOnA -= v * ( pConvexA->GetMargin() / vLength );
|
||||
wWitnessOnB += v * ( pConvexB->GetMargin() / vLength );
|
||||
wWitnessOnA -= v * ( pConvexA->getMargin() / vLength );
|
||||
wWitnessOnB += v * ( pConvexB->getMargin() / vLength );
|
||||
|
||||
penDepth = pConvexA->GetMargin() + pConvexB->GetMargin() - vLength;
|
||||
penDepth = pConvexA->getMargin() + pConvexB->getMargin() - vLength;
|
||||
|
||||
// Returning true means that Hybrid's result is ok and there's no need to run EPA
|
||||
return true;
|
||||
@@ -162,10 +162,10 @@ bool EpaPenetrationDepthSolver::HybridPenDepth( btSimplexSolverInterface& simple
|
||||
assert( ( squaredDistance > 0 ) && "squaredDistance is zero!" );
|
||||
btScalar vLength = sqrt( squaredDistance );
|
||||
|
||||
wWitnessOnA -= v * ( pConvexA->GetMargin() / vLength );
|
||||
wWitnessOnB += v * ( pConvexB->GetMargin() / vLength );
|
||||
wWitnessOnA -= v * ( pConvexA->getMargin() / vLength );
|
||||
wWitnessOnB += v * ( pConvexB->getMargin() / vLength );
|
||||
|
||||
penDepth = pConvexA->GetMargin() + pConvexB->GetMargin() - vLength;
|
||||
penDepth = pConvexA->getMargin() + pConvexB->getMargin() - vLength;
|
||||
|
||||
// Returning true means that Hybrid's result is ok and there's no need to run EPA
|
||||
return true;
|
||||
@@ -197,6 +197,6 @@ btScalar EpaPenetrationDepthSolver::EpaPenDepth( btSimplexSolverInterface& simpl
|
||||
return 0;
|
||||
}
|
||||
|
||||
return epa.CalcPenDepth( wWitnessOnA, wWitnessOnB );
|
||||
return epa.calcPenDepth( wWitnessOnA, wWitnessOnB );
|
||||
}
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ class EpaPenetrationDepthSolver : public btConvexPenetrationDepthSolver
|
||||
{
|
||||
public :
|
||||
|
||||
bool CalcPenDepth( btSimplexSolverInterface& simplexSolver,
|
||||
bool calcPenDepth( btSimplexSolverInterface& simplexSolver,
|
||||
btConvexShape* pConvexA, btConvexShape* pConvexB,
|
||||
const btTransform& transformA, const btTransform& transformB,
|
||||
btVector3& v, btPoint3& wWitnessOnA, btPoint3& wWitnessOnB,
|
||||
|
||||
Reference in New Issue
Block a user