16 #if defined(_WIN32) || defined(__i386__)
17 #define BT_USE_SSE_IN_API
31 m_localPositionArray.resize(numSpheres);
33 for (
int i = 0; i < numSpheres; i++)
43 #define MIN(_a, _b) ((_a) < (_b) ? (_a) : (_b))
55 vec.setValue(1, 0, 0);
68 int numSpheres = m_localPositionArray.
size();
70 for (
int k = 0; k < numSpheres; k += 128)
73 int inner_count =
MIN(numSpheres - k, 128);
74 for (
long i = 0; i < inner_count; i++)
80 long i = vec.maxDot(temp, inner_count, newDot);
93 for (
int j = 0; j < numVectors; j++)
104 int numSpheres = m_localPositionArray.
size();
106 for (
int k = 0; k < numSpheres; k += 128)
109 int inner_count =
MIN(numSpheres - k, 128);
110 for (
long i = 0; i < inner_count; i++)
116 long i = vec.maxDot(temp, inner_count, newDot);
120 supportVerticesOut[j] = temp[i];
131 getCachedLocalAabb(localAabbMin, localAabbMax);
138 inertia.setValue(mass / (
btScalar(12.0)) * (ly * ly + lz * lz),
139 mass / (
btScalar(12.0)) * (lx * lx + lz * lz),
140 mass / (
btScalar(12.0)) * (lx * lx + ly * ly));
149 int numElem = m_localPositionArray.size();
157 for (
int i = 0; i < numElem; i++, memPtr++)
159 m_localPositionArray[i].serializeFloat(memPtr->
m_pos);
168 return "btMultiSphereShapeData";
typedef float(TangentPoint)[2]
SIMD_FORCE_INLINE btVector3 localGetSupportingVertexWithoutMargin(const btVector3 &vec) const
btConvexShape Interface
virtual void calculateLocalInertia(btScalar mass, btVector3 &inertia) const
virtual void batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3 *vectors, btVector3 *supportVerticesOut, int numVectors) const
@ MULTI_SPHERE_SHAPE_PROXYTYPE
virtual btScalar getMargin() const =0
btMultiSphereShape(const btVector3 *positions, const btScalar *radi, int numSpheres)
btAlignedObjectArray< btScalar > m_radiArray
virtual bool serialize(void *o_alignedDataBuffer, unsigned i_dataBufferSize, bool i_swapEndian) const
Data buffer MUST be 16 byte aligned.
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
SIMD_FORCE_INLINE btScalar btSqrt(btScalar y)
btVector3
btVector3 can be used to represent 3D points and vectors. It has an un-used w component to suit 16-by...
SIMD_FORCE_INLINE long maxDot(const btVector3 *array, long array_count, btScalar &dotOut) const
returns index of maximum dot product between this and vectors in array[]
SIMD_FORCE_INLINE int size() const
return the number of elements in the array
SIMD_FORCE_INLINE void resize(int newsize, const T &fillData=T())
btConvexInternalAabbCachingShape adds local aabb caching for convex shapes, to avoid expensive boundi...
virtual btChunk * allocate(size_t size, int numElements)=0
virtual void * getUniquePointer(void *oldPtr)=0
virtual void finalizeChunk(btChunk *chunk, const char *structType, int chunkCode, void *oldPtr)=0
MutableSpan< float3 > positions
btConvexInternalShapeData m_convexInternalShapeData
int m_localPositionArraySize
btPositionAndRadius * m_localPositionArrayPtr