b3GetFixedSolverSet
This commit is contained in:
parent
85a1186e03
commit
66450f0ebf
12 changed files with 27 additions and 21 deletions
|
|
@ -183,7 +183,7 @@ void b3CreateContact( b3World* world, b3Shape* shapeA, b3Shape* shapeB, int chil
|
|||
setIndex = b3_disabledSet;
|
||||
}
|
||||
|
||||
b3SolverSet* set = b3GetSolverSet( world, setIndex );
|
||||
b3SolverSet* set = b3GetFixedSolverSet( world, setIndex );
|
||||
|
||||
// Create contact key and contact
|
||||
int contactId = b3AllocId( &world->contactIdPool );
|
||||
|
|
|
|||
|
|
@ -256,8 +256,8 @@ void b3PrepareDistanceJoint( b3JointSim* base, b3StepContext* context )
|
|||
|
||||
B3_ASSERT( bodyA->setIndex == b3_awakeSet || bodyB->setIndex == b3_awakeSet );
|
||||
|
||||
b3SolverSet* setA = b3GetSolverSet( world, bodyA->setIndex );
|
||||
b3SolverSet* setB = b3GetSolverSet( world, bodyB->setIndex );
|
||||
b3SolverSet* setA = b3GetFixedSolverSet( world, bodyA->setIndex );
|
||||
b3SolverSet* setB = b3GetFixedSolverSet( world, bodyB->setIndex );
|
||||
|
||||
int localIndexA = bodyA->localIndex;
|
||||
int localIndexB = bodyB->localIndex;
|
||||
|
|
|
|||
|
|
@ -193,8 +193,8 @@ void b3PrepareMotorJoint( b3JointSim* base, b3StepContext* context )
|
|||
|
||||
B3_ASSERT( bodyA->setIndex == b3_awakeSet || bodyB->setIndex == b3_awakeSet );
|
||||
|
||||
b3SolverSet* setA = b3GetSolverSet( world, bodyA->setIndex );
|
||||
b3SolverSet* setB = b3GetSolverSet( world, bodyB->setIndex );
|
||||
b3SolverSet* setA = b3GetFixedSolverSet( world, bodyA->setIndex );
|
||||
b3SolverSet* setB = b3GetFixedSolverSet( world, bodyB->setIndex );
|
||||
|
||||
int localIndexA = bodyA->localIndex;
|
||||
int localIndexB = bodyB->localIndex;
|
||||
|
|
|
|||
|
|
@ -65,8 +65,8 @@ void b3PrepareMoverJoint( b3JointSim* base, b3StepContext* context )
|
|||
|
||||
B3_ASSERT( bodyA->setIndex == b3_awakeSet || bodyB->setIndex == b3_awakeSet );
|
||||
|
||||
b3SolverSet* setA = b3GetSolverSet( world, bodyA->setIndex );
|
||||
b3SolverSet* setB = b3GetSolverSet( world, bodyB->setIndex );
|
||||
b3SolverSet* setA = b3GetFixedSolverSet( world, bodyA->setIndex );
|
||||
b3SolverSet* setB = b3GetFixedSolverSet( world, bodyB->setIndex );
|
||||
|
||||
int localIndexA = bodyA->localIndex;
|
||||
int localIndexB = bodyB->localIndex;
|
||||
|
|
|
|||
|
|
@ -81,8 +81,8 @@ void b3PrepareParallelJoint( b3JointSim* base, b3StepContext* context )
|
|||
b3Body* bodyB = b3Array_Get( world->bodies, base->bodyIdB );
|
||||
|
||||
B3_ASSERT( bodyA->setIndex == b3_awakeSet || bodyB->setIndex == b3_awakeSet );
|
||||
b3SolverSet* setA = b3GetSolverSet( world, bodyA->setIndex );
|
||||
b3SolverSet* setB = b3GetSolverSet( world, bodyB->setIndex );
|
||||
b3SolverSet* setA = b3GetFixedSolverSet( world, bodyA->setIndex );
|
||||
b3SolverSet* setB = b3GetFixedSolverSet( world, bodyB->setIndex );
|
||||
|
||||
int localIndexA = bodyA->localIndex;
|
||||
int localIndexB = bodyB->localIndex;
|
||||
|
|
|
|||
|
|
@ -312,6 +312,12 @@ static inline b3SolverSet* b3GetSolverSet( b3World* world, int setIndex )
|
|||
return b3Array_Get( world->sleepingSets, setIndex - b3_firstSleepingSet );
|
||||
}
|
||||
|
||||
static inline b3SolverSet* b3GetFixedSolverSet( b3World* world, int setIndex )
|
||||
{
|
||||
B3_ASSERT( 0 <= setIndex && setIndex < b3_firstSleepingSet );
|
||||
return world->fixedSets + setIndex;
|
||||
}
|
||||
|
||||
static inline int b3GetSolverSetCount( const b3World* world )
|
||||
{
|
||||
return b3_firstSleepingSet + world->sleepingSets.count;
|
||||
|
|
|
|||
|
|
@ -184,8 +184,8 @@ void b3PreparePogoJoint( b3JointSim* base, b3StepContext* context )
|
|||
|
||||
B3_ASSERT( bodyA->setIndex == b3_awakeSet || bodyB->setIndex == b3_awakeSet );
|
||||
|
||||
b3SolverSet* setA = b3GetSolverSet( world, bodyA->setIndex );
|
||||
b3SolverSet* setB = b3GetSolverSet( world, bodyB->setIndex );
|
||||
b3SolverSet* setA = b3GetFixedSolverSet( world, bodyA->setIndex );
|
||||
b3SolverSet* setB = b3GetFixedSolverSet( world, bodyB->setIndex );
|
||||
|
||||
int localIndexA = bodyA->localIndex;
|
||||
int localIndexB = bodyB->localIndex;
|
||||
|
|
|
|||
|
|
@ -308,8 +308,8 @@ void b3PreparePrismaticJoint( b3JointSim* base, b3StepContext* context )
|
|||
b3Body* bodyB = b3Array_Get( world->bodies, base->bodyIdB );
|
||||
|
||||
B3_ASSERT( bodyA->setIndex == b3_awakeSet || bodyB->setIndex == b3_awakeSet );
|
||||
b3SolverSet* setA = b3GetSolverSet( world, bodyA->setIndex );
|
||||
b3SolverSet* setB = b3GetSolverSet( world, bodyB->setIndex );
|
||||
b3SolverSet* setA = b3GetFixedSolverSet( world, bodyA->setIndex );
|
||||
b3SolverSet* setB = b3GetFixedSolverSet( world, bodyB->setIndex );
|
||||
|
||||
int localIndexA = bodyA->localIndex;
|
||||
int localIndexB = bodyB->localIndex;
|
||||
|
|
|
|||
|
|
@ -267,8 +267,8 @@ void b3PrepareRevoluteJoint( b3JointSim* base, b3StepContext* context )
|
|||
b3Body* bodyB = b3Array_Get( world->bodies, base->bodyIdB );
|
||||
|
||||
B3_ASSERT( bodyA->setIndex == b3_awakeSet || bodyB->setIndex == b3_awakeSet );
|
||||
b3SolverSet* setA = b3GetSolverSet( world, bodyA->setIndex );
|
||||
b3SolverSet* setB = b3GetSolverSet( world, bodyB->setIndex );
|
||||
b3SolverSet* setA = b3GetFixedSolverSet( world, bodyA->setIndex );
|
||||
b3SolverSet* setB = b3GetFixedSolverSet( world, bodyB->setIndex );
|
||||
|
||||
int localIndexA = bodyA->localIndex;
|
||||
int localIndexB = bodyB->localIndex;
|
||||
|
|
|
|||
|
|
@ -301,8 +301,8 @@ void b3PrepareSphericalJoint( b3JointSim* base, b3StepContext* context )
|
|||
b3Body* bodyB = b3Array_Get( world->bodies, base->bodyIdB );
|
||||
|
||||
B3_ASSERT( bodyA->setIndex == b3_awakeSet || bodyB->setIndex == b3_awakeSet );
|
||||
b3SolverSet* setA = b3GetSolverSet( world, bodyA->setIndex );
|
||||
b3SolverSet* setB = b3GetSolverSet( world, bodyB->setIndex );
|
||||
b3SolverSet* setA = b3GetFixedSolverSet( world, bodyA->setIndex );
|
||||
b3SolverSet* setB = b3GetFixedSolverSet( world, bodyB->setIndex );
|
||||
|
||||
int localIndexA = bodyA->localIndex;
|
||||
int localIndexB = bodyB->localIndex;
|
||||
|
|
|
|||
|
|
@ -92,8 +92,8 @@ void b3PrepareWeldJoint( b3JointSim* base, b3StepContext* context )
|
|||
b3Body* bodyB = b3Array_Get( world->bodies, base->bodyIdB );
|
||||
|
||||
B3_ASSERT( bodyA->setIndex == b3_awakeSet || bodyB->setIndex == b3_awakeSet );
|
||||
b3SolverSet* setA = b3GetSolverSet( world, bodyA->setIndex );
|
||||
b3SolverSet* setB = b3GetSolverSet( world, bodyB->setIndex );
|
||||
b3SolverSet* setA = b3GetFixedSolverSet( world, bodyA->setIndex );
|
||||
b3SolverSet* setB = b3GetFixedSolverSet( world, bodyB->setIndex );
|
||||
|
||||
int localIndexA = bodyA->localIndex;
|
||||
int localIndexB = bodyB->localIndex;
|
||||
|
|
|
|||
|
|
@ -416,8 +416,8 @@ void b3PrepareWheelJoint( b3JointSim* base, b3StepContext* context )
|
|||
b3Body* bodyB = b3Array_Get( world->bodies, idB );
|
||||
|
||||
B3_ASSERT( bodyA->setIndex == b3_awakeSet || bodyB->setIndex == b3_awakeSet );
|
||||
b3SolverSet* setA = b3GetSolverSet( world, bodyA->setIndex );
|
||||
b3SolverSet* setB = b3GetSolverSet( world, bodyB->setIndex );
|
||||
b3SolverSet* setA = b3GetFixedSolverSet( world, bodyA->setIndex );
|
||||
b3SolverSet* setB = b3GetFixedSolverSet( world, bodyB->setIndex );
|
||||
|
||||
int localIndexA = bodyA->localIndex;
|
||||
int localIndexB = bodyB->localIndex;
|
||||
|
|
|
|||
Loading…
Reference in a new issue