Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 28, 2011, 7:15:14 AM (13 years ago)
Author:
rgrieder
Message:

Merged kicklib2 branch back to trunk (includes former branches ois_update, mac_osx and kicklib).

Notes for updating

Linux:
You don't need an extra package for CEGUILua and Tolua, it's already shipped with CEGUI.
However you do need to make sure that the OgreRenderer is installed too with CEGUI 0.7 (may be a separate package).
Also, Orxonox now recognises if you install the CgProgramManager (a separate package available on newer Ubuntu on Debian systems).

Windows:
Download the new dependency packages versioned 6.0 and use these. If you have problems with that or if you don't like the in game console problem mentioned below, you can download the new 4.3 version of the packages (only available for Visual Studio 2005/2008).

Key new features:

  • *Support for Mac OS X*
  • Visual Studio 2010 support
  • Bullet library update to 2.77
  • OIS library update to 1.3
  • Support for CEGUI 0.7 —> Support for Arch Linux and even SuSE
  • Improved install target
  • Compiles now with GCC 4.6
  • Ogre Cg Shader plugin activated for Linux if available
  • And of course lots of bug fixes

There are also some regressions:

  • No support for CEGUI 0.5, Ogre 1.4 and boost 1.35 - 1.39 any more
  • In game console is not working in main menu for CEGUI 0.7
  • Tolua (just the C lib, not the application) and CEGUILua libraries are no longer in our repository. —> You will need to get these as well when compiling Orxonox
  • And of course lots of new bugs we don't yet know about
File:
1 edited

