Add a btTypedUserInfo field to btTypedConstraint

This commit is contained in:
johnmccutchan
2008-02-05 18:57:06 +00:00
parent cb79016591
commit 023f25c539
2 changed files with 9 additions and 5 deletions

View File

@@ -23,6 +23,7 @@ btTypedConstraint::btTypedConstraint(btTypedConstraintType type)
:m_userConstraintType(-1), :m_userConstraintType(-1),
m_userConstraintId(-1), m_userConstraintId(-1),
m_constraintType (type), m_constraintType (type),
m_typedUserInfo(0),
m_rbA(s_fixed), m_rbA(s_fixed),
m_rbB(s_fixed), m_rbB(s_fixed),
m_appliedImpulse(btScalar(0.)) m_appliedImpulse(btScalar(0.))
@@ -32,6 +33,7 @@ m_appliedImpulse(btScalar(0.))
btTypedConstraint::btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA) btTypedConstraint::btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA)
:m_userConstraintType(-1), :m_userConstraintType(-1),
m_userConstraintId(-1), m_userConstraintId(-1),
m_typedUserInfo(0),
m_constraintType (type), m_constraintType (type),
m_rbA(rbA), m_rbA(rbA),
m_rbB(s_fixed), m_rbB(s_fixed),
@@ -45,6 +47,7 @@ m_appliedImpulse(btScalar(0.))
btTypedConstraint::btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA,btRigidBody& rbB) btTypedConstraint::btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA,btRigidBody& rbB)
:m_userConstraintType(-1), :m_userConstraintType(-1),
m_userConstraintId(-1), m_userConstraintId(-1),
m_typedUserInfo(0),
m_constraintType (type), m_constraintType (type),
m_rbA(rbA), m_rbA(rbA),
m_rbB(rbB), m_rbB(rbB),

View File

@@ -17,6 +17,7 @@ subject to the following restrictions:
#define TYPED_CONSTRAINT_H #define TYPED_CONSTRAINT_H
class btRigidBody; class btRigidBody;
class btTypedUserInfo;
#include "LinearMath/btScalar.h" #include "LinearMath/btScalar.h"
enum btTypedConstraintType enum btTypedConstraintType
@@ -33,7 +34,7 @@ class btTypedConstraint
{ {
int m_userConstraintType; int m_userConstraintType;
int m_userConstraintId; int m_userConstraintId;
char* m_name; btTypedUserInfo* m_typedUserInfo;
btTypedConstraintType m_constraintType; btTypedConstraintType m_constraintType;
@@ -109,14 +110,14 @@ public:
return m_constraintType; return m_constraintType;
} }
char* getName () const btTypedUserInfo* getTypedUserInfo () const
{ {
return m_name; return m_typedUserInfo;
} }
void setName (char* name) void setTypedUserInfo (btTypedUserInfo* typedUserInfo)
{ {
m_name = name; m_typedUserInfo = typedUserInfo;
} }
}; };