more small refactoring: some methods were still upper-case.
This commit is contained in:
@@ -257,7 +257,7 @@ bool btCollisionDispatcher::needsCollision(btCollisionObject* body0,btCollisionO
|
||||
printf("warning btCollisionDispatcher::needsCollision: static-static collision!\n");
|
||||
}
|
||||
|
||||
if ((!body0->IsActive()) && (!body1->IsActive()))
|
||||
if ((!body0->isActive()) && (!body1->isActive()))
|
||||
needsCollision = false;
|
||||
|
||||
return needsCollision ;
|
||||
|
||||
@@ -30,22 +30,22 @@ btCollisionObject::btCollisionObject()
|
||||
}
|
||||
|
||||
|
||||
void btCollisionObject::SetActivationState(int newState)
|
||||
void btCollisionObject::setActivationState(int newState)
|
||||
{
|
||||
if ( (m_activationState1 != DISABLE_DEACTIVATION) && (m_activationState1 != DISABLE_SIMULATION))
|
||||
m_activationState1 = newState;
|
||||
}
|
||||
|
||||
void btCollisionObject::ForceActivationState(int newState)
|
||||
void btCollisionObject::forceActivationState(int newState)
|
||||
{
|
||||
m_activationState1 = newState;
|
||||
}
|
||||
|
||||
void btCollisionObject::activate()
|
||||
{
|
||||
if (!(m_collisionFlags & (CF_STATIC_OBJECT|CF_KINEMATIC_OJBECT)))
|
||||
if (!(m_collisionFlags & (CF_STATIC_OBJECT|CF_KINEMATIC_OBJECT)))
|
||||
{
|
||||
SetActivationState(ACTIVE_TAG);
|
||||
setActivationState(ACTIVE_TAG);
|
||||
m_deactivationTime = 0.f;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public:
|
||||
enum CollisionFlags
|
||||
{
|
||||
CF_STATIC_OBJECT= 1,
|
||||
CF_KINEMATIC_OJBECT= 2,
|
||||
CF_KINEMATIC_OBJECT= 2,
|
||||
CF_NO_CONTACT_RESPONSE = 4,
|
||||
CF_CUSTOM_MATERIAL_CALLBACK = 8,//this allows per-triangle material (friction/restitution)
|
||||
};
|
||||
@@ -89,7 +89,7 @@ public:
|
||||
inline bool mergesSimulationIslands() const
|
||||
{
|
||||
///static objects, kinematic and object without contact response don't merge islands
|
||||
return ((m_collisionFlags & (CF_STATIC_OBJECT | CF_KINEMATIC_OJBECT | CF_NO_CONTACT_RESPONSE) )==0);
|
||||
return ((m_collisionFlags & (CF_STATIC_OBJECT | CF_KINEMATIC_OBJECT | CF_NO_CONTACT_RESPONSE) )==0);
|
||||
}
|
||||
|
||||
|
||||
@@ -99,12 +99,12 @@ public:
|
||||
|
||||
inline bool isKinematicObject() const
|
||||
{
|
||||
return (m_collisionFlags & CF_KINEMATIC_OJBECT) != 0;
|
||||
return (m_collisionFlags & CF_KINEMATIC_OBJECT) != 0;
|
||||
}
|
||||
|
||||
inline bool isStaticOrKinematicObject() const
|
||||
{
|
||||
return (m_collisionFlags & (CF_KINEMATIC_OJBECT | CF_STATIC_OBJECT)) != 0 ;
|
||||
return (m_collisionFlags & (CF_KINEMATIC_OBJECT | CF_STATIC_OBJECT)) != 0 ;
|
||||
}
|
||||
|
||||
inline bool hasContactResponse() const {
|
||||
@@ -133,9 +133,9 @@ public:
|
||||
|
||||
|
||||
|
||||
int GetActivationState() const { return m_activationState1;}
|
||||
int getActivationState() const { return m_activationState1;}
|
||||
|
||||
void SetActivationState(int newState);
|
||||
void setActivationState(int newState);
|
||||
|
||||
void setDeactivationTime(float time)
|
||||
{
|
||||
@@ -146,13 +146,13 @@ public:
|
||||
return m_deactivationTime;
|
||||
}
|
||||
|
||||
void ForceActivationState(int newState);
|
||||
void forceActivationState(int newState);
|
||||
|
||||
void activate();
|
||||
|
||||
inline bool IsActive() const
|
||||
inline bool isActive() const
|
||||
{
|
||||
return ((GetActivationState() != ISLAND_SLEEPING) && (GetActivationState() != DISABLE_SIMULATION));
|
||||
return ((getActivationState() != ISLAND_SLEEPING) && (getActivationState() != DISABLE_SIMULATION));
|
||||
}
|
||||
|
||||
void setRestitution(float rest)
|
||||
|
||||
@@ -166,11 +166,11 @@ void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher,
|
||||
assert((colObj0->getIslandTag() == islandId) || (colObj0->getIslandTag() == -1));
|
||||
if (colObj0->getIslandTag() == islandId)
|
||||
{
|
||||
if (colObj0->GetActivationState()== ACTIVE_TAG)
|
||||
if (colObj0->getActivationState()== ACTIVE_TAG)
|
||||
{
|
||||
allSleeping = false;
|
||||
}
|
||||
if (colObj0->GetActivationState()== DISABLE_DEACTIVATION)
|
||||
if (colObj0->getActivationState()== DISABLE_DEACTIVATION)
|
||||
{
|
||||
allSleeping = false;
|
||||
}
|
||||
@@ -193,7 +193,7 @@ void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher,
|
||||
|
||||
if (colObj0->getIslandTag() == islandId)
|
||||
{
|
||||
colObj0->SetActivationState( ISLAND_SLEEPING );
|
||||
colObj0->setActivationState( ISLAND_SLEEPING );
|
||||
}
|
||||
}
|
||||
} else
|
||||
@@ -214,9 +214,9 @@ void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher,
|
||||
|
||||
if (colObj0->getIslandTag() == islandId)
|
||||
{
|
||||
if ( colObj0->GetActivationState() == ISLAND_SLEEPING)
|
||||
if ( colObj0->getActivationState() == ISLAND_SLEEPING)
|
||||
{
|
||||
colObj0->SetActivationState( WANTS_DEACTIVATION);
|
||||
colObj0->setActivationState( WANTS_DEACTIVATION);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -236,17 +236,17 @@ void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher,
|
||||
btCollisionObject* colObj1 = static_cast<btCollisionObject*>(manifold->getBody1());
|
||||
|
||||
//todo: check sleeping conditions!
|
||||
if (((colObj0) && colObj0->GetActivationState() != ISLAND_SLEEPING) ||
|
||||
((colObj1) && colObj1->GetActivationState() != ISLAND_SLEEPING))
|
||||
if (((colObj0) && colObj0->getActivationState() != ISLAND_SLEEPING) ||
|
||||
((colObj1) && colObj1->getActivationState() != ISLAND_SLEEPING))
|
||||
{
|
||||
//kinematic objects don't merge islands, but wake up all connected objects
|
||||
if (colObj0->isKinematicObject() && colObj0->GetActivationState() != ISLAND_SLEEPING)
|
||||
if (colObj0->isKinematicObject() && colObj0->getActivationState() != ISLAND_SLEEPING)
|
||||
{
|
||||
colObj1->SetActivationState(ACTIVE_TAG);
|
||||
colObj1->setActivationState(ACTIVE_TAG);
|
||||
}
|
||||
if (colObj1->isKinematicObject() && colObj1->GetActivationState() != ISLAND_SLEEPING)
|
||||
if (colObj1->isKinematicObject() && colObj1->getActivationState() != ISLAND_SLEEPING)
|
||||
{
|
||||
colObj0->SetActivationState(ACTIVE_TAG);
|
||||
colObj0->setActivationState(ACTIVE_TAG);
|
||||
}
|
||||
|
||||
//filtering for response
|
||||
|
||||
@@ -28,6 +28,7 @@ float maxdist2 = 1.e30f;
|
||||
|
||||
#ifdef __SPU__
|
||||
#include <spu_printf.h>
|
||||
#define printf spu_printf
|
||||
#endif //__SPU__
|
||||
|
||||
btGjkPairDetector::btGjkPairDetector(btConvexShape* objectA,btConvexShape* objectB,btSimplexSolverInterface* simplexSolver,btConvexPenetrationDepthSolver* penetrationDepthSolver)
|
||||
@@ -133,6 +134,7 @@ void btGjkPairDetector::getClosestPoints(const ClosestPointInput& input,Result&
|
||||
if (curIter++ > gGjkMaxIter)
|
||||
{
|
||||
#if defined(DEBUG) || defined (_DEBUG)
|
||||
|
||||
printf("btGjkPairDetector maxIter exceeded:%i\n",curIter);
|
||||
printf("sepAxis=(%f,%f,%f), squaredDistance = %f, shapeTypeA=%i,shapeTypeB=%i\n",
|
||||
m_cachedSeparatingAxis.getX(),
|
||||
@@ -141,6 +143,7 @@ void btGjkPairDetector::getClosestPoints(const ClosestPointInput& input,Result&
|
||||
squaredDistance,
|
||||
m_minkowskiA->getShapeType(),
|
||||
m_minkowskiB->getShapeType());
|
||||
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user