Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 21, 2011, 6:58:23 PM (13 years ago)
Author:
rgrieder
Message:

Merged revisions 7978 - 8096 from kicklib to kicklib2.

Location:
code/branches/kicklib2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/kicklib2

  • code/branches/kicklib2/src/external/bullet/BulletDynamics/ConstraintSolver/btPoint2PointConstraint.h

    r5781 r8284  
    2323class btRigidBody;
    2424
     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
    2534struct  btConstraintSetting
    2635{
     
    3645};
    3746
     47enum btPoint2PointFlags
     48{
     49        BT_P2P_FLAGS_ERP = 1,
     50        BT_P2P_FLAGS_CFM = 2
     51};
     52
    3853/// point to point constraint between two rigidbodies each with a pivotpoint that descibes the 'ballsocket' location in local space
    39 class btPoint2PointConstraint : public btTypedConstraint
     54ATTRIBUTE_ALIGNED16(class) btPoint2PointConstraint : public btTypedConstraint
    4055{
    4156#ifdef IN_PARALLELL_SOLVER
     
    4762        btVector3       m_pivotInB;
    4863       
    49        
     64        int                     m_flags;
     65        btScalar        m_erp;
     66        btScalar        m_cfm;
    5067       
    5168public:
     
    6077        btPoint2PointConstraint(btRigidBody& rbA,const btVector3& pivotInA);
    6178
    62         btPoint2PointConstraint();
    6379
    6480        virtual void    buildJacobian();
     
    6682        virtual void getInfo1 (btConstraintInfo1* info);
    6783
     84        void getInfo1NonVirtual (btConstraintInfo1* info);
     85
    6886        virtual void getInfo2 (btConstraintInfo2* info);
    6987
    70 
    71         virtual void    solveConstraintObsolete(btSolverBody& bodyA,btSolverBody& bodyB,btScalar        timeStep);
     88        void getInfo2NonVirtual (btConstraintInfo2* info, const btTransform& body0_trans, const btTransform& body1_trans);
    7289
    7390        void    updateRHS(btScalar      timeStep);
     
    93110        }
    94111
     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
    95123
    96124};
    97125
     126///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
     127struct  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
     135struct  btPoint2PointConstraintDoubleData
     136{
     137        btTypedConstraintData   m_typeConstraintData;
     138        btVector3DoubleData     m_pivotInA;
     139        btVector3DoubleData     m_pivotInB;
     140};
     141
     142
     143SIMD_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)
     150SIMD_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
    98161#endif //POINT2POINTCONSTRAINT_H
Note: See TracChangeset for help on using the changeset viewer.