diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2008-09-29 07:09:03 +0400 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2008-09-29 07:09:03 +0400 |
commit | 0b622fc07f1a19c4fbc72782f6000814b66b2088 (patch) | |
tree | a0cc270ca6238e42acb5845e1f735e07d9c55be8 /extern/bullet2/src/BulletCollision/CollisionDispatch | |
parent | 25fc47aaf2a7898b81eb4617a1cd877832d675c2 (diff) |
added anisotropic friction support for Bullet. Both for static and dynamic objects
Diffstat (limited to 'extern/bullet2/src/BulletCollision/CollisionDispatch')
-rw-r--r-- | extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp | 4 | ||||
-rw-r--r-- | extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h | 17 |
2 files changed, 20 insertions, 1 deletions
diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp index eebd0c99fcb..846c9b9b989 100644 --- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp +++ b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.cpp @@ -17,7 +17,9 @@ subject to the following restrictions: #include "btCollisionObject.h" btCollisionObject::btCollisionObject() - : m_broadphaseHandle(0), + : m_anisotropicFriction(1.f,1.f,1.f), + m_hasAnisotropicFriction(false), + m_broadphaseHandle(0), m_collisionShape(0), m_rootCollisionShape(0), m_collisionFlags(btCollisionObject::CF_STATIC_OBJECT), diff --git a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h index 0961f3e75c9..8442868cf89 100644 --- a/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h +++ b/extern/bullet2/src/BulletCollision/CollisionDispatch/btCollisionObject.h @@ -49,6 +49,9 @@ protected: //without destroying the continuous interpolated motion (which uses this interpolation velocities) btVector3 m_interpolationLinearVelocity; btVector3 m_interpolationAngularVelocity; + btVector3 m_anisotropicFriction; + bool m_hasAnisotropicFriction; + btBroadphaseProxy* m_broadphaseHandle; btCollisionShape* m_collisionShape; @@ -119,6 +122,20 @@ public: return ((m_collisionFlags & (CF_STATIC_OBJECT | CF_KINEMATIC_OBJECT | CF_NO_CONTACT_RESPONSE) )==0); } + const btVector3& getAnisotropicFriction() const + { + return m_anisotropicFriction; + } + void setAnisotropicFriction(const btVector3& anisotropicFriction) + { + m_anisotropicFriction = anisotropicFriction; + m_hasAnisotropicFriction = (anisotropicFriction[0]!=1.f) || (anisotropicFriction[1]!=1.f) || (anisotropicFriction[2]!=1.f); + } + bool hasAnisotropicFriction() const + { + return m_hasAnisotropicFriction; + } + SIMD_FORCE_INLINE bool isStaticObject() const { return (m_collisionFlags & CF_STATIC_OBJECT) != 0; |