Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 31, 2009, 8:05:51 PM (15 years ago)
Author:
rgrieder
Message:

Update from Bullet 2.73 to 2.74.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/trunk/src/bullet/BulletDynamics/ConstraintSolver/btTypedConstraint.h

    r2662 r2882  
    1919class btRigidBody;
    2020#include "LinearMath/btScalar.h"
     21#include "btSolverConstraint.h"
     22struct  btSolverBody;
     23
     24
     25
    2126
    2227enum btTypedConstraintType
     
    2631        CONETWIST_CONSTRAINT_TYPE,
    2732        D6_CONSTRAINT_TYPE,
    28         VEHICLE_CONSTRAINT_TYPE,
    2933        SLIDER_CONSTRAINT_TYPE
    3034};
     
    4953        btRigidBody&    m_rbB;
    5054        btScalar        m_appliedImpulse;
     55        btScalar        m_dbgDrawSize;
    5156
    5257
     
    5661        virtual ~btTypedConstraint() {};
    5762        btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA);
     63        btTypedConstraint(btTypedConstraintType type, btRigidBody& rbA,btRigidBody& rbB);
    5864
    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
    6098
    6199        virtual void    buildJacobian() = 0;
    62100
    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;
    64105
     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       
    65112        const btRigidBody& getRigidBodyA() const
    66113        {
     
    95142                m_userConstraintId = uid;
    96143        }
    97        
     144
    98145        int getUserConstraintId() const
    99146        {
     
    115162                return m_constraintType;
    116163        }
    117 
     164       
     165        void setDbgDrawSize(btScalar dbgDrawSize)
     166        {
     167                m_dbgDrawSize = dbgDrawSize;
     168        }
     169        btScalar getDbgDrawSize()
     170        {
     171                return m_dbgDrawSize;
     172        }
     173       
    118174};
    119175
Note: See TracChangeset for help on using the changeset viewer.