55 #ifndef USE_BOX_INERTIA_APPROXIMATION
72 int idxRadius, idxHeight;
90 radius2 = halfExtents[idxRadius] * halfExtents[idxRadius];
91 height2 =
btScalar(4.) * halfExtents[idxHeight] * halfExtents[idxHeight];
94 btScalar t1 = div12 * height2 + div4 * radius2;
108 #else //USE_BOX_INERTIA_APPROXIMATION
117 mass/(
btScalar(12.0)) * (lx*lx + lz*lz),
118 mass/(
btScalar(12.0)) * (lx*lx + ly*ly));
119 #endif //USE_BOX_INERTIA_APPROXIMATION
125 const int cylinderUpAxis = 0;
135 btScalar halfHeight = halfExtents[cylinderUpAxis];
146 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
153 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
169 const int cylinderUpAxis = 1;
176 btScalar halfHeight = halfExtents[cylinderUpAxis];
187 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
194 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
203 const int cylinderUpAxis = 2;
213 btScalar halfHeight = halfExtents[cylinderUpAxis];
224 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
231 tmp[YY] = v[YY] < 0.0 ? -halfHeight : halfHeight;
256 for (
int i=0;i<numVectors;i++)
264 for (
int i=0;i<numVectors;i++)
275 for (
int i=0;i<numVectors;i++)