- Timestamp:
- Mar 31, 2009, 8:05:51 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/bullet/BulletDynamics/ConstraintSolver/btTypedConstraint.h
r2662 r2882 19 19 class btRigidBody; 20 20 #include "LinearMath/btScalar.h" 21 #include "btSolverConstraint.h" 22 struct btSolverBody; 23 24 25 21 26 22 27 enum btTypedConstraintType … … 26 31 CONETWIST_CONSTRAINT_TYPE, 27 32 D6_CONSTRAINT_TYPE, 28 VEHICLE_CONSTRAINT_TYPE,29 33 SLIDER_CONSTRAINT_TYPE 30 34 }; … … 49 53 btRigidBody& m_rbB; 50 54 btScalar m_appliedImpulse; 55 btScalar m_dbgDrawSize; 51 56 52 57 … … 56 61 virtual ~btTypedConstraint() {}; 57 62 btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA); 63 btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA,btRigidBody& rbB); 58 64 59 btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA,btRigidBody& rbB); 65 struct btConstraintInfo1 { 66 int m_numConstraintRows,nub; 67 }; 68 69 struct btConstraintInfo2 { 70 // integrator parameters: frames per second (1/stepsize), default error 71 // reduction parameter (0..1). 72 btScalar fps,erp; 73 74 // for the first and second body, pointers to two (linear and angular) 75 // n*3 jacobian sub matrices, stored by rows. these matrices will have 76 // been initialized to 0 on entry. if the second body is zero then the 77 // J2xx pointers may be 0. 78 btScalar *m_J1linearAxis,*m_J1angularAxis,*m_J2linearAxis,*m_J2angularAxis; 79 80 // elements to jump from one row to the next in J's 81 int rowskip; 82 83 // right hand sides of the equation J*v = c + cfm * lambda. cfm is the 84 // "constraint force mixing" vector. c is set to zero on entry, cfm is 85 // set to a constant value (typically very small or zero) value on entry. 86 btScalar *m_constraintError,*cfm; 87 88 // lo and hi limits for variables (set to -/+ infinity on entry). 89 btScalar *m_lowerLimit,*m_upperLimit; 90 91 // findex vector for variables. see the LCP solver interface for a 92 // description of what this does. this is set to -1 on entry. 93 // note that the returned indexes are relative to the first index of 94 // the constraint. 95 int *findex; 96 }; 97 60 98 61 99 virtual void buildJacobian() = 0; 62 100 63 virtual void solveConstraint(btScalar timeStep) = 0; 101 virtual void setupSolverConstraint(btConstraintArray& ca, int solverBodyA,int solverBodyB, btScalar timeStep) 102 { 103 } 104 virtual void getInfo1 (btConstraintInfo1* info)=0; 64 105 106 virtual void getInfo2 (btConstraintInfo2* info)=0; 107 108 virtual void solveConstraintObsolete(btSolverBody& bodyA,btSolverBody& bodyB,btScalar timeStep) = 0; 109 110 btScalar getMotorFactor(btScalar pos, btScalar lowLim, btScalar uppLim, btScalar vel, btScalar timeFact); 111 65 112 const btRigidBody& getRigidBodyA() const 66 113 { … … 95 142 m_userConstraintId = uid; 96 143 } 97 144 98 145 int getUserConstraintId() const 99 146 { … … 115 162 return m_constraintType; 116 163 } 117 164 165 void setDbgDrawSize(btScalar dbgDrawSize) 166 { 167 m_dbgDrawSize = dbgDrawSize; 168 } 169 btScalar getDbgDrawSize() 170 { 171 return m_dbgDrawSize; 172 } 173 118 174 }; 119 175
Note: See TracChangeset
for help on using the changeset viewer.