mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-13 21:30:09 +00:00
Merge pull request #2714 from stolk/master
Add checks. Remove unused member var.
This commit is contained in:
commit
440c077b6d
@ -654,7 +654,7 @@ void PhysicsClientExample::createButtons()
|
||||
{
|
||||
if (m_numMotors < MAX_NUM_MOTORS)
|
||||
{
|
||||
char motorName[1024];
|
||||
char motorName[1026];
|
||||
snprintf(motorName, sizeof(motorName), "%s q", info.m_jointName);
|
||||
// MyMotorInfo2* motorInfo = &m_motorTargetVelocities[m_numMotors];
|
||||
MyMotorInfo2* motorInfo = &m_motorTargetPositions[m_numMotors];
|
||||
|
@ -46,8 +46,6 @@ protected:
|
||||
|
||||
btAlignedObjectArray<btPersistentManifold*> m_manifoldsPtr;
|
||||
|
||||
btManifoldResult m_defaultManifoldResult;
|
||||
|
||||
btNearCallback m_nearCallback;
|
||||
|
||||
btPoolAllocator* m_collisionAlgorithmPoolAllocator;
|
||||
@ -95,11 +93,15 @@ public:
|
||||
|
||||
btPersistentManifold* getManifoldByIndexInternal(int index)
|
||||
{
|
||||
btAssert(index>=0);
|
||||
btAssert(index<m_manifoldsPtr.size());
|
||||
return m_manifoldsPtr[index];
|
||||
}
|
||||
|
||||
const btPersistentManifold* getManifoldByIndexInternal(int index) const
|
||||
{
|
||||
btAssert(index>=0);
|
||||
btAssert(index<m_manifoldsPtr.size());
|
||||
return m_manifoldsPtr[index];
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,9 @@ subject to the following restrictions:
|
||||
*/
|
||||
|
||||
//#define COMPUTE_IMPULSE_DENOM 1
|
||||
//#define BT_ADDITIONAL_DEBUG
|
||||
#ifdef BT_DEBUG
|
||||
# define BT_ADDITIONAL_DEBUG
|
||||
#endif
|
||||
|
||||
//It is not necessary (redundant) to refresh contact manifolds, this refresh has been moved to the collision algorithms.
|
||||
|
||||
@ -690,8 +692,10 @@ int btSequentialImpulseConstraintSolver::getOrInitSolverBody(btCollisionObject&
|
||||
{
|
||||
#if BT_THREADSAFE
|
||||
int solverBodyId = -1;
|
||||
bool isRigidBodyType = btRigidBody::upcast(&body) != NULL;
|
||||
if (isRigidBodyType && !body.isStaticOrKinematicObject())
|
||||
const bool isRigidBodyType = btRigidBody::upcast(&body) != NULL;
|
||||
const bool isStaticOrKinematic = body.isStaticOrKinematicObject();
|
||||
const bool isKinematic = body.isKinematicObject();
|
||||
if (isRigidBodyType && !isStaticOrKinematic)
|
||||
{
|
||||
// dynamic body
|
||||
// Dynamic bodies can only be in one island, so it's safe to write to the companionId
|
||||
@ -704,7 +708,7 @@ int btSequentialImpulseConstraintSolver::getOrInitSolverBody(btCollisionObject&
|
||||
body.setCompanionId(solverBodyId);
|
||||
}
|
||||
}
|
||||
else if (isRigidBodyType && body.isKinematicObject())
|
||||
else if (isRigidBodyType && isKinematic)
|
||||
{
|
||||
//
|
||||
// NOTE: must test for kinematic before static because some kinematic objects also
|
||||
|
@ -171,6 +171,7 @@ void btSimulationIslandManagerMt::initIslandPools()
|
||||
|
||||
btSimulationIslandManagerMt::Island* btSimulationIslandManagerMt::getIsland(int id)
|
||||
{
|
||||
btAssert(id >= 0);
|
||||
btAssert(id < m_lookupIslandFromId.size());
|
||||
Island* island = m_lookupIslandFromId[id];
|
||||
if (island == NULL)
|
||||
|
Loading…
Reference in New Issue
Block a user