Legend:

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

    r5781 r8351  
    2525class btRigidBody;
    2626
     27#ifdef BT_USE_DOUBLE_PRECISION
     28#define btHingeConstraintData   btHingeConstraintDoubleData
     29#define btHingeConstraintDataName       "btHingeConstraintDoubleData"
     30#else
     31#define btHingeConstraintData   btHingeConstraintFloatData
     32#define btHingeConstraintDataName       "btHingeConstraintFloatData"
     33#endif //BT_USE_DOUBLE_PRECISION
     34
     35
     36enum btHingeFlags
     37{
     38        BT_HINGE_FLAGS_CFM_STOP = 1,
     39        BT_HINGE_FLAGS_ERP_STOP = 2,
     40        BT_HINGE_FLAGS_CFM_NORM = 4
     41};
     42
     43
    2744/// hinge constraint between two rigidbodies each with a pivotpoint that descibes the axis location in local space
    2845/// axis defines the orientation of the hinge axis
    29 class btHingeConstraint : public btTypedConstraint
     46ATTRIBUTE_ALIGNED16(class) btHingeConstraint : public btTypedConstraint
    3047{
    3148#ifdef IN_PARALLELL_SOLVER
     
    6178        bool            m_solveLimit;
    6279        bool            m_useSolveConstraintObsolete;
     80        bool            m_useOffsetForConstraintFrame;
    6381        bool            m_useReferenceFrameA;
    6482
     83        btScalar        m_accMotorImpulse;
     84
     85        int                     m_flags;
     86        btScalar        m_normalCFM;
     87        btScalar        m_stopCFM;
     88        btScalar        m_stopERP;
     89
    6590       
    6691public:
    6792
    68         btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB, btVector3& axisInA,btVector3& axisInB, bool useReferenceFrameA = false);
    69 
    70         btHingeConstraint(btRigidBody& rbA,const btVector3& pivotInA,btVector3& axisInA, bool useReferenceFrameA = false);
     93        btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const btVector3& pivotInA,const btVector3& pivotInB, const btVector3& axisInA,const btVector3& axisInB, bool useReferenceFrameA = false);
     94
     95        btHingeConstraint(btRigidBody& rbA,const btVector3& pivotInA,const btVector3& axisInA, bool useReferenceFrameA = false);
    7196       
    7297        btHingeConstraint(btRigidBody& rbA,btRigidBody& rbB, const btTransform& rbAFrame, const btTransform& rbBFrame, bool useReferenceFrameA = false);
     
    7499        btHingeConstraint(btRigidBody& rbA,const btTransform& rbAFrame, bool useReferenceFrameA = false);
    75100
    76         btHingeConstraint();
    77101
    78102        virtual void    buildJacobian();
     
    80104        virtual void getInfo1 (btConstraintInfo1* info);
    81105
     106        void getInfo1NonVirtual(btConstraintInfo1* info);
     107
    82108        virtual void getInfo2 (btConstraintInfo2* info);
    83        
    84         virtual void    solveConstraintObsolete(btSolverBody& bodyA,btSolverBody& bodyB,btScalar        timeStep);
     109
     110        void    getInfo2NonVirtual(btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btVector3& angVelA,const btVector3& angVelB);
     111
     112        void    getInfo2Internal(btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btVector3& angVelA,const btVector3& angVelB);
     113        void    getInfo2InternalUsingFrameOffset(btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btVector3& angVelA,const btVector3& angVelB);
     114               
    85115
    86116        void    updateRHS(btScalar      timeStep);
     
    117147        }
    118148
     149        // extra motor API, including ability to set a target rotation (as opposed to angular velocity)
     150        // note: setMotorTarget sets angular velocity under the hood, so you must call it every tick to
     151        //       maintain a given angular target.
     152        void enableMotor(bool enableMotor)      { m_enableAngularMotor = enableMotor; }
     153        void setMaxMotorImpulse(btScalar maxMotorImpulse) { m_maxMotorImpulse = maxMotorImpulse; }
     154        void setMotorTarget(const btQuaternion& qAinB, btScalar dt); // qAinB is rotation of body A wrt body B.
     155        void setMotorTarget(btScalar targetAngle, btScalar dt);
     156
     157
    119158        void    setLimit(btScalar low,btScalar high,btScalar _softness = 0.9f, btScalar _biasFactor = 0.3f, btScalar _relaxationFactor = 1.0f)
    120159        {
    121                 m_lowerLimit = low;
    122                 m_upperLimit = high;
     160                m_lowerLimit = btNormalizeAngle(low);
     161                m_upperLimit = btNormalizeAngle(high);
    123162
    124163                m_limitSoftness =  _softness;
     
    128167        }
    129168
     169        void    setAxis(btVector3& axisInA)
     170        {
     171                btVector3 rbAxisA1, rbAxisA2;
     172                btPlaneSpace1(axisInA, rbAxisA1, rbAxisA2);
     173                btVector3 pivotInA = m_rbAFrame.getOrigin();
     174//              m_rbAFrame.getOrigin() = pivotInA;
     175                m_rbAFrame.getBasis().setValue( rbAxisA1.getX(),rbAxisA2.getX(),axisInA.getX(),
     176                                                                                rbAxisA1.getY(),rbAxisA2.getY(),axisInA.getY(),
     177                                                                                rbAxisA1.getZ(),rbAxisA2.getZ(),axisInA.getZ() );
     178
     179                btVector3 axisInB = m_rbA.getCenterOfMassTransform().getBasis() * axisInA;
     180
     181                btQuaternion rotationArc = shortestArcQuat(axisInA,axisInB);
     182                btVector3 rbAxisB1 =  quatRotate(rotationArc,rbAxisA1);
     183                btVector3 rbAxisB2 = axisInB.cross(rbAxisB1);
     184
     185
     186                m_rbBFrame.getOrigin() = m_rbA.getCenterOfMassTransform()(pivotInA);
     187                m_rbBFrame.getBasis().setValue( rbAxisB1.getX(),rbAxisB2.getX(),axisInB.getX(),
     188                                                                                rbAxisB1.getY(),rbAxisB2.getY(),axisInB.getY(),
     189                                                                                rbAxisB1.getZ(),rbAxisB2.getZ(),axisInB.getZ() );
     190        }
     191
    130192        btScalar        getLowerLimit() const
    131193        {
     
    141203        btScalar getHingeAngle();
    142204
    143         void testLimit();
    144 
    145 
    146         const btTransform& getAFrame() { return m_rbAFrame; }; 
    147         const btTransform& getBFrame() { return m_rbBFrame; };
     205        btScalar getHingeAngle(const btTransform& transA,const btTransform& transB);
     206
     207        void testLimit(const btTransform& transA,const btTransform& transB);
     208
     209
     210        const btTransform& getAFrame() const { return m_rbAFrame; };   
     211        const btTransform& getBFrame() const { return m_rbBFrame; };
     212
     213        btTransform& getAFrame() { return m_rbAFrame; };       
     214        btTransform& getBFrame() { return m_rbBFrame; };
    148215
    149216        inline int getSolveLimit()
     
    173240                return m_maxMotorImpulse;
    174241        }
     242        // access for UseFrameOffset
     243        bool getUseFrameOffset() { return m_useOffsetForConstraintFrame; }
     244        void setUseFrameOffset(bool frameOffsetOnOff) { m_useOffsetForConstraintFrame = frameOffsetOnOff; }
     245
     246
     247        ///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5).
     248        ///If no axis is provided, it uses the default axis for this constraint.
     249        virtual void    setParam(int num, btScalar value, int axis = -1);
     250        ///return the local value of parameter
     251        virtual btScalar getParam(int num, int axis = -1) const;
     252
     253        virtual int     calculateSerializeBufferSize() const;
     254
     255        ///fills the dataBuffer and returns the struct name (and 0 on failure)
     256        virtual const char*     serialize(void* dataBuffer, btSerializer* serializer) const;
     257
    175258
    176259};
    177260
     261///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
     262struct  btHingeConstraintDoubleData
     263{
     264        btTypedConstraintData   m_typeConstraintData;
     265        btTransformDoubleData m_rbAFrame; // constraint axii. Assumes z is hinge axis.
     266        btTransformDoubleData m_rbBFrame;
     267        int                     m_useReferenceFrameA;
     268        int                     m_angularOnly;
     269        int                     m_enableAngularMotor;
     270        float   m_motorTargetVelocity;
     271        float   m_maxMotorImpulse;
     272
     273        float   m_lowerLimit;
     274        float   m_upperLimit;
     275        float   m_limitSoftness;
     276        float   m_biasFactor;
     277        float   m_relaxationFactor;
     278
     279};
     280///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
     281struct  btHingeConstraintFloatData
     282{
     283        btTypedConstraintData   m_typeConstraintData;
     284        btTransformFloatData m_rbAFrame; // constraint axii. Assumes z is hinge axis.
     285        btTransformFloatData m_rbBFrame;
     286        int                     m_useReferenceFrameA;
     287        int                     m_angularOnly;
     288       
     289        int                     m_enableAngularMotor;
     290        float   m_motorTargetVelocity;
     291        float   m_maxMotorImpulse;
     292
     293        float   m_lowerLimit;
     294        float   m_upperLimit;
     295        float   m_limitSoftness;
     296        float   m_biasFactor;
     297        float   m_relaxationFactor;
     298
     299};
     300
     301
     302
     303SIMD_FORCE_INLINE       int     btHingeConstraint::calculateSerializeBufferSize() const
     304{
     305        return sizeof(btHingeConstraintData);
     306}
     307
     308        ///fills the dataBuffer and returns the struct name (and 0 on failure)
     309SIMD_FORCE_INLINE       const char*     btHingeConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
     310{
     311        btHingeConstraintData* hingeData = (btHingeConstraintData*)dataBuffer;
     312        btTypedConstraint::serialize(&hingeData->m_typeConstraintData,serializer);
     313
     314        m_rbAFrame.serialize(hingeData->m_rbAFrame);
     315        m_rbBFrame.serialize(hingeData->m_rbBFrame);
     316
     317        hingeData->m_angularOnly = m_angularOnly;
     318        hingeData->m_enableAngularMotor = m_enableAngularMotor;
     319        hingeData->m_maxMotorImpulse = float(m_maxMotorImpulse);
     320        hingeData->m_motorTargetVelocity = float(m_motorTargetVelocity);
     321        hingeData->m_useReferenceFrameA = m_useReferenceFrameA;
     322       
     323        hingeData->m_lowerLimit = float(m_lowerLimit);
     324        hingeData->m_upperLimit = float(m_upperLimit);
     325        hingeData->m_limitSoftness = float(m_limitSoftness);
     326        hingeData->m_biasFactor = float(m_biasFactor);
     327        hingeData->m_relaxationFactor = float(m_relaxationFactor);
     328
     329        return btHingeConstraintDataName;
     330}
     331
    178332#endif //HINGECONSTRAINT_H
Note: See TracChangeset for help on using the changeset viewer.