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/btCollisionShape.h')
-rw-r--r--extern/bullet2/src/BulletCollision/CollisionShapes/btCollisionShape.h91
1 files changed, 42 insertions, 49 deletions
diff --git a/extern/bullet2/src/BulletCollision/CollisionShapes/btCollisionShape.h b/extern/bullet2/src/BulletCollision/CollisionShapes/btCollisionShape.h
index 5e86568005e..c80e105a4d8 100644
--- a/extern/bullet2/src/BulletCollision/CollisionShapes/btCollisionShape.h
+++ b/extern/bullet2/src/BulletCollision/CollisionShapes/btCollisionShape.h
@@ -19,12 +19,12 @@ subject to the following restrictions:
#include "LinearMath/btTransform.h"
#include "LinearMath/btVector3.h"
#include "LinearMath/btMatrix3x3.h"
-#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" //for the shape types
+#include "BulletCollision/BroadphaseCollision/btBroadphaseProxy.h" //for the shape types
class btSerializer;
-
///The btCollisionShape class provides an interface for collision shapes that can be shared among btCollisionObjects.
-ATTRIBUTE_ALIGNED16(class) btCollisionShape
+ATTRIBUTE_ALIGNED16(class)
+btCollisionShape
{
protected:
int m_shapeType;
@@ -32,10 +32,9 @@ protected:
int m_userIndex;
public:
-
BT_DECLARE_ALIGNED_ALLOCATOR();
- btCollisionShape() : m_shapeType (INVALID_SHAPE_PROXYTYPE), m_userPointer(0), m_userIndex(-1)
+ btCollisionShape() : m_shapeType(INVALID_SHAPE_PROXYTYPE), m_userPointer(0), m_userIndex(-1)
{
}
@@ -44,50 +43,47 @@ public:
}
///getAabb returns the axis aligned bounding box in the coordinate frame of the given transform t.
- virtual void getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const =0;
+ virtual void getAabb(const btTransform& t, btVector3& aabbMin, btVector3& aabbMax) const = 0;
- virtual void getBoundingSphere(btVector3& center,btScalar& radius) const;
+ virtual void getBoundingSphere(btVector3 & center, btScalar & radius) const;
- ///getAngularMotionDisc returns the maximus radius needed for Conservative Advancement to handle time-of-impact with rotations.
- virtual btScalar getAngularMotionDisc() const;
-
- virtual btScalar getContactBreakingThreshold(btScalar defaultContactThresholdFactor) const;
+ ///getAngularMotionDisc returns the maximum radius needed for Conservative Advancement to handle time-of-impact with rotations.
+ virtual btScalar getAngularMotionDisc() const;
+ virtual btScalar getContactBreakingThreshold(btScalar defaultContactThresholdFactor) const;
///calculateTemporalAabb calculates the enclosing aabb for the moving object over interval [0..timeStep)
///result is conservative
- void calculateTemporalAabb(const btTransform& curTrans,const btVector3& linvel,const btVector3& angvel,btScalar timeStep, btVector3& temporalAabbMin,btVector3& temporalAabbMax) const;
-
+ void calculateTemporalAabb(const btTransform& curTrans, const btVector3& linvel, const btVector3& angvel, btScalar timeStep, btVector3& temporalAabbMin, btVector3& temporalAabbMax) const;
-
- SIMD_FORCE_INLINE bool isPolyhedral() const
+ SIMD_FORCE_INLINE bool isPolyhedral() const
{
return btBroadphaseProxy::isPolyhedral(getShapeType());
}
- SIMD_FORCE_INLINE bool isConvex2d() const
+ SIMD_FORCE_INLINE bool isConvex2d() const
{
return btBroadphaseProxy::isConvex2d(getShapeType());
}
- SIMD_FORCE_INLINE bool isConvex() const
+ SIMD_FORCE_INLINE bool isConvex() const
{
return btBroadphaseProxy::isConvex(getShapeType());
}
- SIMD_FORCE_INLINE bool isNonMoving() const
+ SIMD_FORCE_INLINE bool isNonMoving() const
{
return btBroadphaseProxy::isNonMoving(getShapeType());
}
- SIMD_FORCE_INLINE bool isConcave() const
+ SIMD_FORCE_INLINE bool isConcave() const
{
return btBroadphaseProxy::isConcave(getShapeType());
}
- SIMD_FORCE_INLINE bool isCompound() const
+ SIMD_FORCE_INLINE bool isCompound() const
{
return btBroadphaseProxy::isCompound(getShapeType());
}
- SIMD_FORCE_INLINE bool isSoftBody() const
+ SIMD_FORCE_INLINE bool isSoftBody() const
{
return btBroadphaseProxy::isSoftBody(getShapeType());
}
@@ -99,35 +95,35 @@ public:
}
#ifndef __SPU__
- virtual void setLocalScaling(const btVector3& scaling) =0;
- virtual const btVector3& getLocalScaling() const =0;
- virtual void calculateLocalInertia(btScalar mass,btVector3& inertia) const = 0;
-
+ virtual void setLocalScaling(const btVector3& scaling) = 0;
+ virtual const btVector3& getLocalScaling() const = 0;
+ virtual void calculateLocalInertia(btScalar mass, btVector3 & inertia) const = 0;
-//debugging support
- virtual const char* getName()const =0 ;
-#endif //__SPU__
+ //debugging support
+ virtual const char* getName() const = 0;
+#endif //__SPU__
-
- int getShapeType() const { return m_shapeType; }
+ int getShapeType() const
+ {
+ return m_shapeType;
+ }
///the getAnisotropicRollingFrictionDirection can be used in combination with setAnisotropicFriction
///See Bullet/Demos/RollingFrictionDemo for an example
- virtual btVector3 getAnisotropicRollingFrictionDirection() const
+ virtual btVector3 getAnisotropicRollingFrictionDirection() const
{
- return btVector3(1,1,1);
+ return btVector3(1, 1, 1);
}
- virtual void setMargin(btScalar margin) = 0;
- virtual btScalar getMargin() const = 0;
+ virtual void setMargin(btScalar margin) = 0;
+ virtual btScalar getMargin() const = 0;
-
///optional user data pointer
- void setUserPointer(void* userPtr)
+ void setUserPointer(void* userPtr)
{
m_userPointer = userPtr;
}
- void* getUserPointer() const
+ void* getUserPointer() const
{
return m_userPointer;
}
@@ -141,16 +137,16 @@ public:
return m_userIndex;
}
-
- virtual int calculateSerializeBufferSize() const;
+ virtual int calculateSerializeBufferSize() const;
///fills the dataBuffer and returns the struct name (and 0 on failure)
- virtual const char* serialize(void* dataBuffer, btSerializer* serializer) const;
-
- virtual void serializeSingleShape(btSerializer* serializer) const;
+ virtual const char* serialize(void* dataBuffer, btSerializer* serializer) const;
-};
+ virtual void serializeSingleShape(btSerializer * serializer) const;
+};
+// clang-format off
+// parser needs * with the name
///do not change those serialization structures, it requires an updated sBulletDNAstr/sBulletDNAstr64
struct btCollisionShapeData
{
@@ -158,13 +154,10 @@ struct btCollisionShapeData
int m_shapeType;
char m_padding[4];
};
-
-SIMD_FORCE_INLINE int btCollisionShape::calculateSerializeBufferSize() const
+// clang-format on
+SIMD_FORCE_INLINE int btCollisionShape::calculateSerializeBufferSize() const
{
return sizeof(btCollisionShapeData);
}
-
-
-#endif //BT_COLLISION_SHAPE_H
-
+#endif //BT_COLLISION_SHAPE_H