20 #if defined (__CELLOS_LV2__) && defined (__SPU__)
21 #include <spu_intrinsics.h>
25 result = spu_mul( vec0, vec1 );
26 result = spu_madd( spu_rlqwbyte( vec0, 4 ), spu_rlqwbyte( vec1, 4 ), result );
27 return spu_madd( spu_rlqwbyte( vec0, 8 ), spu_rlqwbyte( vec1, 8 ), result );
43 halfExtents +=
btVector3(margin,margin,margin);
47 btVector3 extent = halfExtents.
dot3( abs_b[0], abs_b[1], abs_b[2] );
49 aabbMin = center - extent;
50 aabbMax = center + extent;
59 halfExtents[1] += radius;
60 halfExtents +=
btVector3(margin,margin,margin);
62 int capsuleUpAxis = convexShape->getUpAxis();
63 btScalar halfHeight = convexShape->getHalfHeight();
64 btScalar radius = convexShape->getRadius();
65 halfExtents[capsuleUpAxis] = radius + halfHeight;
70 btVector3 extent = halfExtents.
dot3( abs_b[0], abs_b[1], abs_b[2] );
72 aabbMin = center - extent;
73 aabbMax = center + extent;
83 aabbMin = center - extent;
84 aabbMax = center + extent;
109 register int dmaSize;
233 cellDmaGet(collisionShapeLocation, collisionShapePtr , dmaSize,
DMA_TAG(dmaTag), 0, 0);
240 register int dmaSize;
253 for ( i = 0; i < childShapeCount; ++i)
264 int curIndex = startNodeIndex;
265 int walkIterations = 0;
267 int subTreeSize = endNodeIndex - startNodeIndex;
272 unsigned int aabbOverlap, isLeafNode;
274 while (curIndex < endNodeIndex)
277 btAssert (walkIterations < subTreeSize);
283 if (isLeafNode && aabbOverlap)
290 if (aabbOverlap || isLeafNode)
297 rootNode += escapeIndex;
298 curIndex += escapeIndex;
void dmaCompoundShapeInfo(CompoundShape_LocalStoreMemory *compoundShapeLocation, btCompoundShape *spuCompoundShape, uint32_t dmaTag)
void computeAabb(btVector3 &aabbMin, btVector3 &aabbMax, btConvexInternalShape *convexShape, ppu_address_t convexShapePtr, int shapeType, const btTransform &xform)
not supported on IBM SDK, until we fix the alignment of btVector3
void getNonvirtualAabb(const btTransform &trans, btVector3 &aabbMin, btVector3 &aabbMax, btScalar margin) const
The btIndexedMesh indexes a single vertex and index array.
int cellDmaGet(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid)
void dmaCompoundSubShapes(CompoundShape_LocalStoreMemory *compoundShapeLocation, btCompoundShape *spuCompoundShape, uint32_t dmaTag)
btTriangleIndexVertexArray gTriangleMeshInterfaceStorage
The btConvexInternalShape is an internal base class, shared by most convex shape implementations.
The btCapsuleShape represents a capsule around the Y axis, there is also the btCapsuleShapeX aligned ...
void dmaBvhSubTreeHeaders(btBvhSubtreeInfo *subTreeHeaders, ppu_address_t subTreePtr, int batchSize, uint32_t dmaTag)
The btSphereShape implements an implicit sphere, centered around a local origin with radius...
btCollisionShape * m_childShape
char gSubshapeShape[16][256]
void dmaBvhIndexedMesh(btIndexedMesh *IndexMesh, IndexedMeshArray &indexArray, int index, uint32_t dmaTag)
btBvhSubtreeInfo provides info to gather a subtree of limited size
int getShapeTypeSize(int shapeType)
getShapeTypeSize could easily be optimized, but it is not likely a bottleneck
btVector3 * getUnscaledPoints()
The btBvhTriangleMeshShape is a static-triangle mesh shape, it can only be used for fixed/non-moving ...
The btTriangleIndexVertexArray allows to access multiple triangle meshes, by indexing into existing t...
btMatrix3x3 absolute() const
Return the matrix with all values non negative.
virtual void processNode(int subPart, int triangleIndex)=0
const btScalar & getX() const
Return the x value.
void * cellDmaGetReadOnly(void *ls, uint64_t ea, uint32_t size, uint32_t tag, uint32_t tid, uint32_t rid)
void cellDmaWaitTagStatusAll(int ignore)
cellDmaWaitTagStatusAll Win32 replacements for Cell DMA to allow simulating most of the SPU code (jus...
The btOptimizedBvh extends the btQuantizedBvh to create AABB tree for triangle meshes, through the btStridingMeshInterface.
btQuantizedBvhNode is a compressed aabb node, 16 bytes.
The btBoxShape is a box primitive around the origin, its sides axis aligned with length specified by ...
btVector3 can be used to represent 3D points and vectors.
#define ATTRIBUTE_ALIGNED16(a)
btCompoundShapeChild * getChildList()
btScalar getMarginNV() const
void dmaCollisionShape(void *collisionShapeLocation, ppu_address_t collisionShapePtr, uint32_t dmaTag, int shapeType)
void dmaBvhShapeData(bvhMeshShape_LocalStoreMemory *bvhMeshShape, btBvhTriangleMeshShape *triMeshShape)
int getTriangleIndex() const
const btVector3 & getImplicitShapeDimensions() const
The btCylinderShape class implements a cylinder shape primitive, centered around the origin...
btVector3 dot3(const btVector3 &v0, const btVector3 &v1, const btVector3 &v2) const
void spuWalkStacklessQuantizedTree(btNodeOverlapCallback *nodeCallback, unsigned short int *quantizedQueryAabbMin, unsigned short int *quantizedQueryAabbMax, const btQuantizedBvhNode *rootNode, int startNodeIndex, int endNodeIndex)
unsigned short int m_quantizedAabbMin[3]
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
char gOptimizedBvh[sizeof(btOptimizedBvh)+16]
The btConvexHullShape implements an implicit convex hull of an array of vertices. ...
btTriangleIndexVertexArray * gTriangleMeshInterfacePtr
unsigned short int m_quantizedAabbMax[3]
btOptimizedBvh * getOptimizedBvh()
The btCompoundShape allows to store multiple other btCollisionShapes This allows for moving concave c...
btStridingMeshInterface * getMeshInterface()
void dmaConvexVertexData(SpuConvexPolyhedronVertexData *convexVertexData, btConvexHullShape *convexShapeSPU)
The btStaticPlaneShape simulates an infinite non-moving (static) collision plane. ...
btCompoundShapeChild gSubshapes[16]
#define MAX_NUM_SPU_CONVEX_POINTS
unsigned int spuTestQuantizedAabbAgainstQuantizedAabb(unsigned short int *aabbMin1, unsigned short int *aabbMax1, const unsigned short int *aabbMin2, const unsigned short int *aabbMax2)
void dmaBvhSubTreeNodes(btQuantizedBvhNode *nodes, const btBvhSubtreeInfo &subtree, QuantizedNodeArray &nodeArray, int dmaTag)
btVector3 g_convexPointBuffer[128]
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
int getEscapeIndex() const
int getNumChildShapes() const