51#ifndef USE_BOX_INERTIA_APPROXIMATION
68 int idxRadius, idxHeight;
86 radius2 = halfExtents[idxRadius] * halfExtents[idxRadius];
87 height2 =
btScalar(4.) * halfExtents[idxHeight] * halfExtents[idxHeight];
90 btScalar t1 = div12 * height2 + div4 * radius2;
113 mass / (
btScalar(12.0)) * (lx * lx + lz * lz),
114 mass / (
btScalar(12.0)) * (lx * lx + ly * ly));
120 const int cylinderUpAxis = 0;
129 btScalar halfHeight = halfExtents[cylinderUpAxis];
139 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
146 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
154 const int cylinderUpAxis = 1;
160 btScalar halfHeight = halfExtents[cylinderUpAxis];
170 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
177 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
185 const int cylinderUpAxis = 2;
194 btScalar halfHeight = halfExtents[cylinderUpAxis];
204 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
211 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
233 for (
int i = 0; i < numVectors; i++)
241 for (
int i = 0; i < numVectors; i++)
249 for (
int i = 0; i < numVectors; i++)
void btTransformAabb(const btVector3 &halfExtents, btScalar margin, const btTransform &t, btVector3 &aabbMinOut, btVector3 &aabbMaxOut)
@ CYLINDER_SHAPE_PROXYTYPE
btVector3 CylinderLocalSupportX(const btVector3 &halfExtents, const btVector3 &v)
btVector3 CylinderLocalSupportZ(const btVector3 &halfExtents, const btVector3 &v)
btVector3 CylinderLocalSupportY(const btVector3 &halfExtents, const btVector3 &v)
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btScalar btSqrt(btScalar y)
#define SIMD_FORCE_INLINE
The btConvexInternalShape is an internal base class, shared by most convex shape implementations.
btVector3 m_implicitShapeDimensions
void setSafeMargin(btScalar minDimension, btScalar defaultMarginMultiplier=0.1f)
virtual btScalar getMargin() const
btCylinderShapeX(const btVector3 &halfExtents)
virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3 &vec) const
virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3 *vectors, btVector3 *supportVerticesOut, int numVectors) const
virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3 *vectors, btVector3 *supportVerticesOut, int numVectors) const
virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3 &vec) const
btCylinderShapeZ(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
btCylinderShape(const btVector3 &halfExtents)
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) 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...
const btVector3 & getHalfExtentsWithoutMargin() const
btVector3 getHalfExtentsWithMargin() const
virtual btVector3 localGetSupportingVertexWithoutMargin(const btVector3 &vec) const
btVector3 can be used to represent 3D points and vectors.
const btScalar & z() const
Return the z value.
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
const btScalar & x() const
Return the x value.
const btScalar & y() const
Return the y value.