Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 21, 2011, 6:58:23 PM (14 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/BulletCollision/CollisionDispatch/btCollisionObject.h

    r5781 r8284  
    2828struct  btBroadphaseProxy;
    2929class   btCollisionShape;
     30struct btCollisionShapeData;
    3031#include "LinearMath/btMotionState.h"
    3132#include "LinearMath/btAlignedAllocator.h"
    3233#include "LinearMath/btAlignedObjectArray.h"
    3334
    34 
    3535typedef btAlignedObjectArray<class btCollisionObject*> btCollisionObjectArray;
     36
     37#ifdef BT_USE_DOUBLE_PRECISION
     38#define btCollisionObjectData btCollisionObjectDoubleData
     39#define btCollisionObjectDataName "btCollisionObjectDoubleData"
     40#else
     41#define btCollisionObjectData btCollisionObjectFloatData
     42#define btCollisionObjectDataName "btCollisionObjectFloatData"
     43#endif
    3644
    3745
     
    5462        btVector3       m_interpolationAngularVelocity;
    5563       
    56         btVector3               m_anisotropicFriction;
    57         bool                            m_hasAnisotropicFriction;
    58         btScalar                m_contactProcessingThreshold;   
     64        btVector3       m_anisotropicFriction;
     65        int                     m_hasAnisotropicFriction;
     66        btScalar        m_contactProcessingThreshold;   
    5967
    6068        btBroadphaseProxy*              m_broadphaseHandle;
    6169        btCollisionShape*               m_collisionShape;
     70        ///m_extensionPointer is used by some internal low-level Bullet extensions.
     71        void*                                   m_extensionPointer;
    6272       
    6373        ///m_rootCollisionShape is temporarily used to store the original collision shape
     
    7787        btScalar                m_restitution;
    7888
    79         ///users can point to their objects, m_userPointer is not used by Bullet, see setUserPointer/getUserPointer
    80         void*                   m_userObjectPointer;
    81 
    8289        ///m_internalType is reserved to distinguish Bullet's btCollisionObject, btRigidBody, btSoftBody, btGhostObject etc.
    8390        ///do not assign your own m_internalType unless you write a new dynamics object class.
    8491        int                             m_internalType;
    8592
     93        ///users can point to their objects, m_userPointer is not used by Bullet, see setUserPointer/getUserPointer
     94        void*                   m_userObjectPointer;
     95
    8696        ///time of impact calculation
    8797        btScalar                m_hitFraction;
     
    94104       
    95105        /// If some object should have elaborate collision filtering by sub-classes
    96         bool                    m_checkCollideWith;
    97 
    98         char    m_pad[7];
     106        int                     m_checkCollideWith;
    99107
    100108        virtual bool    checkCollideWithOverride(btCollisionObject* /* co */)
     
    113121                CF_NO_CONTACT_RESPONSE = 4,
    114122                CF_CUSTOM_MATERIAL_CALLBACK = 8,//this allows per-triangle material (friction/restitution)
    115                 CF_CHARACTER_OBJECT = 16
     123                CF_CHARACTER_OBJECT = 16,
     124                CF_DISABLE_VISUALIZE_OBJECT = 32, //disable debug drawing
     125                CF_DISABLE_SPU_COLLISION_PROCESSING = 64//disable parallel/SPU processing
    116126        };
    117127
     
    119129        {
    120130                CO_COLLISION_OBJECT =1,
    121                 CO_RIGID_BODY,
     131                CO_RIGID_BODY=2,
    122132                ///CO_GHOST_OBJECT keeps track of all objects overlapping its AABB and that pass its collision filter
    123133                ///It is useful for collision sensors, explosion objects, character controller etc.
    124                 CO_GHOST_OBJECT,
    125                 CO_SOFT_BODY,
    126                 CO_HF_FLUID
     134                CO_GHOST_OBJECT=4,
     135                CO_SOFT_BODY=8,
     136                CO_HF_FLUID=16,
     137                CO_USER_TYPE=32
    127138        };
    128139
     
    144155        bool    hasAnisotropicFriction() const
    145156        {
    146                 return m_hasAnisotropicFriction;
     157                return m_hasAnisotropicFriction!=0;
    147158        }
    148159
     
    214225        }
    215226
     227        ///Avoid using this internal API call, the extension pointer is used by some Bullet extensions.
     228        ///If you need to store your own user pointer, use 'setUserPointer/getUserPointer' instead.
     229        void*           internalGetExtensionPointer() const
     230        {
     231                return m_extensionPointer;
     232        }
     233        ///Avoid using this internal API call, the extension pointer is used by some Bullet extensions
     234        ///If you need to store your own user pointer, use 'setUserPointer/getUserPointer' instead.
     235        void    internalSetExtensionPointer(void* pointer)
     236        {
     237                m_extensionPointer = pointer;
     238        }
     239
    216240        SIMD_FORCE_INLINE       int     getActivationState() const { return m_activationState1;}
    217241       
     
    394418        void    setCcdMotionThreshold(btScalar ccdMotionThreshold)
    395419        {
    396                 m_ccdMotionThreshold = ccdMotionThreshold*ccdMotionThreshold;
     420                m_ccdMotionThreshold = ccdMotionThreshold;
    397421        }
    398422
     
    417441                return true;
    418442        }
     443
     444        virtual int     calculateSerializeBufferSize()  const;
     445
     446        ///fills the dataBuffer and returns the struct name (and 0 on failure)
     447        virtual const char*     serialize(void* dataBuffer, class btSerializer* serializer) const;
     448
     449        virtual void serializeSingleObject(class btSerializer* serializer) const;
     450
    419451};
    420452
     453///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
     454struct  btCollisionObjectDoubleData
     455{
     456        void                                    *m_broadphaseHandle;
     457        void                                    *m_collisionShape;
     458        btCollisionShapeData    *m_rootCollisionShape;
     459        char                                    *m_name;
     460
     461        btTransformDoubleData   m_worldTransform;
     462        btTransformDoubleData   m_interpolationWorldTransform;
     463        btVector3DoubleData             m_interpolationLinearVelocity;
     464        btVector3DoubleData             m_interpolationAngularVelocity;
     465        btVector3DoubleData             m_anisotropicFriction;
     466        double                                  m_contactProcessingThreshold;   
     467        double                                  m_deactivationTime;
     468        double                                  m_friction;
     469        double                                  m_restitution;
     470        double                                  m_hitFraction;
     471        double                                  m_ccdSweptSphereRadius;
     472        double                                  m_ccdMotionThreshold;
     473
     474        int                                             m_hasAnisotropicFriction;
     475        int                                             m_collisionFlags;
     476        int                                             m_islandTag1;
     477        int                                             m_companionId;
     478        int                                             m_activationState1;
     479        int                                             m_internalType;
     480        int                                             m_checkCollideWith;
     481
     482        char    m_padding[4];
     483};
     484
     485///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
     486struct  btCollisionObjectFloatData
     487{
     488        void                                    *m_broadphaseHandle;
     489        void                                    *m_collisionShape;
     490        btCollisionShapeData    *m_rootCollisionShape;
     491        char                                    *m_name;
     492
     493        btTransformFloatData    m_worldTransform;
     494        btTransformFloatData    m_interpolationWorldTransform;
     495        btVector3FloatData              m_interpolationLinearVelocity;
     496        btVector3FloatData              m_interpolationAngularVelocity;
     497        btVector3FloatData              m_anisotropicFriction;
     498        float                                   m_contactProcessingThreshold;   
     499        float                                   m_deactivationTime;
     500        float                                   m_friction;
     501        float                                   m_restitution;
     502        float                                   m_hitFraction;
     503        float                                   m_ccdSweptSphereRadius;
     504        float                                   m_ccdMotionThreshold;
     505
     506        int                                             m_hasAnisotropicFriction;
     507        int                                             m_collisionFlags;
     508        int                                             m_islandTag1;
     509        int                                             m_companionId;
     510        int                                             m_activationState1;
     511        int                                             m_internalType;
     512        int                                             m_checkCollideWith;
     513};
     514
     515
     516
     517SIMD_FORCE_INLINE       int     btCollisionObject::calculateSerializeBufferSize() const
     518{
     519        return sizeof(btCollisionObjectData);
     520}
     521
     522
     523
    421524#endif //COLLISION_OBJECT_H
Note: See TracChangeset for help on using the changeset viewer.