Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Feb 27, 2011, 7:43:24 AM (14 years ago)
Author:
rgrieder
Message:

Updated Bullet Physics Engine from v2.74 to v2.77

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/kicklib/src/external/bullet/BulletCollision/CollisionDispatch/btCollisionObject.cpp

    r5781 r7983  
    1616
    1717#include "btCollisionObject.h"
     18#include "LinearMath/btSerializer.h"
    1819
    1920btCollisionObject::btCollisionObject()
    2021        :       m_anisotropicFriction(1.f,1.f,1.f),
    2122        m_hasAnisotropicFriction(false),
    22         m_contactProcessingThreshold(1e30f),
     23        m_contactProcessingThreshold(BT_LARGE_FLOAT),
    2324                m_broadphaseHandle(0),
    2425                m_collisionShape(0),
     26                m_extensionPointer(0),
    2527                m_rootCollisionShape(0),
    2628                m_collisionFlags(btCollisionObject::CF_STATIC_OBJECT),
     
    3133                m_friction(btScalar(0.5)),
    3234                m_restitution(btScalar(0.)),
     35                m_internalType(CO_COLLISION_OBJECT),
    3336                m_userObjectPointer(0),
    34                 m_internalType(CO_COLLISION_OBJECT),
    3537                m_hitFraction(btScalar(1.)),
    3638                m_ccdSweptSphereRadius(btScalar(0.)),
     
    3840                m_checkCollideWith(false)
    3941{
    40        
     42        m_worldTransform.setIdentity();
    4143}
    4244
     
    6567}
    6668
     69const char* btCollisionObject::serialize(void* dataBuffer, btSerializer* serializer) const
     70{
     71
     72        btCollisionObjectData* dataOut = (btCollisionObjectData*)dataBuffer;
     73
     74        m_worldTransform.serialize(dataOut->m_worldTransform);
     75        m_interpolationWorldTransform.serialize(dataOut->m_interpolationWorldTransform);
     76        m_interpolationLinearVelocity.serialize(dataOut->m_interpolationLinearVelocity);
     77        m_interpolationAngularVelocity.serialize(dataOut->m_interpolationAngularVelocity);
     78        m_anisotropicFriction.serialize(dataOut->m_anisotropicFriction);
     79        dataOut->m_hasAnisotropicFriction = m_hasAnisotropicFriction;
     80        dataOut->m_contactProcessingThreshold = m_contactProcessingThreshold;
     81        dataOut->m_broadphaseHandle = 0;
     82        dataOut->m_collisionShape = serializer->getUniquePointer(m_collisionShape);
     83        dataOut->m_rootCollisionShape = 0;//@todo
     84        dataOut->m_collisionFlags = m_collisionFlags;
     85        dataOut->m_islandTag1 = m_islandTag1;
     86        dataOut->m_companionId = m_companionId;
     87        dataOut->m_activationState1 = m_activationState1;
     88        dataOut->m_activationState1 = m_activationState1;
     89        dataOut->m_deactivationTime = m_deactivationTime;
     90        dataOut->m_friction = m_friction;
     91        dataOut->m_restitution = m_restitution;
     92        dataOut->m_internalType = m_internalType;
     93       
     94        char* name = (char*) serializer->findNameForPointer(this);
     95        dataOut->m_name = (char*)serializer->getUniquePointer(name);
     96        if (dataOut->m_name)
     97        {
     98                serializer->serializeName(name);
     99        }
     100        dataOut->m_hitFraction = m_hitFraction;
     101        dataOut->m_ccdSweptSphereRadius = m_ccdSweptSphereRadius;
     102        dataOut->m_ccdMotionThreshold = m_ccdMotionThreshold;
     103        dataOut->m_ccdMotionThreshold = m_ccdMotionThreshold;
     104        dataOut->m_checkCollideWith = m_checkCollideWith;
     105
     106        return btCollisionObjectDataName;
     107}
    67108
    68109
     110void btCollisionObject::serializeSingleObject(class btSerializer* serializer) const
     111{
     112        int len = calculateSerializeBufferSize();
     113        btChunk* chunk = serializer->allocate(len,1);
     114        const char* structType = serialize(chunk->m_oldPtr, serializer);
     115        serializer->finalizeChunk(chunk,structType,BT_COLLISIONOBJECT_CODE,(void*)this);
     116}
Note: See TracChangeset for help on using the changeset viewer.