Changeset 8393 for code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h
- Timestamp:
- May 3, 2011, 5:07:42 AM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/external/bullet/BulletDynamics/ConstraintSolver/btGeneric6DofSpringConstraint.h
r8351 r8393 14 14 */ 15 15 16 #ifndef GENERIC_6DOF_SPRING_CONSTRAINT_H17 #define GENERIC_6DOF_SPRING_CONSTRAINT_H16 #ifndef BT_GENERIC_6DOF_SPRING_CONSTRAINT_H 17 #define BT_GENERIC_6DOF_SPRING_CONSTRAINT_H 18 18 19 19 … … 49 49 void setEquilibriumPoint(int index); // set the current constraint position/orientation as an equilibrium point for given DOF 50 50 void setEquilibriumPoint(int index, btScalar val); 51 52 virtual void setAxis( const btVector3& axis1, const btVector3& axis2); 53 51 54 virtual void getInfo2 (btConstraintInfo2* info); 55 56 virtual int calculateSerializeBufferSize() const; 57 ///fills the dataBuffer and returns the struct name (and 0 on failure) 58 virtual const char* serialize(void* dataBuffer, btSerializer* serializer) const; 59 52 60 }; 53 61 54 #endif // GENERIC_6DOF_SPRING_CONSTRAINT_H55 62 63 ///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64 64 struct btGeneric6DofSpringConstraintData 65 { 66 btGeneric6DofConstraintData m_6dofData; 67 68 int m_springEnabled[6]; 69 float m_equilibriumPoint[6]; 70 float m_springStiffness[6]; 71 float m_springDamping[6]; 72 }; 73 74 SIMD_FORCE_INLINE int btGeneric6DofSpringConstraint::calculateSerializeBufferSize() const 75 { 76 return sizeof(btGeneric6DofSpringConstraintData); 77 } 78 79 ///fills the dataBuffer and returns the struct name (and 0 on failure) 80 SIMD_FORCE_INLINE const char* btGeneric6DofSpringConstraint::serialize(void* dataBuffer, btSerializer* serializer) const 81 { 82 btGeneric6DofSpringConstraintData* dof = (btGeneric6DofSpringConstraintData*)dataBuffer; 83 btGeneric6DofConstraint::serialize(&dof->m_6dofData,serializer); 84 85 int i; 86 for (i=0;i<6;i++) 87 { 88 dof->m_equilibriumPoint[i] = m_equilibriumPoint[i]; 89 dof->m_springDamping[i] = m_springDamping[i]; 90 dof->m_springEnabled[i] = m_springEnabled[i]? 1 : 0; 91 dof->m_springStiffness[i] = m_springStiffness[i]; 92 } 93 return "btGeneric6DofConstraintData"; 94 } 95 96 #endif // BT_GENERIC_6DOF_SPRING_CONSTRAINT_H 97
Note: See TracChangeset
for help on using the changeset viewer.