bullet: Update to current svn, r2636
[blender.git] / extern / bullet2 / src / BulletDynamics / ConstraintSolver / btGeneric6DofSpringConstraint.h
index 16ff973e427e151bcf1c2f616e9612787f5627a2..6fabb30369b7ee472bb03419f704c94d7f8d5c25 100644 (file)
@@ -13,8 +13,8 @@ subject to the following restrictions:
 3. This notice may not be removed or altered from any source distribution.
 */
 
-#ifndef GENERIC_6DOF_SPRING_CONSTRAINT_H
-#define GENERIC_6DOF_SPRING_CONSTRAINT_H
+#ifndef BT_GENERIC_6DOF_SPRING_CONSTRAINT_H
+#define BT_GENERIC_6DOF_SPRING_CONSTRAINT_H
 
 
 #include "LinearMath/btVector3.h"
@@ -32,16 +32,21 @@ subject to the following restrictions:
 /// 4 : rotation Y (2nd Euler rotational around new position of Y axis, range [-PI/2+epsilon, PI/2-epsilon] )
 /// 5 : rotation Z (1st Euler rotational around Z axis, range [-PI+epsilon, PI-epsilon] )
 
-class btGeneric6DofSpringConstraint : public btGeneric6DofConstraint
+ATTRIBUTE_ALIGNED16(class) btGeneric6DofSpringConstraint : public btGeneric6DofConstraint
 {
 protected:
        bool            m_springEnabled[6];
        btScalar        m_equilibriumPoint[6];
        btScalar        m_springStiffness[6];
        btScalar        m_springDamping[6]; // between 0 and 1 (1 == no damping)
+       void init();
        void internalUpdateSprings(btConstraintInfo2* info);
 public: 
+       
+       BT_DECLARE_ALIGNED_ALLOCATOR();
+       
     btGeneric6DofSpringConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB ,bool useLinearReferenceFrameA);
+    btGeneric6DofSpringConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB);
        void enableSpring(int index, bool onOff);
        void setStiffness(int index, btScalar stiffness);
        void setDamping(int index, btScalar damping);
@@ -85,13 +90,13 @@ SIMD_FORCE_INLINE   const char*     btGeneric6DofSpringConstraint::serialize(void* dat
        int i;
        for (i=0;i<6;i++)
        {
-               dof->m_equilibriumPoint[i] = m_equilibriumPoint[i];
-               dof->m_springDamping[i] = m_springDamping[i];
+               dof->m_equilibriumPoint[i] = (float)m_equilibriumPoint[i];
+               dof->m_springDamping[i] = (float)m_springDamping[i];
                dof->m_springEnabled[i] = m_springEnabled[i]? 1 : 0;
-               dof->m_springStiffness[i] = m_springStiffness[i];
+               dof->m_springStiffness[i] = (float)m_springStiffness[i];
        }
-       return "btGeneric6DofConstraintData";
+       return "btGeneric6DofSpringConstraintData";
 }
 
-#endif // GENERIC_6DOF_SPRING_CONSTRAINT_H
+#endif // BT_GENERIC_6DOF_SPRING_CONSTRAINT_H