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/btConeTwistConstraint.h

    r5781 r8351  
    1818
    1919
     20/*
     21Overview:
     22
     23btConeTwistConstraint can be used to simulate ragdoll joints (upper arm, leg etc).
     24It is a fixed translation, 3 degree-of-freedom (DOF) rotational "joint".
     25It divides the 3 rotational DOFs into swing (movement within a cone) and twist.
     26Swing is divided into swing1 and swing2 which can have different limits, giving an elliptical shape.
     27(Note: the cone's base isn't flat, so this ellipse is "embedded" on the surface of a sphere.)
     28
     29In the contraint's frame of reference:
     30twist is along the x-axis,
     31and swing 1 and 2 are along the z and y axes respectively.
     32*/
     33
     34
     35
    2036#ifndef CONETWISTCONSTRAINT_H
    2137#define CONETWISTCONSTRAINT_H
     
    2743class btRigidBody;
    2844
     45enum btConeTwistFlags
     46{
     47        BT_CONETWIST_FLAGS_LIN_CFM = 1,
     48        BT_CONETWIST_FLAGS_LIN_ERP = 2,
     49        BT_CONETWIST_FLAGS_ANG_CFM = 4
     50};
    2951
    3052///btConeTwistConstraint can be used to simulate ragdoll joints (upper arm, leg etc)
     
    84106        btVector3        m_accMotorImpulse;
    85107       
     108        // parameters
     109        int                     m_flags;
     110        btScalar        m_linCFM;
     111        btScalar        m_linERP;
     112        btScalar        m_angCFM;
     113       
     114protected:
     115
     116        void init();
     117
     118        void computeConeLimitInfo(const btQuaternion& qCone, // in
     119                btScalar& swingAngle, btVector3& vSwingAxis, btScalar& swingLimit); // all outs
     120
     121        void computeTwistLimitInfo(const btQuaternion& qTwist, // in
     122                btScalar& twistAngle, btVector3& vTwistAxis); // all outs
     123
     124        void adjustSwingAxisToUseEllipseNormal(btVector3& vSwingAxis) const;
     125
     126
    86127public:
    87128
     
    90131        btConeTwistConstraint(btRigidBody& rbA,const btTransform& rbAFrame);
    91132
    92         btConeTwistConstraint();
    93 
    94133        virtual void    buildJacobian();
    95134
    96135        virtual void getInfo1 (btConstraintInfo1* info);
     136
     137        void    getInfo1NonVirtual(btConstraintInfo1* info);
    97138       
    98139        virtual void getInfo2 (btConstraintInfo2* info);
    99140       
    100 
    101         virtual void    solveConstraintObsolete(btSolverBody& bodyA,btSolverBody& bodyB,btScalar        timeStep);
     141        void    getInfo2NonVirtual(btConstraintInfo2* info,const btTransform& transA,const btTransform& transB,const btMatrix3x3& invInertiaWorldA,const btMatrix3x3& invInertiaWorldB);
     142
     143        virtual void    solveConstraintObsolete(btRigidBody& bodyA,btRigidBody& bodyB,btScalar  timeStep);
    102144
    103145        void    updateRHS(btScalar      timeStep);
     
    142184        }
    143185
    144         void    setLimit(btScalar _swingSpan1,btScalar _swingSpan2,btScalar _twistSpan,  btScalar _softness = 1.f, btScalar _biasFactor = 0.3f, btScalar _relaxationFactor = 1.0f)
     186        // setLimit(), a few notes:
     187        // _softness:
     188        //              0->1, recommend ~0.8->1.
     189        //              describes % of limits where movement is free.
     190        //              beyond this softness %, the limit is gradually enforced until the "hard" (1.0) limit is reached.
     191        // _biasFactor:
     192        //              0->1?, recommend 0.3 +/-0.3 or so.
     193        //              strength with which constraint resists zeroth order (angular, not angular velocity) limit violation.
     194        // __relaxationFactor:
     195        //              0->1, recommend to stay near 1.
     196        //              the lower the value, the less the constraint will fight velocities which violate the angular limits.
     197        void    setLimit(btScalar _swingSpan1,btScalar _swingSpan2,btScalar _twistSpan, btScalar _softness = 1.f, btScalar _biasFactor = 0.3f, btScalar _relaxationFactor = 1.0f)
    145198        {
    146199                m_swingSpan1 = _swingSpan1;
     
    172225
    173226        void calcAngleInfo();
    174         void calcAngleInfo2();
     227        void calcAngleInfo2(const btTransform& transA, const btTransform& transB,const btMatrix3x3& invInertiaWorldA,const btMatrix3x3& invInertiaWorldB);
    175228
    176229        inline btScalar getSwingSpan1()
     
    213266        btVector3 GetPointForAngle(btScalar fAngleInRadians, btScalar fLength) const;
    214267
    215 
    216 
    217 protected:
    218         void init();
    219 
    220         void computeConeLimitInfo(const btQuaternion& qCone, // in
    221                 btScalar& swingAngle, btVector3& vSwingAxis, btScalar& swingLimit); // all outs
    222 
    223         void computeTwistLimitInfo(const btQuaternion& qTwist, // in
    224                 btScalar& twistAngle, btVector3& vTwistAxis); // all outs
    225 
    226         void adjustSwingAxisToUseEllipseNormal(btVector3& vSwingAxis) const;
     268        ///override the default global value of a parameter (such as ERP or CFM), optionally provide the axis (0..5).
     269        ///If no axis is provided, it uses the default axis for this constraint.
     270        virtual void setParam(int num, btScalar value, int axis = -1);
     271        ///return the local value of parameter
     272        virtual btScalar getParam(int num, int axis = -1) const;
     273
     274        virtual int     calculateSerializeBufferSize() const;
     275
     276        ///fills the dataBuffer and returns the struct name (and 0 on failure)
     277        virtual const char*     serialize(void* dataBuffer, btSerializer* serializer) const;
     278
    227279};
    228280
     281///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
     282struct  btConeTwistConstraintData
     283{
     284        btTypedConstraintData   m_typeConstraintData;
     285        btTransformFloatData m_rbAFrame;
     286        btTransformFloatData m_rbBFrame;
     287
     288        //limits
     289        float   m_swingSpan1;
     290        float   m_swingSpan2;
     291        float   m_twistSpan;
     292        float   m_limitSoftness;
     293        float   m_biasFactor;
     294        float   m_relaxationFactor;
     295
     296        float   m_damping;
     297               
     298        char m_pad[4];
     299
     300};
     301       
     302
     303
     304SIMD_FORCE_INLINE int   btConeTwistConstraint::calculateSerializeBufferSize() const
     305{
     306        return sizeof(btConeTwistConstraintData);
     307
     308}
     309
     310
     311        ///fills the dataBuffer and returns the struct name (and 0 on failure)
     312SIMD_FORCE_INLINE const char*   btConeTwistConstraint::serialize(void* dataBuffer, btSerializer* serializer) const
     313{
     314        btConeTwistConstraintData* cone = (btConeTwistConstraintData*) dataBuffer;
     315        btTypedConstraint::serialize(&cone->m_typeConstraintData,serializer);
     316
     317        m_rbAFrame.serializeFloat(cone->m_rbAFrame);
     318        m_rbBFrame.serializeFloat(cone->m_rbBFrame);
     319       
     320        cone->m_swingSpan1 = float(m_swingSpan1);
     321        cone->m_swingSpan2 = float(m_swingSpan2);
     322        cone->m_twistSpan = float(m_twistSpan);
     323        cone->m_limitSoftness = float(m_limitSoftness);
     324        cone->m_biasFactor = float(m_biasFactor);
     325        cone->m_relaxationFactor = float(m_relaxationFactor);
     326        cone->m_damping = float(m_damping);
     327
     328        return "btConeTwistConstraintData";
     329}
     330
     331
    229332#endif //CONETWISTCONSTRAINT_H
Note: See TracChangeset for help on using the changeset viewer.