added basic RaycastVehicle support, and CcdPhysicsEnvironment::getAppliedImpulse(int constraintId), this value is useful as treshold to break constraints.
This commit is contained in:
@@ -335,8 +335,8 @@ m_enableSatCollisionDetection(false)
|
||||
{
|
||||
m_triggerCallbacks[i] = 0;
|
||||
}
|
||||
//if (!dispatcher)
|
||||
// dispatcher = new CollisionDispatcher();
|
||||
if (!dispatcher)
|
||||
dispatcher = new CollisionDispatcher();
|
||||
|
||||
|
||||
if(!pairCache)
|
||||
@@ -1834,3 +1834,18 @@ PHY_IPhysicsController* CcdPhysicsEnvironment::CreateConeController(float conera
|
||||
return sphereController;
|
||||
}
|
||||
|
||||
float CcdPhysicsEnvironment::getAppliedImpulse(int constraintid)
|
||||
{
|
||||
std::vector<TypedConstraint*>::iterator i;
|
||||
|
||||
for (i=m_constraints.begin();
|
||||
!(i==m_constraints.end()); i++)
|
||||
{
|
||||
TypedConstraint* constraint = (*i);
|
||||
if (constraint->GetUserConstraintId() == constraintid)
|
||||
{
|
||||
return constraint->GetAppliedImpulse();
|
||||
}
|
||||
}
|
||||
return 0.f;
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ class Dispatcher;
|
||||
//#include "BroadphaseInterface.h"
|
||||
|
||||
//switch on/off new vehicle support
|
||||
//#define NEW_BULLET_VEHICLE_SUPPORT 1
|
||||
#define NEW_BULLET_VEHICLE_SUPPORT 1
|
||||
|
||||
#include "ConstraintSolver/ContactSolverInfo.h"
|
||||
|
||||
@@ -41,6 +41,7 @@ class PersistentManifold;
|
||||
class BroadphaseInterface;
|
||||
class OverlappingPairCache;
|
||||
class IDebugDraw;
|
||||
class PHY_IVehicle;
|
||||
|
||||
/// CcdPhysicsEnvironment is experimental mainloop for physics simulation using optional continuous collision detection.
|
||||
/// Physics Environment takes care of stepping the simulation and is a container for physics entities.
|
||||
@@ -137,6 +138,8 @@ protected:
|
||||
|
||||
virtual void removeConstraint(int constraintid);
|
||||
|
||||
virtual float getAppliedImpulse(int constraintid);
|
||||
|
||||
|
||||
virtual void CallbackTriggers();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user