diff options
author | Erwin Coumans <blender@erwincoumans.com> | 2007-06-23 09:28:07 +0400 |
---|---|---|
committer | Erwin Coumans <blender@erwincoumans.com> | 2007-06-23 09:28:07 +0400 |
commit | ca26aeb7b23e37e65f49d907ea53fcaeee77ad4e (patch) | |
tree | b6530195a8ef5d874b9fc2bbb9574f1484781be5 /extern/bullet2/src/BulletCollision/CollisionShapes/btCylinderShape.h | |
parent | 14ad8c9941ac1e6f5252a843c6ad17653cbbd689 (diff) |
upgrade to latest Bullet 2.53. cross the fingers it doesn't break one of the exotic or less exotic platforms
Diffstat (limited to 'extern/bullet2/src/BulletCollision/CollisionShapes/btCylinderShape.h')
-rw-r--r-- | extern/bullet2/src/BulletCollision/CollisionShapes/btCylinderShape.h | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/extern/bullet2/src/BulletCollision/CollisionShapes/btCylinderShape.h b/extern/bullet2/src/BulletCollision/CollisionShapes/btCylinderShape.h index bb0e4298abc..c78890c887a 100644 --- a/extern/bullet2/src/BulletCollision/CollisionShapes/btCylinderShape.h +++ b/extern/bullet2/src/BulletCollision/CollisionShapes/btCylinderShape.h @@ -17,22 +17,23 @@ subject to the following restrictions: #define CYLINDER_MINKOWSKI_H #include "btBoxShape.h" -#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" // for the types -#include "LinearMath/btVector3.h" +#include "../BroadphaseCollision/btBroadphaseProxy.h" // for the types +#include "../../LinearMath/btVector3.h" /// implements cylinder shape interface class btCylinderShape : public btBoxShape { +protected: + + int m_upAxis; + public: btCylinderShape (const btVector3& halfExtents); ///getAabb's default implementation is brute force, expected derived classes to implement a fast dedicated version - void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const - { - getAabbSlow(t,aabbMin,aabbMax); - } + void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const; virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const; @@ -44,12 +45,12 @@ public: btVector3 supVertex; supVertex = localGetSupportingVertexWithoutMargin(vec); - if ( getMargin()!=0.f ) + if ( getMargin()!=btScalar(0.) ) { btVector3 vecnorm = vec; if (vecnorm .length2() < (SIMD_EPSILON*SIMD_EPSILON)) { - vecnorm.setValue(-1.f,-1.f,-1.f); + vecnorm.setValue(btScalar(-1.),btScalar(-1.),btScalar(-1.)); } vecnorm.normalize(); supVertex+= getMargin() * vecnorm; @@ -66,12 +67,12 @@ public: return CYLINDER_SHAPE_PROXYTYPE; } - virtual int getUpAxis() const + int getUpAxis() const { - return 1; + return m_upAxis; } - virtual float getRadius() const + virtual btScalar getRadius() const { return getHalfExtents().getX(); } @@ -93,17 +94,14 @@ public: virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3& vec)const; virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const; - virtual int getUpAxis() const - { - return 0; - } + //debugging virtual char* getName()const { return "CylinderX"; } - virtual float getRadius() const + virtual btScalar getRadius() const { return getHalfExtents().getY(); } @@ -128,7 +126,7 @@ public: return "CylinderZ"; } - virtual float getRadius() const + virtual btScalar getRadius() const { return getHalfExtents().getX(); } |