Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 28, 2011, 7:15:14 AM (14 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/Dynamics/btRigidBody.h

    r5781 r8351  
    2929extern btScalar gDeactivationTime;
    3030extern bool gDisableDeactivation;
     31
     32#ifdef BT_USE_DOUBLE_PRECISION
     33#define btRigidBodyData btRigidBodyDoubleData
     34#define btRigidBodyDataName     "btRigidBodyDoubleData"
     35#else
     36#define btRigidBodyData btRigidBodyFloatData
     37#define btRigidBodyDataName     "btRigidBodyFloatData"
     38#endif //BT_USE_DOUBLE_PRECISION
     39
     40
     41enum    btRigidBodyFlags
     42{
     43        BT_DISABLE_WORLD_GRAVITY = 1
     44};
    3145
    3246
     
    4660        btVector3               m_angularVelocity;
    4761        btScalar                m_inverseMass;
    48         btScalar                m_angularFactor;
     62        btVector3               m_linearFactor;
    4963
    5064        btVector3               m_gravity;     
     
    7286        //keep track of typed constraints referencing this rigid body
    7387        btAlignedObjectArray<btTypedConstraint*> m_constraintRefs;
     88
     89        int                             m_rigidbodyFlags;
     90       
     91        int                             m_debugBodyId;
     92
     93
     94protected:
     95
     96        ATTRIBUTE_ALIGNED64(btVector3           m_deltaLinearVelocity);
     97        btVector3               m_deltaAngularVelocity;
     98        btVector3               m_angularFactor;
     99        btVector3               m_invMass;
     100        btVector3               m_pushVelocity;
     101        btVector3               m_turnVelocity;
     102
    74103
    75104public:
     
    111140                btScalar                        m_additionalAngularDampingFactor;
    112141
    113                
    114142                btRigidBodyConstructionInfo(    btScalar mass, btMotionState* motionState, btCollisionShape* collisionShape, const btVector3& localInertia=btVector3(0,0,0)):
    115143                m_mass(mass),
     
    161189        static const btRigidBody*       upcast(const btCollisionObject* colObj)
    162190        {
    163                 if (colObj->getInternalType()==btCollisionObject::CO_RIGID_BODY)
     191                if (colObj->getInternalType()&btCollisionObject::CO_RIGID_BODY)
    164192                        return (const btRigidBody*)colObj;
    165193                return 0;
     
    167195        static btRigidBody*     upcast(btCollisionObject* colObj)
    168196        {
    169                 if (colObj->getInternalType()==btCollisionObject::CO_RIGID_BODY)
     197                if (colObj->getInternalType()&btCollisionObject::CO_RIGID_BODY)
    170198                        return (btRigidBody*)colObj;
    171199                return 0;
     
    220248        void                    setMassProps(btScalar mass, const btVector3& inertia);
    221249       
     250        const btVector3& getLinearFactor() const
     251        {
     252                return m_linearFactor;
     253        }
     254        void setLinearFactor(const btVector3& linearFactor)
     255        {
     256                m_linearFactor = linearFactor;
     257                m_invMass = m_linearFactor*m_inverseMass;
     258        }
    222259        btScalar                getInvMass() const { return m_inverseMass; }
    223260        const btMatrix3x3& getInvInertiaTensorWorld() const {
     
    231268        void                    applyCentralForce(const btVector3& force)
    232269        {
    233                 m_totalForce += force;
     270                m_totalForce += force*m_linearFactor;
    234271        }
    235272
     
    262299        void    applyTorque(const btVector3& torque)
    263300        {
    264                 m_totalTorque += torque;
     301                m_totalTorque += torque*m_angularFactor;
    265302        }
    266303       
     
    268305        {
    269306                applyCentralForce(force);
    270                 applyTorque(rel_pos.cross(force)*m_angularFactor);
     307                applyTorque(rel_pos.cross(force*m_linearFactor));
    271308        }
    272309       
    273310        void applyCentralImpulse(const btVector3& impulse)
    274311        {
    275                 m_linearVelocity += impulse * m_inverseMass;
     312                m_linearVelocity += impulse *m_linearFactor * m_inverseMass;
    276313        }
    277314       
    278315        void applyTorqueImpulse(const btVector3& torque)
    279316        {
    280                         m_angularVelocity += m_invInertiaTensorWorld * torque;
     317                        m_angularVelocity += m_invInertiaTensorWorld * torque * m_angularFactor;
    281318        }
    282319       
     
    288325                        if (m_angularFactor)
    289326                        {
    290                                 applyTorqueImpulse(rel_pos.cross(impulse)*m_angularFactor);
     327                                applyTorqueImpulse(rel_pos.cross(impulse*m_linearFactor));
    291328                        }
    292329                }
    293330        }
    294331
    295         //Optimization for the iterative solver: avoid calculating constant terms involving inertia, normal, relative position
    296         SIMD_FORCE_INLINE void internalApplyImpulse(const btVector3& linearComponent, const btVector3& angularComponent,btScalar impulseMagnitude)
    297         {
    298                 if (m_inverseMass != btScalar(0.))
    299                 {
    300                         m_linearVelocity += linearComponent*impulseMagnitude;
    301                         if (m_angularFactor)
    302                         {
    303                                 m_angularVelocity += angularComponent*impulseMagnitude*m_angularFactor;
    304                         }
    305                 }
    306         }
    307        
    308332        void clearForces()
    309333        {
     
    451475        int     m_frictionSolverType;
    452476
     477        void    setAngularFactor(const btVector3& angFac)
     478        {
     479                m_angularFactor = angFac;
     480        }
     481
    453482        void    setAngularFactor(btScalar angFac)
    454483        {
    455                 m_angularFactor = angFac;
    456         }
    457         btScalar        getAngularFactor() const
     484                m_angularFactor.setValue(angFac,angFac,angFac);
     485        }
     486        const btVector3&        getAngularFactor() const
    458487        {
    459488                return m_angularFactor;
     
    481510        }
    482511
    483         int     m_debugBodyId;
     512        void    setFlags(int flags)
     513        {
     514                m_rigidbodyFlags = flags;
     515        }
     516
     517        int getFlags() const
     518        {
     519                return m_rigidbodyFlags;
     520        }
     521
     522        const btVector3& getDeltaLinearVelocity() const
     523        {
     524                return m_deltaLinearVelocity;
     525        }
     526
     527        const btVector3& getDeltaAngularVelocity() const
     528        {
     529                return m_deltaAngularVelocity;
     530        }
     531
     532        const btVector3& getPushVelocity() const
     533        {
     534                return m_pushVelocity;
     535        }
     536
     537        const btVector3& getTurnVelocity() const
     538        {
     539                return m_turnVelocity;
     540        }
     541
     542
     543        ////////////////////////////////////////////////
     544        ///some internal methods, don't use them
     545               
     546        btVector3& internalGetDeltaLinearVelocity()
     547        {
     548                return m_deltaLinearVelocity;
     549        }
     550
     551        btVector3& internalGetDeltaAngularVelocity()
     552        {
     553                return m_deltaAngularVelocity;
     554        }
     555
     556        const btVector3& internalGetAngularFactor() const
     557        {
     558                return m_angularFactor;
     559        }
     560
     561        const btVector3& internalGetInvMass() const
     562        {
     563                return m_invMass;
     564        }
     565       
     566        btVector3& internalGetPushVelocity()
     567        {
     568                return m_pushVelocity;
     569        }
     570
     571        btVector3& internalGetTurnVelocity()
     572        {
     573                return m_turnVelocity;
     574        }
     575
     576        SIMD_FORCE_INLINE void  internalGetVelocityInLocalPointObsolete(const btVector3& rel_pos, btVector3& velocity ) const
     577        {
     578                velocity = getLinearVelocity()+m_deltaLinearVelocity + (getAngularVelocity()+m_deltaAngularVelocity).cross(rel_pos);
     579        }
     580
     581        SIMD_FORCE_INLINE void  internalGetAngularVelocity(btVector3& angVel) const
     582        {
     583                angVel = getAngularVelocity()+m_deltaAngularVelocity;
     584        }
     585
     586
     587        //Optimization for the iterative solver: avoid calculating constant terms involving inertia, normal, relative position
     588        SIMD_FORCE_INLINE void internalApplyImpulse(const btVector3& linearComponent, const btVector3& angularComponent,const btScalar impulseMagnitude)
     589        {
     590                if (m_inverseMass)
     591                {
     592                        m_deltaLinearVelocity += linearComponent*impulseMagnitude;
     593                        m_deltaAngularVelocity += angularComponent*(impulseMagnitude*m_angularFactor);
     594                }
     595        }
     596
     597        SIMD_FORCE_INLINE void internalApplyPushImpulse(const btVector3& linearComponent, const btVector3& angularComponent,btScalar impulseMagnitude)
     598        {
     599                if (m_inverseMass)
     600                {
     601                        m_pushVelocity += linearComponent*impulseMagnitude;
     602                        m_turnVelocity += angularComponent*(impulseMagnitude*m_angularFactor);
     603                }
     604        }
     605       
     606        void    internalWritebackVelocity()
     607        {
     608                if (m_inverseMass)
     609                {
     610                        setLinearVelocity(getLinearVelocity()+ m_deltaLinearVelocity);
     611                        setAngularVelocity(getAngularVelocity()+m_deltaAngularVelocity);
     612                        //m_deltaLinearVelocity.setZero();
     613                        //m_deltaAngularVelocity .setZero();
     614                        //m_originalBody->setCompanionId(-1);
     615                }
     616        }
     617
     618
     619        void    internalWritebackVelocity(btScalar timeStep);
     620       
     621
     622        ///////////////////////////////////////////////
     623
     624        virtual int     calculateSerializeBufferSize()  const;
     625
     626        ///fills the dataBuffer and returns the struct name (and 0 on failure)
     627        virtual const char*     serialize(void* dataBuffer,  class btSerializer* serializer) const;
     628
     629        virtual void serializeSingleObject(class btSerializer* serializer) const;
     630
    484631};
    485632
     633//@todo add m_optionalMotionState and m_constraintRefs to btRigidBodyData
     634///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
     635struct  btRigidBodyFloatData
     636{
     637        btCollisionObjectFloatData      m_collisionObjectData;
     638        btMatrix3x3FloatData            m_invInertiaTensorWorld;
     639        btVector3FloatData              m_linearVelocity;
     640        btVector3FloatData              m_angularVelocity;
     641        btVector3FloatData              m_angularFactor;
     642        btVector3FloatData              m_linearFactor;
     643        btVector3FloatData              m_gravity;     
     644        btVector3FloatData              m_gravity_acceleration;
     645        btVector3FloatData              m_invInertiaLocal;
     646        btVector3FloatData              m_totalForce;
     647        btVector3FloatData              m_totalTorque;
     648        float                                   m_inverseMass;
     649        float                                   m_linearDamping;
     650        float                                   m_angularDamping;
     651        float                                   m_additionalDampingFactor;
     652        float                                   m_additionalLinearDampingThresholdSqr;
     653        float                                   m_additionalAngularDampingThresholdSqr;
     654        float                                   m_additionalAngularDampingFactor;
     655        float                                   m_linearSleepingThreshold;
     656        float                                   m_angularSleepingThreshold;
     657        int                                             m_additionalDamping;
     658};
     659
     660///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
     661struct  btRigidBodyDoubleData
     662{
     663        btCollisionObjectDoubleData     m_collisionObjectData;
     664        btMatrix3x3DoubleData           m_invInertiaTensorWorld;
     665        btVector3DoubleData             m_linearVelocity;
     666        btVector3DoubleData             m_angularVelocity;
     667        btVector3DoubleData             m_angularFactor;
     668        btVector3DoubleData             m_linearFactor;
     669        btVector3DoubleData             m_gravity;     
     670        btVector3DoubleData             m_gravity_acceleration;
     671        btVector3DoubleData             m_invInertiaLocal;
     672        btVector3DoubleData             m_totalForce;
     673        btVector3DoubleData             m_totalTorque;
     674        double                                  m_inverseMass;
     675        double                                  m_linearDamping;
     676        double                                  m_angularDamping;
     677        double                                  m_additionalDampingFactor;
     678        double                                  m_additionalLinearDampingThresholdSqr;
     679        double                                  m_additionalAngularDampingThresholdSqr;
     680        double                                  m_additionalAngularDampingFactor;
     681        double                                  m_linearSleepingThreshold;
     682        double                                  m_angularSleepingThreshold;
     683        int                                             m_additionalDamping;
     684        char    m_padding[4];
     685};
     686
    486687
    487688
Note: See TracChangeset for help on using the changeset viewer.