Changeset 8351 for code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h
- Timestamp:
- Apr 28, 2011, 7:15:14 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h
r5781 r8351 23 23 class btRigidBody; 24 24 25 26 #ifdef BT_USE_DOUBLE_PRECISION 27 #define btPoint2PointConstraintData btPoint2PointConstraintDoubleData 28 #define btPoint2PointConstraintDataName "btPoint2PointConstraintDoubleData" 29 #else 30 #define btPoint2PointConstraintData btPoint2PointConstraintFloatData 31 #define btPoint2PointConstraintDataName "btPoint2PointConstraintFloatData" 32 #endif //BT_USE_DOUBLE_PRECISION 33 25 34 struct btConstraintSetting 26 35 { … … 36 45 }; 37 46 47 enum btPoint2PointFlags 48 { 49 BT_P2P_FLAGS_ERP = 1, 50 BT_P2P_FLAGS_CFM = 2 51 }; 52 38 53 /// point to point constraint between two rigidbodies each with a pivotpoint that descibes the 'ballsocket' location in local space 39 classbtPoint2PointConstraint : public btTypedConstraint54 ATTRIBUTE_ALIGNED16(class) btPoint2PointConstraint : public btTypedConstraint 40 55 { 41 56 #ifdef IN_PARALLELL_SOLVER … … 47 62 btVector3 m_pivotInB; 48 63 49 64 int m_flags; 65 btScalar m_erp; 66 btScalar m_cfm; 50 67 51 68 public: … … 60 77 btPoint2PointConstraint(btRigidBody& rbA,const btVector3& pivotInA); 61 78 62 btPoint2PointConstraint();63 79 64 80 virtual void buildJacobian(); … … 66 82 virtual void getInfo1 (btConstraintInfo1* info); 67 83 84 void getInfo1NonVirtual (btConstraintInfo1* info); 85 68 86 virtual void getInfo2 (btConstraintInfo2* info); 69 87 70 71 virtual void solveConstraintObsolete(btSolverBody& bodyA,btSolverBody& bodyB,btScalar timeStep); 88 void getInfo2NonVirtual (btConstraintInfo2* info, const btTransform& body0_trans, const btTransform& body1_trans); 72 89 73 90 void updateRHS(btScalar timeStep); … … 93 110 } 94 111 112 ///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5). 113 ///If no axis is provided, it uses the default axis for this constraint. 114 virtual void setParam(int num, btScalar value, int axis = -1); 115 ///return the local value of parameter 116 virtual btScalar getParam(int num, int axis = -1) const; 117 118 virtual int calculateSerializeBufferSize() const; 119 120 ///fills the dataBuffer and returns the struct name (and 0 on failure) 121 virtual const char* serialize(void* dataBuffer, btSerializer* serializer) const; 122 95 123 96 124 }; 97 125 126 ///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 127 struct btPoint2PointConstraintFloatData 128 { 129 btTypedConstraintData m_typeConstraintData; 130 btVector3FloatData m_pivotInA; 131 btVector3FloatData m_pivotInB; 132 }; 133 134 ///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 135 struct btPoint2PointConstraintDoubleData 136 { 137 btTypedConstraintData m_typeConstraintData; 138 btVector3DoubleData m_pivotInA; 139 btVector3DoubleData m_pivotInB; 140 }; 141 142 143 SIMD_FORCE_INLINE int btPoint2PointConstraint::calculateSerializeBufferSize() const 144 { 145 return sizeof(btPoint2PointConstraintData); 146 147 } 148 149 ///fills the dataBuffer and returns the struct name (and 0 on failure) 150 SIMD_FORCE_INLINE const char* btPoint2PointConstraint::serialize(void* dataBuffer, btSerializer* serializer) const 151 { 152 btPoint2PointConstraintData* p2pData = (btPoint2PointConstraintData*)dataBuffer; 153 154 btTypedConstraint::serialize(&p2pData->m_typeConstraintData,serializer); 155 m_pivotInA.serialize(p2pData->m_pivotInA); 156 m_pivotInB.serialize(p2pData->m_pivotInB); 157 158 return btPoint2PointConstraintDataName; 159 } 160 98 161 #endif //POINT2POINTCONSTRAINT_H
Note: See TracChangeset
for help on using the changeset viewer.