Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'extern/bullet2/src/BulletCollision/CollisionShapes/btCylinderShape.h')
-rw-r--r--extern/bullet2/src/BulletCollision/CollisionShapes/btCylinderShape.h32
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();
}