diff options
Diffstat (limited to 'extern/bullet2/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h')
-rw-r--r-- | extern/bullet2/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h | 36 |
1 files changed, 33 insertions, 3 deletions
diff --git a/extern/bullet2/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h b/extern/bullet2/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h index a16e869a973..441fa375050 100644 --- a/extern/bullet2/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h +++ b/extern/bullet2/src/BulletDynamics/ConstraintSolver/btTypedConstraint.h @@ -16,9 +16,10 @@ subject to the following restrictions: #ifndef BT_TYPED_CONSTRAINT_H #define BT_TYPED_CONSTRAINT_H -class btRigidBody; + #include "LinearMath/btScalar.h" #include "btSolverConstraint.h" +#include "BulletDynamics/Dynamics/btRigidBody.h" class btSerializer; @@ -32,6 +33,7 @@ enum btTypedConstraintType SLIDER_CONSTRAINT_TYPE, CONTACT_CONSTRAINT_TYPE, D6_SPRING_CONSTRAINT_TYPE, + GEAR_CONSTRAINT_TYPE, MAX_CONSTRAINT_TYPE }; @@ -51,8 +53,17 @@ enum btConstraintParams #endif +ATTRIBUTE_ALIGNED16(struct) btJointFeedback +{ + btVector3 m_appliedForceBodyA; + btVector3 m_appliedTorqueBodyA; + btVector3 m_appliedForceBodyB; + btVector3 m_appliedTorqueBodyB; +}; + + ///TypedConstraint is the baseclass for Bullet constraints and vehicles -class btTypedConstraint : public btTypedObject +ATTRIBUTE_ALIGNED16(class) btTypedConstraint : public btTypedObject { int m_userConstraintType; @@ -80,6 +91,7 @@ protected: btRigidBody& m_rbB; btScalar m_appliedImpulse; btScalar m_dbgDrawSize; + btJointFeedback* m_jointFeedback; ///internal method used by the constraint solver, don't use them directly btScalar getMotorFactor(btScalar pos, btScalar lowLim, btScalar uppLim, btScalar vel, btScalar timeFact); @@ -87,6 +99,8 @@ protected: public: + BT_DECLARE_ALIGNED_ALLOCATOR(); + virtual ~btTypedConstraint() {}; btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA); btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA,btRigidBody& rbB); @@ -195,7 +209,7 @@ public: ///internal method used by the constraint solver, don't use them directly - virtual void solveConstraintObsolete(btRigidBody& /*bodyA*/,btRigidBody& /*bodyB*/,btScalar /*timeStep*/) {}; + virtual void solveConstraintObsolete(btSolverBody& /*bodyA*/,btSolverBody& /*bodyB*/,btScalar /*timeStep*/) {}; const btRigidBody& getRigidBodyA() const @@ -246,6 +260,22 @@ public: return m_userConstraintPtr; } + void setJointFeedback(btJointFeedback* jointFeedback) + { + m_jointFeedback = jointFeedback; + } + + const btJointFeedback* getJointFeedback() const + { + return m_jointFeedback; + } + + btJointFeedback* getJointFeedback() + { + return m_jointFeedback; + } + + int getUid() const { return m_userConstraintId; |