56 #ifndef USE_BOX_INERTIA_APPROXIMATION 73 int idxRadius, idxHeight;
91 radius2 = halfExtents[idxRadius] * halfExtents[idxRadius];
92 height2 =
btScalar(4.) * halfExtents[idxHeight] * halfExtents[idxHeight];
95 btScalar t1 = div12 * height2 + div4 * radius2;
109 #else //USE_BOX_INERTIA_APPROXIMATION 118 mass/(
btScalar(12.0)) * (lx*lx + lz*lz),
119 mass/(
btScalar(12.0)) * (lx*lx + ly*ly));
120 #endif //USE_BOX_INERTIA_APPROXIMATION 126 const int cylinderUpAxis = 0;
136 btScalar halfHeight = halfExtents[cylinderUpAxis];
147 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
154 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
170 const int cylinderUpAxis = 1;
177 btScalar halfHeight = halfExtents[cylinderUpAxis];
188 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
195 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
204 const int cylinderUpAxis = 2;
214 btScalar halfHeight = halfExtents[cylinderUpAxis];
225 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
232 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
257 for (
int i=0;i<numVectors;i++)
265 for (
int i=0;i<numVectors;i++)
276 for (
int i=0;i<numVectors;i++)
btCylinderShapeZ(const btVector3 &halfExtents)
btVector3 getHalfExtentsWithMargin() const
btVector3 CylinderLocalSupportY(const btVector3 &halfExtents, const btVector3 &v)
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3 &vec) const
The btConvexInternalShape is an internal base class, shared by most convex shape implementations.
btScalar btSqrt(btScalar y)
#define SIMD_FORCE_INLINE
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) const
const btVector3 & getHalfExtentsWithoutMargin() const
virtual btScalar getMargin() const
btVector3 m_implicitShapeDimensions
const btScalar & x() const
Return the x value.
btVector3 CylinderLocalSupportZ(const btVector3 &halfExtents, const btVector3 &v)
const btScalar & y() const
Return the y value.
btVector3 can be used to represent 3D points and vectors.
btCylinderShapeX(const btVector3 &halfExtents)
void setSafeMargin(btScalar minDimension, btScalar defaultMarginMultiplier=0.1f)
virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3 &vec) const
btVector3 CylinderLocalSupportX(const btVector3 &halfExtents, const btVector3 &v)
virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3 *vectors, btVector3 *supportVerticesOut, int numVectors) const
btCylinderShape(const btVector3 &halfExtents)
The btCylinderShape class implements a cylinder shape primitive, centered around the origin...
virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3 *vectors, btVector3 *supportVerticesOut, int numVectors) const
void getAabb(const btTransform &t, btVector3 &aabbMin, btVector3 &aabbMax) const
getAabb's default implementation is brute force, expected derived classes to implement a fast dedicat...
virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3 &vec) const
void btTransformAabb(const btVector3 &halfExtents, btScalar margin, const btTransform &t, btVector3 &aabbMinOut, btVector3 &aabbMaxOut)
virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3 *vectors, btVector3 *supportVerticesOut, int numVectors) const
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
const btScalar & z() const
Return the z value.