Added Generic 6 DOF Constraint skeleton
This commit is contained in:
@@ -77,6 +77,9 @@ RaycastVehicle::VehicleTuning gTuning;
|
||||
#include "ConstraintSolver/ConstraintSolver.h"
|
||||
#include "ConstraintSolver/Point2PointConstraint.h"
|
||||
#include "ConstraintSolver/HingeConstraint.h"
|
||||
#include "ConstraintSolver/Generic6DofConstraint.h"
|
||||
|
||||
|
||||
|
||||
|
||||
//#include "BroadphaseCollision/QueryDispatcher.h"
|
||||
@@ -1184,9 +1187,37 @@ int CcdPhysicsEnvironment::createConstraint(class PHY_IPhysicsController* ctrl
|
||||
break;
|
||||
}
|
||||
|
||||
case PHY_GENERIC_6DOF_CONSTRAINT:
|
||||
{
|
||||
Generic6DofConstraint* genericConstraint = 0;
|
||||
|
||||
if (rb1)
|
||||
{
|
||||
genericConstraint = new Generic6DofConstraint(
|
||||
*rb0,
|
||||
*rb1,pivotInA,pivotInB,axisInA,axisInB);
|
||||
|
||||
|
||||
} else
|
||||
{
|
||||
genericConstraint = new Generic6DofConstraint(*rb0,
|
||||
pivotInA,axisInA);
|
||||
|
||||
}
|
||||
|
||||
|
||||
m_constraints.push_back(genericConstraint);
|
||||
genericConstraint->SetUserConstraintId(gConstraintUid++);
|
||||
genericConstraint->SetUserConstraintType(type);
|
||||
//64 bit systems can't cast pointer to int. could use size_t instead.
|
||||
return genericConstraint->GetUserConstraintId();
|
||||
|
||||
break;
|
||||
}
|
||||
case PHY_ANGULAR_CONSTRAINT:
|
||||
angularOnly = true;
|
||||
|
||||
|
||||
case PHY_LINEHINGE_CONSTRAINT:
|
||||
{
|
||||
HingeConstraint* hinge = 0;
|
||||
|
||||
@@ -82,7 +82,7 @@ typedef enum PHY_ConstraintType {
|
||||
PHY_LINEHINGE_CONSTRAINT=2,
|
||||
PHY_ANGULAR_CONSTRAINT = 3,//hinge without ball socket
|
||||
PHY_VEHICLE_CONSTRAINT=11,//complex 'constraint' that turns a rigidbody into a vehicle
|
||||
|
||||
PHY_GENERIC_6DOF_CONSTRAINT=12,//can leave any of the 6 degree of freedom 'free' or 'locked'
|
||||
|
||||
} PHY_ConstraintType;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user