Upgrade Bullet to version 2.83.
[blender.git] / extern / bullet2 / src / BulletCollision / CollisionDispatch / btCollisionObject.cpp
index 580ea3458607192ccdadd5e7771811e85d9527d5..395df3a550f19e3bd0676e198b3394a66883ce38 100644 (file)
@@ -4,8 +4,8 @@ Copyright (c) 2003-2006 Erwin Coumans  http://continuousphysics.com/Bullet/
 
 This software is provided 'as-is', without any express or implied warranty.
 In no event will the authors be held liable for any damages arising from the use of this software.
-Permission is granted to anyone to use this software for any purpose, 
-including commercial applications, and to alter it and redistribute it freely, 
+Permission is granted to anyone to use this software for any purpose,
+including commercial applications, and to alter it and redistribute it freely,
 subject to the following restrictions:
 
 1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required.
@@ -32,12 +32,15 @@ btCollisionObject::btCollisionObject()
                m_deactivationTime(btScalar(0.)),
                m_friction(btScalar(0.5)),
                m_restitution(btScalar(0.)),
+               m_rollingFriction(0.0f),
                m_internalType(CO_COLLISION_OBJECT),
                m_userObjectPointer(0),
+               m_userIndex(-1),
                m_hitFraction(btScalar(1.)),
                m_ccdSweptSphereRadius(btScalar(0.)),
                m_ccdMotionThreshold(btScalar(0.)),
-               m_checkCollideWith(false)
+               m_checkCollideWith(false),
+               m_updateRevision(0)
 {
        m_worldTransform.setIdentity();
 }
@@ -46,18 +49,18 @@ btCollisionObject::~btCollisionObject()
 {
 }
 
-void btCollisionObject::setActivationState(int newState) 
+void btCollisionObject::setActivationState(int newState) const
 { 
        if ( (m_activationState1 != DISABLE_DEACTIVATION) && (m_activationState1 != DISABLE_SIMULATION))
                m_activationState1 = newState;
 }
 
-void btCollisionObject::forceActivationState(int newState)
+void btCollisionObject::forceActivationState(int newState) const
 {
        m_activationState1 = newState;
 }
 
-void btCollisionObject::activate(bool forceActivation)
+void btCollisionObject::activate(bool forceActivation) const
 {
        if (forceActivation || !(m_collisionFlags & (CF_STATIC_OBJECT|CF_KINEMATIC_OBJECT)))
        {
@@ -85,9 +88,9 @@ const char* btCollisionObject::serialize(void* dataBuffer, btSerializer* seriali
        dataOut->m_islandTag1 = m_islandTag1;
        dataOut->m_companionId = m_companionId;
        dataOut->m_activationState1 = m_activationState1;
-       dataOut->m_activationState1 = m_activationState1;
        dataOut->m_deactivationTime = m_deactivationTime;
        dataOut->m_friction = m_friction;
+       dataOut->m_rollingFriction = m_rollingFriction;
        dataOut->m_restitution = m_restitution;
        dataOut->m_internalType = m_internalType;
        
@@ -100,7 +103,6 @@ const char* btCollisionObject::serialize(void* dataBuffer, btSerializer* seriali
        dataOut->m_hitFraction = m_hitFraction;
        dataOut->m_ccdSweptSphereRadius = m_ccdSweptSphereRadius;
        dataOut->m_ccdMotionThreshold = m_ccdMotionThreshold;
-       dataOut->m_ccdMotionThreshold = m_ccdMotionThreshold;
        dataOut->m_checkCollideWith = m_checkCollideWith;
 
        return btCollisionObjectDataName;