rename to b3 convention, to avoid naming conflicts when using in combination with Bullet 2.x
This commit is contained in:
@@ -433,7 +433,7 @@ void computeContactPlaneConvex(int pairIndex,
|
||||
|
||||
b3Vector3 planeEq = faces[collidables[collidableIndexA].m_shapeIndex].m_plane;
|
||||
b3Vector3 planeNormal(planeEq.x,planeEq.y,planeEq.z);
|
||||
b3Vector3 planeNormalWorld = quatRotate(ornA,planeNormal);
|
||||
b3Vector3 planeNormalWorld = b3QuatRotate(ornA,planeNormal);
|
||||
float planeConstant = planeEq.w;
|
||||
b3Transform convexWorldTransform;
|
||||
convexWorldTransform.setIdentity();
|
||||
@@ -571,7 +571,7 @@ void computeContactPlaneCompound(int pairIndex,
|
||||
|
||||
b3Vector3 planeEq = faces[collidables[collidableIndexA].m_shapeIndex].m_plane;
|
||||
b3Vector3 planeNormal(planeEq.x,planeEq.y,planeEq.z);
|
||||
b3Vector3 planeNormalWorld = quatRotate(ornA,planeNormal);
|
||||
b3Vector3 planeNormalWorld = b3QuatRotate(ornA,planeNormal);
|
||||
float planeConstant = planeEq.w;
|
||||
b3Transform convexWorldTransform;
|
||||
convexWorldTransform.setIdentity();
|
||||
|
||||
@@ -10,7 +10,7 @@ struct b3GpuFace
|
||||
int m_numIndices;
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED16(struct) b3ConvexPolyhedronCL
|
||||
B3_ATTRIBUTE_ALIGNED16(struct) b3ConvexPolyhedronCL
|
||||
{
|
||||
b3Vector3 m_localCenter;
|
||||
b3Vector3 m_extents;
|
||||
@@ -36,7 +36,7 @@ ATTRIBUTE_ALIGNED16(struct) b3ConvexPolyhedronCL
|
||||
int numVerts = m_numVertices;
|
||||
|
||||
const b3Vector3 localDir = trans.getBasis().transpose()*dir;
|
||||
const b3Vector3 localDi2 = quatRotate(trans.getRotation().inverse(),dir);
|
||||
const b3Vector3 localDi2 = b3QuatRotate(trans.getRotation().inverse(),dir);
|
||||
|
||||
b3Scalar offset = trans.getOrigin().dot(dir);
|
||||
|
||||
|
||||
@@ -146,7 +146,7 @@ bool b3ConvexUtility::initializePolyhedralFeatures(const b3Vector3* orgVertices,
|
||||
{
|
||||
//do the merge: use Graham Scan 2d convex hull
|
||||
|
||||
b3AlignedObjectArray<GrahamVector3> orgpoints;
|
||||
b3AlignedObjectArray<b3GrahamVector3> orgpoints;
|
||||
b3Vector3 averageFaceNormal(0,0,0);
|
||||
|
||||
for (int i=0;i<coplanarFaceGroup.size();i++)
|
||||
@@ -173,7 +173,7 @@ bool b3ConvexUtility::initializePolyhedralFeatures(const b3Vector3* orgVertices,
|
||||
}
|
||||
}
|
||||
if (!found)
|
||||
orgpoints.push_back(GrahamVector3(pt,orgIndex));
|
||||
orgpoints.push_back(b3GrahamVector3(pt,orgIndex));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -183,10 +183,10 @@ bool b3ConvexUtility::initializePolyhedralFeatures(const b3Vector3* orgVertices,
|
||||
for (int i=0;i<4;i++)
|
||||
combinedFace.m_plane[i] = tmpFaces[coplanarFaceGroup[0]].m_plane[i];
|
||||
|
||||
b3AlignedObjectArray<GrahamVector3> hull;
|
||||
b3AlignedObjectArray<b3GrahamVector3> hull;
|
||||
|
||||
averageFaceNormal.normalize();
|
||||
GrahamScanConvexHull2D(orgpoints,hull,averageFaceNormal);
|
||||
b3GrahamScanConvexHull2D(orgpoints,hull,averageFaceNormal);
|
||||
|
||||
for (int i=0;i<hull.size();i++)
|
||||
{
|
||||
|
||||
@@ -29,7 +29,7 @@ struct b3MyFace
|
||||
b3Scalar m_plane[4];
|
||||
};
|
||||
|
||||
ATTRIBUTE_ALIGNED16(class) b3ConvexUtility
|
||||
B3_ATTRIBUTE_ALIGNED16(class) b3ConvexUtility
|
||||
{
|
||||
public:
|
||||
B3_DECLARE_ALIGNED_ALLOCATOR();
|
||||
|
||||
@@ -257,7 +257,7 @@ void b3OptimizedBvh::refitPartial(b3StridingMeshInterface* meshInterface,const b
|
||||
b3BvhSubtreeInfo& subtree = m_SubtreeHeaders[i];
|
||||
|
||||
//PCK: unsigned instead of bool
|
||||
unsigned overlap = testQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,subtree.m_quantizedAabbMin,subtree.m_quantizedAabbMax);
|
||||
unsigned overlap = b3TestQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,subtree.m_quantizedAabbMin,subtree.m_quantizedAabbMax);
|
||||
if (overlap != 0)
|
||||
{
|
||||
updateBvhNodes(meshInterface,subtree.m_rootNodeIndex,subtree.m_rootNodeIndex+subtree.m_subtreeSize,i);
|
||||
|
||||
@@ -24,7 +24,7 @@ class b3StridingMeshInterface;
|
||||
|
||||
|
||||
///The b3OptimizedBvh extends the b3QuantizedBvh to create AABB tree for triangle meshes, through the b3StridingMeshInterface.
|
||||
ATTRIBUTE_ALIGNED16(class) b3OptimizedBvh : public b3QuantizedBvh
|
||||
B3_ATTRIBUTE_ALIGNED16(class) b3OptimizedBvh : public b3QuantizedBvh
|
||||
{
|
||||
|
||||
public:
|
||||
|
||||
@@ -28,8 +28,8 @@ b3QuantizedBvh::b3QuantizedBvh() :
|
||||
//m_traversalMode(TRAVERSAL_RECURSIVE)
|
||||
,m_subtreeHeaderCount(0) //PCK: add this line
|
||||
{
|
||||
m_bvhAabbMin.setValue(-SIMD_INFINITY,-SIMD_INFINITY,-SIMD_INFINITY);
|
||||
m_bvhAabbMax.setValue(SIMD_INFINITY,SIMD_INFINITY,SIMD_INFINITY);
|
||||
m_bvhAabbMin.setValue(-B3_INFINITY,-B3_INFINITY,-B3_INFINITY);
|
||||
m_bvhAabbMax.setValue(B3_INFINITY,B3_INFINITY,B3_INFINITY);
|
||||
}
|
||||
|
||||
|
||||
@@ -146,8 +146,8 @@ void b3QuantizedBvh::buildTree (int startIndex,int endIndex)
|
||||
|
||||
//set the min aabb to 'inf' or a max value, and set the max aabb to a -inf/minimum value.
|
||||
//the aabb will be expanded during buildTree/mergeInternalNodeAabb with actual node values
|
||||
setInternalNodeAabbMin(m_curNodeIndex,m_bvhAabbMax);//can't use b3Vector3(SIMD_INFINITY,SIMD_INFINITY,SIMD_INFINITY)) because of quantization
|
||||
setInternalNodeAabbMax(m_curNodeIndex,m_bvhAabbMin);//can't use b3Vector3(-SIMD_INFINITY,-SIMD_INFINITY,-SIMD_INFINITY)) because of quantization
|
||||
setInternalNodeAabbMin(m_curNodeIndex,m_bvhAabbMax);//can't use b3Vector3(B3_INFINITY,B3_INFINITY,B3_INFINITY)) because of quantization
|
||||
setInternalNodeAabbMax(m_curNodeIndex,m_bvhAabbMin);//can't use b3Vector3(-B3_INFINITY,-B3_INFINITY,-B3_INFINITY)) because of quantization
|
||||
|
||||
|
||||
for (i=startIndex;i<endIndex;i++)
|
||||
@@ -366,7 +366,7 @@ void b3QuantizedBvh::walkStacklessTree(b3NodeOverlapCallback* nodeCallback,const
|
||||
b3Assert (walkIterations < m_curNodeIndex);
|
||||
|
||||
walkIterations++;
|
||||
aabbOverlap = TestAabbAgainstAabb2(aabbMin,aabbMax,rootNode->m_aabbMinOrg,rootNode->m_aabbMaxOrg);
|
||||
aabbOverlap = b3TestAabbAgainstAabb2(aabbMin,aabbMax,rootNode->m_aabbMinOrg,rootNode->m_aabbMaxOrg);
|
||||
isLeafNode = rootNode->m_escapeIndex == -1;
|
||||
|
||||
//PCK: unsigned instead of bool
|
||||
@@ -422,7 +422,7 @@ void b3QuantizedBvh::walkRecursiveQuantizedTreeAgainstQueryAabb(const b3Quantize
|
||||
unsigned aabbOverlap;
|
||||
|
||||
//PCK: unsigned instead of bool
|
||||
aabbOverlap = testQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,currentNode->m_quantizedAabbMin,currentNode->m_quantizedAabbMax);
|
||||
aabbOverlap = b3TestQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,currentNode->m_quantizedAabbMin,currentNode->m_quantizedAabbMax);
|
||||
isLeafNode = currentNode->isLeafNode();
|
||||
|
||||
//PCK: unsigned instead of bool
|
||||
@@ -496,7 +496,7 @@ void b3QuantizedBvh::walkStacklessTreeAgainstRay(b3NodeOverlapCallback* nodeCall
|
||||
bounds[0] -= aabbMax;
|
||||
bounds[1] -= aabbMin;
|
||||
|
||||
aabbOverlap = TestAabbAgainstAabb2(rayAabbMin,rayAabbMax,rootNode->m_aabbMinOrg,rootNode->m_aabbMaxOrg);
|
||||
aabbOverlap = b3TestAabbAgainstAabb2(rayAabbMin,rayAabbMax,rootNode->m_aabbMinOrg,rootNode->m_aabbMaxOrg);
|
||||
//perhaps profile if it is worth doing the aabbOverlap test first
|
||||
|
||||
#ifdef RAYAABB2
|
||||
@@ -609,7 +609,7 @@ void b3QuantizedBvh::walkStacklessQuantizedTreeAgainstRay(b3NodeOverlapCallback*
|
||||
// only interested if this is closer than any previous hit
|
||||
b3Scalar param = 1.0;
|
||||
rayBoxOverlap = 0;
|
||||
boxBoxOverlap = testQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,rootNode->m_quantizedAabbMin,rootNode->m_quantizedAabbMax);
|
||||
boxBoxOverlap = b3TestQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,rootNode->m_quantizedAabbMin,rootNode->m_quantizedAabbMax);
|
||||
isLeafNode = rootNode->isLeafNode();
|
||||
if (boxBoxOverlap)
|
||||
{
|
||||
@@ -703,7 +703,7 @@ void b3QuantizedBvh::walkStacklessQuantizedTree(b3NodeOverlapCallback* nodeCallb
|
||||
|
||||
walkIterations++;
|
||||
//PCK: unsigned instead of bool
|
||||
aabbOverlap = testQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,rootNode->m_quantizedAabbMin,rootNode->m_quantizedAabbMax);
|
||||
aabbOverlap = b3TestQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,rootNode->m_quantizedAabbMin,rootNode->m_quantizedAabbMax);
|
||||
isLeafNode = rootNode->isLeafNode();
|
||||
|
||||
if (isLeafNode && aabbOverlap)
|
||||
@@ -741,7 +741,7 @@ void b3QuantizedBvh::walkStacklessQuantizedTreeCacheFriendly(b3NodeOverlapCallba
|
||||
const b3BvhSubtreeInfo& subtree = m_SubtreeHeaders[i];
|
||||
|
||||
//PCK: unsigned instead of bool
|
||||
unsigned overlap = testQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,subtree.m_quantizedAabbMin,subtree.m_quantizedAabbMax);
|
||||
unsigned overlap = b3TestQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,subtree.m_quantizedAabbMin,subtree.m_quantizedAabbMax);
|
||||
if (overlap != 0)
|
||||
{
|
||||
walkStacklessQuantizedTree(nodeCallback,quantizedQueryAabbMin,quantizedQueryAabbMax,
|
||||
|
||||
@@ -55,7 +55,7 @@ class b3Serializer;
|
||||
|
||||
///b3QuantizedBvhNode is a compressed aabb node, 16 bytes.
|
||||
///Node can be used for leafnode or internal node. Leafnodes can point to 32-bit triangle index (non-negative range).
|
||||
ATTRIBUTE_ALIGNED16 (struct) b3QuantizedBvhNode
|
||||
B3_ATTRIBUTE_ALIGNED16 (struct) b3QuantizedBvhNode
|
||||
{
|
||||
B3_DECLARE_ALIGNED_ALLOCATOR();
|
||||
|
||||
@@ -94,7 +94,7 @@ ATTRIBUTE_ALIGNED16 (struct) b3QuantizedBvhNode
|
||||
|
||||
/// b3OptimizedBvhNode contains both internal and leaf node information.
|
||||
/// Total node size is 44 bytes / node. You can use the compressed version of 16 bytes.
|
||||
ATTRIBUTE_ALIGNED16 (struct) b3OptimizedBvhNode
|
||||
B3_ATTRIBUTE_ALIGNED16 (struct) b3OptimizedBvhNode
|
||||
{
|
||||
B3_DECLARE_ALIGNED_ALLOCATOR();
|
||||
|
||||
@@ -116,7 +116,7 @@ ATTRIBUTE_ALIGNED16 (struct) b3OptimizedBvhNode
|
||||
|
||||
|
||||
///b3BvhSubtreeInfo provides info to gather a subtree of limited size
|
||||
ATTRIBUTE_ALIGNED16(class) b3BvhSubtreeInfo
|
||||
B3_ATTRIBUTE_ALIGNED16(class) b3BvhSubtreeInfo
|
||||
{
|
||||
public:
|
||||
B3_DECLARE_ALIGNED_ALLOCATOR();
|
||||
@@ -171,7 +171,7 @@ typedef b3AlignedObjectArray<b3BvhSubtreeInfo> BvhSubtreeInfoArray;
|
||||
///The b3QuantizedBvh class stores an AABB tree that can be quickly traversed on CPU and Cell SPU.
|
||||
///It is used by the b3BvhTriangleMeshShape as midphase, and by the b3MultiSapBroadphase.
|
||||
///It is recommended to use quantization for better performance and lower memory requirements.
|
||||
ATTRIBUTE_ALIGNED16(class) b3QuantizedBvh
|
||||
B3_ATTRIBUTE_ALIGNED16(class) b3QuantizedBvh
|
||||
{
|
||||
public:
|
||||
enum b3TraversalMode
|
||||
@@ -350,7 +350,7 @@ public:
|
||||
void reportRayOverlappingNodex (b3NodeOverlapCallback* nodeCallback, const b3Vector3& raySource, const b3Vector3& rayTarget) const;
|
||||
void reportBoxCastOverlappingNodex(b3NodeOverlapCallback* nodeCallback, const b3Vector3& raySource, const b3Vector3& rayTarget, const b3Vector3& aabbMin,const b3Vector3& aabbMax) const;
|
||||
|
||||
SIMD_FORCE_INLINE void quantize(unsigned short* out, const b3Vector3& point,int isMax) const
|
||||
B3_FORCE_INLINE void quantize(unsigned short* out, const b3Vector3& point,int isMax) const
|
||||
{
|
||||
|
||||
b3Assert(m_useQuantization);
|
||||
@@ -417,7 +417,7 @@ public:
|
||||
}
|
||||
|
||||
|
||||
SIMD_FORCE_INLINE void quantizeWithClamp(unsigned short* out, const b3Vector3& point2,int isMax) const
|
||||
B3_FORCE_INLINE void quantizeWithClamp(unsigned short* out, const b3Vector3& point2,int isMax) const
|
||||
{
|
||||
|
||||
b3Assert(m_useQuantization);
|
||||
@@ -430,7 +430,7 @@ public:
|
||||
|
||||
}
|
||||
|
||||
SIMD_FORCE_INLINE b3Vector3 unQuantize(const unsigned short* vecIn) const
|
||||
B3_FORCE_INLINE b3Vector3 unQuantize(const unsigned short* vecIn) const
|
||||
{
|
||||
b3Vector3 vecOut;
|
||||
vecOut.setValue(
|
||||
@@ -448,13 +448,13 @@ public:
|
||||
}
|
||||
|
||||
|
||||
SIMD_FORCE_INLINE QuantizedNodeArray& getQuantizedNodeArray()
|
||||
B3_FORCE_INLINE QuantizedNodeArray& getQuantizedNodeArray()
|
||||
{
|
||||
return m_quantizedContiguousNodes;
|
||||
}
|
||||
|
||||
|
||||
SIMD_FORCE_INLINE BvhSubtreeInfoArray& getSubtreeInfoArray()
|
||||
B3_FORCE_INLINE BvhSubtreeInfoArray& getSubtreeInfoArray()
|
||||
{
|
||||
return m_SubtreeHeaders;
|
||||
}
|
||||
@@ -486,7 +486,7 @@ public:
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
SIMD_FORCE_INLINE bool isQuantized()
|
||||
B3_FORCE_INLINE bool isQuantized()
|
||||
{
|
||||
return m_useQuantization;
|
||||
}
|
||||
@@ -572,7 +572,7 @@ struct b3QuantizedBvhDoubleData
|
||||
};
|
||||
|
||||
|
||||
SIMD_FORCE_INLINE int b3QuantizedBvh::calculateSerializeBufferSizeNew() const
|
||||
B3_FORCE_INLINE int b3QuantizedBvh::calculateSerializeBufferSizeNew() const
|
||||
{
|
||||
return sizeof(b3QuantizedBvhData);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@ enum PHY_ScalarType {
|
||||
/// The b3StridingMeshInterface is the interface class for high performance generic access to triangle meshes, used in combination with b3BvhTriangleMeshShape and some other collision shapes.
|
||||
/// Using index striding of 3*sizeof(integer) it can use triangle arrays, using index striding of 1*sizeof(integer) it can handle triangle strips.
|
||||
/// It allows for sharing graphics and collision meshes. Also it provides locking/unlocking of graphics meshes that are in gpu memory.
|
||||
ATTRIBUTE_ALIGNED16(class ) b3StridingMeshInterface
|
||||
B3_ATTRIBUTE_ALIGNED16(class ) b3StridingMeshInterface
|
||||
{
|
||||
protected:
|
||||
|
||||
@@ -157,7 +157,7 @@ struct b3StridingMeshInterfaceData
|
||||
|
||||
|
||||
|
||||
SIMD_FORCE_INLINE int b3StridingMeshInterface::calculateSerializeBufferSize() const
|
||||
B3_FORCE_INLINE int b3StridingMeshInterface::calculateSerializeBufferSize() const
|
||||
{
|
||||
return sizeof(b3StridingMeshInterfaceData);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@ subject to the following restrictions:
|
||||
|
||||
///The b3IndexedMesh indexes a single vertex and index array. Multiple b3IndexedMesh objects can be passed into a b3TriangleIndexVertexArray using addIndexedMesh.
|
||||
///Instead of the number of indices, we pass the number of triangles.
|
||||
ATTRIBUTE_ALIGNED16( struct) b3IndexedMesh
|
||||
B3_ATTRIBUTE_ALIGNED16( struct) b3IndexedMesh
|
||||
{
|
||||
B3_DECLARE_ALIGNED_ALLOCATOR();
|
||||
|
||||
@@ -65,7 +65,7 @@ typedef b3AlignedObjectArray<b3IndexedMesh> IndexedMeshArray;
|
||||
///Additional meshes can be added using addIndexedMesh
|
||||
///No duplcate is made of the vertex/index data, it only indexes into external vertex/index arrays.
|
||||
///So keep those arrays around during the lifetime of this b3TriangleIndexVertexArray.
|
||||
ATTRIBUTE_ALIGNED16( class) b3TriangleIndexVertexArray : public b3StridingMeshInterface
|
||||
B3_ATTRIBUTE_ALIGNED16( class) b3TriangleIndexVertexArray : public b3StridingMeshInterface
|
||||
{
|
||||
protected:
|
||||
IndexedMeshArray m_indexedMeshes;
|
||||
|
||||
Reference in New Issue
Block a user