cleaned up, removed warning under MSVC2005 (Level 4)
Mostly related to alignment and unused variables
This commit is contained in:
@@ -23,6 +23,7 @@
|
||||
|
||||
btBroadphaseProxy* btAxisSweep3::createProxy( const btVector3& min, const btVector3& max,int shapeType,void* userPtr,short int collisionFilterGroup,short int collisionFilterMask)
|
||||
{
|
||||
(void)shapeType;
|
||||
BP_FP_INT_TYPE handleId = addHandle(min,max, userPtr,collisionFilterGroup,collisionFilterMask);
|
||||
|
||||
Handle* handle = getHandle(handleId);
|
||||
@@ -72,7 +73,7 @@ btAxisSweep3::btAxisSweep3(const btPoint3& worldAabbMin,const btPoint3& worldAab
|
||||
// handle 0 is reserved as the null index, and is also used as the sentinel
|
||||
m_firstFreeHandle = 1;
|
||||
{
|
||||
for (int i = m_firstFreeHandle; i < maxHandles; i++)
|
||||
for (BP_FP_INT_TYPE i = m_firstFreeHandle; i < maxHandles; i++)
|
||||
m_pHandles[i].SetNextFree(i + 1);
|
||||
m_pHandles[maxHandles - 1].SetNextFree(0);
|
||||
}
|
||||
@@ -169,10 +170,10 @@ BP_FP_INT_TYPE btAxisSweep3::addHandle(const btPoint3& aabbMin,const btPoint3& a
|
||||
pHandle->m_collisionFilterMask = collisionFilterMask;
|
||||
|
||||
// compute current limit of edge arrays
|
||||
int limit = m_numHandles * 2;
|
||||
BP_FP_INT_TYPE limit = m_numHandles * 2;
|
||||
|
||||
// insert new edges just inside the max boundary edge
|
||||
for (int axis = 0; axis < 3; axis++)
|
||||
for (BP_FP_INT_TYPE axis = 0; axis < 3; axis++)
|
||||
{
|
||||
m_pHandles[0].m_maxEdges[axis] += 2;
|
||||
|
||||
@@ -229,12 +230,12 @@ void btAxisSweep3::removeHandle(BP_FP_INT_TYPE handle)
|
||||
for ( axis = 0; axis < 3; axis++)
|
||||
{
|
||||
Edge* pEdges = m_pEdges[axis];
|
||||
int max = pHandle->m_maxEdges[axis];
|
||||
BP_FP_INT_TYPE max = pHandle->m_maxEdges[axis];
|
||||
pEdges[max].m_pos = BP_HANDLE_SENTINEL;
|
||||
|
||||
sortMaxUp(axis,max,false);
|
||||
|
||||
int i = pHandle->m_minEdges[axis];
|
||||
BP_FP_INT_TYPE i = pHandle->m_minEdges[axis];
|
||||
pEdges[i].m_pos = BP_HANDLE_SENTINEL;
|
||||
|
||||
sortMinUp(axis,i,false);
|
||||
|
||||
@@ -81,7 +81,7 @@ private:
|
||||
|
||||
btVector3 m_quantize; // scaling factor for quantization
|
||||
|
||||
int m_numHandles; // number of active handles
|
||||
BP_FP_INT_TYPE m_numHandles; // number of active handles
|
||||
int m_maxHandles; // max number of handles
|
||||
Handle* m_pHandles; // handles pool
|
||||
BP_FP_INT_TYPE m_firstFreeHandle; // free handles list
|
||||
|
||||
@@ -62,7 +62,7 @@ CONCAVE_SHAPES_END_HERE,
|
||||
|
||||
|
||||
///btBroadphaseProxy
|
||||
ATTRIBUTE_ALIGNED16(struct) btBroadphaseProxy
|
||||
struct btBroadphaseProxy
|
||||
{
|
||||
|
||||
///optional filtering to cull potential collisions
|
||||
|
||||
@@ -36,6 +36,7 @@ struct btCollisionAlgorithmConstructionInfo
|
||||
btCollisionAlgorithmConstructionInfo(btDispatcher* dispatcher,int temp)
|
||||
:m_dispatcher(dispatcher)
|
||||
{
|
||||
(void)temp;
|
||||
}
|
||||
|
||||
btDispatcher* m_dispatcher;
|
||||
|
||||
@@ -85,8 +85,8 @@ btBroadphaseProxy* btSimpleBroadphase::createProxy( const btVector3& min, cons
|
||||
|
||||
btSimpleBroadphaseProxy* proxy1 = &m_proxies[0];
|
||||
|
||||
int index = proxy - proxy1;
|
||||
assert(index == freeIndex);
|
||||
int index = int(proxy - proxy1);
|
||||
btAssert(index == freeIndex);
|
||||
|
||||
m_pProxies[m_numProxies] = proxy;
|
||||
m_numProxies++;
|
||||
@@ -100,7 +100,8 @@ class RemovingOverlapCallback : public btOverlapCallback
|
||||
protected:
|
||||
virtual bool processOverlap(btBroadphasePair& pair)
|
||||
{
|
||||
assert(0);
|
||||
(void)pair;
|
||||
btAssert(0);
|
||||
return false;
|
||||
}
|
||||
};
|
||||
@@ -131,8 +132,8 @@ void btSimpleBroadphase::destroyProxy(btBroadphaseProxy* proxyOrg)
|
||||
btSimpleBroadphaseProxy* proxy0 = static_cast<btSimpleBroadphaseProxy*>(proxyOrg);
|
||||
btSimpleBroadphaseProxy* proxy1 = &m_proxies[0];
|
||||
|
||||
int index = proxy0 - proxy1;
|
||||
assert (index < m_maxProxies);
|
||||
int index = int(proxy0 - proxy1);
|
||||
btAssert (index < m_maxProxies);
|
||||
m_freeProxies[--m_firstFreeProxy] = index;
|
||||
|
||||
removeOverlappingPairsContainingProxy(proxyOrg);
|
||||
|
||||
@@ -31,6 +31,7 @@ struct btSimpleBroadphaseProxy : public btBroadphaseProxy
|
||||
:btBroadphaseProxy(userPtr,collisionFilterGroup,collisionFilterMask),
|
||||
m_min(minpt),m_max(maxpt)
|
||||
{
|
||||
(void)shapeType;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -29,6 +29,7 @@ m_triangle(triangle)
|
||||
void SphereTriangleDetector::getClosestPoints(const ClosestPointInput& input,Result& output,class btIDebugDraw* debugDraw)
|
||||
{
|
||||
|
||||
(void)debugDraw;
|
||||
const btTransform& transformA = input.m_transformA;
|
||||
const btTransform& transformB = input.m_transformB;
|
||||
|
||||
@@ -149,11 +150,8 @@ bool SphereTriangleDetector::collide(const btVector3& sphereCenter,btVector3 &po
|
||||
btScalar distanceSqr = contactToCentre.length2();
|
||||
if (distanceSqr < (r - MAX_OVERLAP)*(r - MAX_OVERLAP)) {
|
||||
btScalar distance = btSqrt(distanceSqr);
|
||||
if (1)
|
||||
{
|
||||
resultNormal = contactToCentre;
|
||||
resultNormal.normalize();
|
||||
}
|
||||
resultNormal = contactToCentre;
|
||||
resultNormal.normalize();
|
||||
point = contactPoint;
|
||||
depth = -(r-distance);
|
||||
return true;
|
||||
|
||||
@@ -34,8 +34,11 @@ struct btCollisionAlgorithmCreateFunc
|
||||
}
|
||||
virtual ~btCollisionAlgorithmCreateFunc(){};
|
||||
|
||||
virtual btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
|
||||
virtual btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& , btCollisionObject* body0,btCollisionObject* body1)
|
||||
{
|
||||
|
||||
(void)body0;
|
||||
(void)body1;
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -42,6 +42,7 @@ m_compoundCreateFunc(0),
|
||||
m_swappedCompoundCreateFunc(0),
|
||||
m_emptyCreateFunc(0)
|
||||
{
|
||||
(void)noDefaultAlgorithms;
|
||||
int i;
|
||||
|
||||
setNearCallback(defaultNearCallback);
|
||||
@@ -294,6 +295,16 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
btCollisionPairCallback& operator=(btCollisionPairCallback& other)
|
||||
{
|
||||
m_dispatchInfo = other.m_dispatchInfo;
|
||||
m_dispatcher = other.m_dispatcher;
|
||||
return *this;
|
||||
}
|
||||
|
||||
virtual ~btCollisionPairCallback() {}
|
||||
|
||||
|
||||
virtual bool processOverlap(btBroadphasePair& pair)
|
||||
{
|
||||
(*m_dispatcher->getNearCallback())(pair,*m_dispatcher,m_dispatchInfo);
|
||||
|
||||
@@ -40,8 +40,6 @@ ATTRIBUTE_ALIGNED16(class) btCollisionObject
|
||||
protected:
|
||||
|
||||
btTransform m_worldTransform;
|
||||
btBroadphaseProxy* m_broadphaseHandle;
|
||||
btCollisionShape* m_collisionShape;
|
||||
|
||||
///m_interpolationWorldTransform is used for CCD and interpolation
|
||||
///it can be either previous or future (predicted) transform
|
||||
@@ -50,6 +48,8 @@ protected:
|
||||
//without destroying the continuous interpolated motion (which uses this interpolation velocities)
|
||||
btVector3 m_interpolationLinearVelocity;
|
||||
btVector3 m_interpolationAngularVelocity;
|
||||
btBroadphaseProxy* m_broadphaseHandle;
|
||||
btCollisionShape* m_collisionShape;
|
||||
|
||||
int m_collisionFlags;
|
||||
|
||||
@@ -76,6 +76,8 @@ protected:
|
||||
|
||||
/// Don't do continuous collision detection if square motion (in one step) is less then m_ccdSquareMotionThreshold
|
||||
btScalar m_ccdSquareMotionThreshold;
|
||||
|
||||
char m_pad[8];
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -142,10 +142,10 @@ public:
|
||||
{
|
||||
}
|
||||
|
||||
btCollisionObject* m_collisionObject;
|
||||
btCollisionObject* m_collisionObject;
|
||||
LocalShapeInfo* m_localShapeInfo;
|
||||
const btVector3& m_hitNormalLocal;
|
||||
btScalar m_hitFraction;
|
||||
btVector3 m_hitNormalLocal;
|
||||
btScalar m_hitFraction;
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -198,7 +198,8 @@ void btConvexConcaveCollisionAlgorithm::processCollision (btCollisionObject* bod
|
||||
|
||||
btScalar btConvexConcaveCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
|
||||
{
|
||||
|
||||
(void)resultOut;
|
||||
(void)dispatchInfo;
|
||||
btCollisionObject* convexbody = m_isSwapped ? body1 : body0;
|
||||
btCollisionObject* triBody = m_isSwapped ? body0 : body1;
|
||||
|
||||
@@ -242,6 +243,8 @@ btScalar btConvexConcaveCollisionAlgorithm::calculateTimeOfImpact(btCollisionObj
|
||||
|
||||
virtual void processTriangle(btVector3* triangle, int partId, int triangleIndex)
|
||||
{
|
||||
(void)partId;
|
||||
(void)triangleIndex;
|
||||
//do a swept sphere for now
|
||||
btTransform ident;
|
||||
ident.setIdentity();
|
||||
|
||||
@@ -77,6 +77,9 @@ m_ownManifold (false),
|
||||
m_manifoldPtr(mf),
|
||||
m_lowLevelOfDetail(false)
|
||||
{
|
||||
(void)body0;
|
||||
(void)body1;
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -156,6 +159,8 @@ void btConvexConvexAlgorithm ::processCollision (btCollisionObject* body0,btColl
|
||||
bool disableCcd = false;
|
||||
btScalar btConvexConvexAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
|
||||
{
|
||||
(void)resultOut;
|
||||
(void)dispatchInfo;
|
||||
///Rather then checking ALL pairs, only calculate TOI when motion exceeds threshold
|
||||
|
||||
///Linear motion for one of objects needs to exceed m_ccdSquareMotionThreshold
|
||||
|
||||
@@ -22,12 +22,11 @@ btEmptyAlgorithm::btEmptyAlgorithm(const btCollisionAlgorithmConstructionInfo& c
|
||||
{
|
||||
}
|
||||
|
||||
void btEmptyAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
|
||||
void btEmptyAlgorithm::processCollision (btCollisionObject* ,btCollisionObject* ,const btDispatcherInfo& ,btManifoldResult* )
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
btScalar btEmptyAlgorithm::calculateTimeOfImpact(btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
|
||||
btScalar btEmptyAlgorithm::calculateTimeOfImpact(btCollisionObject* ,btCollisionObject* ,const btDispatcherInfo& ,btManifoldResult* )
|
||||
{
|
||||
return btScalar(1.);
|
||||
}
|
||||
|
||||
@@ -37,6 +37,8 @@ public:
|
||||
{
|
||||
virtual btCollisionAlgorithm* CreateCollisionAlgorithm(btCollisionAlgorithmConstructionInfo& ci, btCollisionObject* body0,btCollisionObject* body1)
|
||||
{
|
||||
(void)body0;
|
||||
(void)body1;
|
||||
return new btEmptyAlgorithm(ci);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -140,7 +140,7 @@ void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher,
|
||||
|
||||
|
||||
|
||||
if (0)
|
||||
/*if (0)
|
||||
{
|
||||
int maxNumManifolds = dispatcher->getNumManifolds();
|
||||
btCollisionDispatcher* colDis = (btCollisionDispatcher*)dispatcher;
|
||||
@@ -148,6 +148,8 @@ void btSimulationIslandManager::buildAndProcessIslands(btDispatcher* dispatcher,
|
||||
callback->ProcessIsland(&collisionObjects[0],collisionObjects.size(),manifold,maxNumManifolds, 0);
|
||||
return;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
BEGIN_PROFILE("islandUnionFindAndHeapSort");
|
||||
|
||||
|
||||
@@ -50,6 +50,8 @@ btSphereBoxCollisionAlgorithm::~btSphereBoxCollisionAlgorithm()
|
||||
|
||||
void btSphereBoxCollisionAlgorithm::processCollision (btCollisionObject* body0,btCollisionObject* body1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
|
||||
{
|
||||
(void)dispatchInfo;
|
||||
(void)resultOut;
|
||||
if (!m_manifoldPtr)
|
||||
return;
|
||||
|
||||
@@ -83,6 +85,11 @@ void btSphereBoxCollisionAlgorithm::processCollision (btCollisionObject* body0,b
|
||||
|
||||
btScalar btSphereBoxCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
|
||||
{
|
||||
(void)resultOut;
|
||||
(void)dispatchInfo;
|
||||
(void)col0;
|
||||
(void)col1;
|
||||
|
||||
//not yet
|
||||
return btScalar(1.);
|
||||
}
|
||||
|
||||
@@ -41,6 +41,8 @@ btSphereSphereCollisionAlgorithm::~btSphereSphereCollisionAlgorithm()
|
||||
|
||||
void btSphereSphereCollisionAlgorithm::processCollision (btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
|
||||
{
|
||||
(void)dispatchInfo;
|
||||
|
||||
if (!m_manifoldPtr)
|
||||
return;
|
||||
|
||||
@@ -73,6 +75,11 @@ void btSphereSphereCollisionAlgorithm::processCollision (btCollisionObject* col0
|
||||
|
||||
btScalar btSphereSphereCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
|
||||
{
|
||||
(void)col0;
|
||||
(void)col1;
|
||||
(void)dispatchInfo;
|
||||
(void)resultOut;
|
||||
|
||||
//not yet
|
||||
return btScalar(1.);
|
||||
}
|
||||
|
||||
@@ -66,6 +66,11 @@ void btSphereTriangleCollisionAlgorithm::processCollision (btCollisionObject* co
|
||||
|
||||
btScalar btSphereTriangleCollisionAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btCollisionObject* col1,const btDispatcherInfo& dispatchInfo,btManifoldResult* resultOut)
|
||||
{
|
||||
(void)resultOut;
|
||||
(void)dispatchInfo;
|
||||
(void)col0;
|
||||
(void)col1;
|
||||
|
||||
//not yet
|
||||
return btScalar(1.);
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ ATTRIBUTE_ALIGNED16(class) btBvhTriangleMeshShape : public btTriangleMeshShape
|
||||
|
||||
btOptimizedBvh* m_bvh;
|
||||
bool m_useQuantizedAabbCompression;
|
||||
bool m_pad[12];////need padding due to alignment
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@@ -19,7 +19,7 @@ subject to the following restrictions:
|
||||
#include "BulletCollision/CollisionShapes/btCollisionMargin.h"
|
||||
#include "LinearMath/btQuaternion.h"
|
||||
|
||||
btCapsuleShape::btCapsuleShape(float radius, float height)
|
||||
btCapsuleShape::btCapsuleShape(btScalar radius, btScalar height)
|
||||
{
|
||||
m_implicitShapeDimensions.setValue(radius,0.5f*height,radius);
|
||||
}
|
||||
@@ -46,7 +46,7 @@ btCapsuleShape::btCapsuleShape(float radius, float height)
|
||||
btVector3 vtx;
|
||||
btScalar newDot;
|
||||
|
||||
float radius = getRadius();
|
||||
btScalar radius = getRadius();
|
||||
|
||||
|
||||
{
|
||||
@@ -78,7 +78,7 @@ btCapsuleShape::btCapsuleShape(float radius, float height)
|
||||
{
|
||||
|
||||
|
||||
float radius = getRadius();
|
||||
btScalar radius = getRadius();
|
||||
|
||||
for (int j=0;j<numVectors;j++)
|
||||
{
|
||||
@@ -120,7 +120,7 @@ void btCapsuleShape::calculateLocalInertia(btScalar mass,btVector3& inertia)
|
||||
ident.setIdentity();
|
||||
|
||||
|
||||
float radius = getRadius();
|
||||
btScalar radius = getRadius();
|
||||
|
||||
btVector3 halfExtents(radius,radius+getHalfHeight(),radius);
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ class btCapsuleShape : public btConvexShape
|
||||
{
|
||||
|
||||
public:
|
||||
btCapsuleShape(float radius,float height);
|
||||
btCapsuleShape(btScalar radius,btScalar height);
|
||||
|
||||
///CollisionShape Interface
|
||||
virtual void calculateLocalInertia(btScalar mass,btVector3& inertia);
|
||||
@@ -43,12 +43,12 @@ public:
|
||||
return "CapsuleShape";
|
||||
}
|
||||
|
||||
float getRadius() const
|
||||
btScalar getRadius() const
|
||||
{
|
||||
return m_implicitShapeDimensions.getX();
|
||||
}
|
||||
|
||||
float getHalfHeight() const
|
||||
btScalar getHalfHeight() const
|
||||
{
|
||||
return m_implicitShapeDimensions.getY();
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ class btCollisionShape
|
||||
{
|
||||
public:
|
||||
|
||||
btCollisionShape() :m_tempDebug(0)
|
||||
btCollisionShape()
|
||||
{
|
||||
}
|
||||
virtual ~btCollisionShape()
|
||||
@@ -83,10 +83,7 @@ public:
|
||||
virtual char* getName()const =0 ;
|
||||
#endif //__SPU__
|
||||
|
||||
const char* getExtraDebugInfo() const { return m_tempDebug;}
|
||||
void setExtraDebugInfo(const char* extraDebugInfo) { m_tempDebug = extraDebugInfo;}
|
||||
const char * m_tempDebug;
|
||||
//endif debugging support
|
||||
|
||||
|
||||
virtual void setMargin(btScalar margin) = 0;
|
||||
virtual btScalar getMargin() const = 0;
|
||||
|
||||
@@ -155,13 +155,14 @@ int btConvexHullShape::getNumPlanes() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
void btConvexHullShape::getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const
|
||||
void btConvexHullShape::getPlane(btVector3& ,btPoint3& ,int ) const
|
||||
{
|
||||
assert(0);
|
||||
|
||||
btAssert(0);
|
||||
}
|
||||
|
||||
//not yet
|
||||
bool btConvexHullShape::isInside(const btPoint3& pt,btScalar tolerance) const
|
||||
bool btConvexHullShape::isInside(const btPoint3& ,btScalar ) const
|
||||
{
|
||||
assert(0);
|
||||
return false;
|
||||
|
||||
@@ -42,6 +42,10 @@ protected:
|
||||
|
||||
btScalar m_collisionMargin;
|
||||
|
||||
btScalar m_padding[2];
|
||||
|
||||
|
||||
|
||||
|
||||
public:
|
||||
btConvexShape();
|
||||
@@ -108,7 +112,9 @@ public:
|
||||
|
||||
virtual void getPreferredPenetrationDirection(int index, btVector3& penetrationVector) const
|
||||
{
|
||||
assert(0);
|
||||
(void)penetrationVector;
|
||||
(void)index;
|
||||
btAssert(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -48,6 +48,9 @@ public:
|
||||
|
||||
virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex)
|
||||
{
|
||||
(void)triangleIndex;
|
||||
(void)partId;
|
||||
|
||||
for (int i=0;i<3;i++)
|
||||
{
|
||||
btScalar dot = m_supportVecLocal.dot(triangle[i]);
|
||||
@@ -158,14 +161,14 @@ int btConvexTriangleMeshShape::getNumEdges() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
void btConvexTriangleMeshShape::getEdge(int i,btPoint3& pa,btPoint3& pb) const
|
||||
void btConvexTriangleMeshShape::getEdge(int ,btPoint3& ,btPoint3& ) const
|
||||
{
|
||||
assert(0);
|
||||
btAssert(0);
|
||||
}
|
||||
|
||||
void btConvexTriangleMeshShape::getVertex(int i,btPoint3& vtx) const
|
||||
void btConvexTriangleMeshShape::getVertex(int ,btPoint3& ) const
|
||||
{
|
||||
assert(0);
|
||||
btAssert(0);
|
||||
}
|
||||
|
||||
int btConvexTriangleMeshShape::getNumPlanes() const
|
||||
@@ -173,15 +176,15 @@ int btConvexTriangleMeshShape::getNumPlanes() const
|
||||
return 0;
|
||||
}
|
||||
|
||||
void btConvexTriangleMeshShape::getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i ) const
|
||||
void btConvexTriangleMeshShape::getPlane(btVector3& ,btPoint3& ,int ) const
|
||||
{
|
||||
assert(0);
|
||||
btAssert(0);
|
||||
}
|
||||
|
||||
//not yet
|
||||
bool btConvexTriangleMeshShape::isInside(const btPoint3& pt,btScalar tolerance) const
|
||||
bool btConvexTriangleMeshShape::isInside(const btPoint3& ,btScalar ) const
|
||||
{
|
||||
assert(0);
|
||||
btAssert(0);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,9 +40,9 @@ void btEmptyShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aa
|
||||
|
||||
}
|
||||
|
||||
void btEmptyShape::calculateLocalInertia(btScalar mass,btVector3& inertia)
|
||||
void btEmptyShape::calculateLocalInertia(btScalar ,btVector3& )
|
||||
{
|
||||
assert(0);
|
||||
btAssert(0);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -30,11 +30,10 @@ btHeightfieldTerrainShape::~btHeightfieldTerrainShape()
|
||||
|
||||
|
||||
|
||||
void btHeightfieldTerrainShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
|
||||
void btHeightfieldTerrainShape::getAabb(const btTransform& ,btVector3& aabbMin,btVector3& aabbMax) const
|
||||
{
|
||||
aabbMin.setValue(btScalar(-1e30),btScalar(-1e30),btScalar(-1e30));
|
||||
aabbMax.setValue(btScalar(1e30),btScalar(1e30),btScalar(1e30));
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -42,13 +41,17 @@ void btHeightfieldTerrainShape::getAabb(const btTransform& t,btVector3& aabbMin,
|
||||
|
||||
void btHeightfieldTerrainShape::processAllTriangles(btTriangleCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const
|
||||
{
|
||||
(void)callback;
|
||||
(void)aabbMax;
|
||||
(void)aabbMin;
|
||||
|
||||
/*
|
||||
btVector3 halfExtents = (aabbMax - aabbMin) * btScalar(0.5);
|
||||
btVector3 center = (aabbMax + aabbMin) * btScalar(0.5);
|
||||
|
||||
//TODO
|
||||
//this is where the triangles are generated, given AABB and plane equation (normal/constant)
|
||||
/*
|
||||
|
||||
btVector3 tangentDir0,tangentDir1;
|
||||
|
||||
//tangentDir0/tangentDir1 can be precalculated
|
||||
@@ -75,7 +78,7 @@ void btHeightfieldTerrainShape::processAllTriangles(btTriangleCallback* callback
|
||||
|
||||
}
|
||||
|
||||
void btHeightfieldTerrainShape::calculateLocalInertia(btScalar mass,btVector3& inertia)
|
||||
void btHeightfieldTerrainShape::calculateLocalInertia(btScalar ,btVector3& inertia)
|
||||
{
|
||||
//moving concave objects not supported
|
||||
|
||||
|
||||
@@ -51,6 +51,7 @@ btScalar btMinkowskiSumShape::getMargin() const
|
||||
|
||||
void btMinkowskiSumShape::calculateLocalInertia(btScalar mass,btVector3& inertia)
|
||||
{
|
||||
assert(0);
|
||||
(void)mass;
|
||||
btAssert(0);
|
||||
inertia.setValue(0,0,0);
|
||||
}
|
||||
|
||||
@@ -38,8 +38,15 @@ void btOptimizedBvh::build(btStridingMeshInterface* triangles, bool useQuantized
|
||||
|
||||
struct NodeTriangleCallback : public btInternalTriangleIndexCallback
|
||||
{
|
||||
|
||||
NodeArray& m_triangleNodes;
|
||||
|
||||
NodeTriangleCallback& operator=(NodeTriangleCallback& other)
|
||||
{
|
||||
m_triangleNodes = other.m_triangleNodes;
|
||||
return *this;
|
||||
}
|
||||
|
||||
NodeTriangleCallback(NodeArray& triangleNodes)
|
||||
:m_triangleNodes(triangleNodes)
|
||||
{
|
||||
@@ -75,6 +82,13 @@ void btOptimizedBvh::build(btStridingMeshInterface* triangles, bool useQuantized
|
||||
QuantizedNodeArray& m_triangleNodes;
|
||||
const btOptimizedBvh* m_optimizedTree; // for quantization
|
||||
|
||||
QuantizedNodeTriangleCallback& operator=(QuantizedNodeTriangleCallback& other)
|
||||
{
|
||||
m_triangleNodes = other.m_triangleNodes;
|
||||
m_optimizedTree = other.m_optimizedTree;
|
||||
return *this;
|
||||
}
|
||||
|
||||
QuantizedNodeTriangleCallback(QuantizedNodeArray& triangleNodes,const btOptimizedBvh* tree)
|
||||
:m_triangleNodes(triangleNodes),m_optimizedTree(tree)
|
||||
{
|
||||
@@ -190,7 +204,7 @@ void btOptimizedBvh::refitPartial(btStridingMeshInterface* meshInterface,const b
|
||||
bool overlap = testQuantizedAabbAgainstQuantizedAabb(quantizedQueryAabbMin,quantizedQueryAabbMax,subtree.m_quantizedAabbMin,subtree.m_quantizedAabbMax);
|
||||
if (overlap)
|
||||
{
|
||||
updateBvhNodes(meshInterface,subtree.m_rootNodeIndex,subtree.m_rootNodeIndex+subtree.m_subtreeSize);
|
||||
updateBvhNodes(meshInterface,subtree.m_rootNodeIndex,subtree.m_rootNodeIndex+subtree.m_subtreeSize,i);
|
||||
|
||||
subtree.setAabbFromQuantizeNode(m_quantizedContiguousNodes[subtree.m_rootNodeIndex]);
|
||||
}
|
||||
@@ -198,9 +212,22 @@ void btOptimizedBvh::refitPartial(btStridingMeshInterface* meshInterface,const b
|
||||
|
||||
}
|
||||
|
||||
|
||||
void btOptimizedBvh::updateBvhNodes(btStridingMeshInterface* meshInterface,int firstNode,int endNode)
|
||||
///just for debugging, to visualize the individual patches/subtrees
|
||||
#ifdef DEBUG_PATCH_COLORS
|
||||
btVector3 color[4]=
|
||||
{
|
||||
btVector3(255,0,0),
|
||||
btVector3(0,255,0),
|
||||
btVector3(0,0,255),
|
||||
btVector3(0,255,255)
|
||||
};
|
||||
#endif //DEBUG_PATCH_COLORS
|
||||
|
||||
|
||||
void btOptimizedBvh::updateBvhNodes(btStridingMeshInterface* meshInterface,int firstNode,int endNode,int index)
|
||||
{
|
||||
(void)index;
|
||||
|
||||
btAssert(m_useQuantization);
|
||||
|
||||
int nodeSubPart=0;
|
||||
@@ -240,6 +267,13 @@ void btOptimizedBvh::updateBvhNodes(btStridingMeshInterface* meshInterface,int f
|
||||
|
||||
int graphicsindex = gfxbase[j];
|
||||
btScalar* graphicsbase = (btScalar*)(vertexbase+graphicsindex*stride);
|
||||
#ifdef DEBUG_PATCH_COLORS
|
||||
btVector3 mycolor = color[index&3];
|
||||
graphicsbase[8] = mycolor.getX();
|
||||
graphicsbase[9] = mycolor.getY();
|
||||
graphicsbase[10] = mycolor.getZ();
|
||||
#endif //DEBUG_PATCH_COLORS
|
||||
|
||||
|
||||
triangleVerts[j] = btVector3(
|
||||
graphicsbase[0]*meshScaling.getX(),
|
||||
@@ -311,7 +345,7 @@ void btOptimizedBvh::refit(btStridingMeshInterface* meshInterface)
|
||||
|
||||
setQuantizationValues(aabbMin,aabbMax);
|
||||
|
||||
updateBvhNodes(meshInterface,0,m_curNodeIndex);
|
||||
updateBvhNodes(meshInterface,0,m_curNodeIndex,0);
|
||||
|
||||
///now update all subtree headers
|
||||
|
||||
@@ -747,6 +781,9 @@ void btOptimizedBvh::walkStacklessQuantizedTreeCacheFriendly(btNodeOverlapCallba
|
||||
|
||||
void btOptimizedBvh::reportSphereOverlappingNodex(btNodeOverlapCallback* nodeCallback,const btVector3& aabbMin,const btVector3& aabbMax) const
|
||||
{
|
||||
(void)nodeCallback;
|
||||
(void)aabbMin;
|
||||
(void)aabbMax;
|
||||
//not yet, please use aabb
|
||||
btAssert(0);
|
||||
}
|
||||
|
||||
@@ -74,6 +74,8 @@ ATTRIBUTE_ALIGNED16 (struct) btOptimizedBvhNode
|
||||
//for child nodes
|
||||
int m_subPart;
|
||||
int m_triangleIndex;
|
||||
int m_padding[5];//bad, due to alignment
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -89,6 +91,8 @@ public:
|
||||
int m_rootNodeIndex;
|
||||
//4 bytes
|
||||
int m_subtreeSize;
|
||||
int m_padding[3];
|
||||
|
||||
|
||||
void setAabbFromQuantizeNode(const btQuantizedBvhNode& quantizedNode)
|
||||
{
|
||||
@@ -305,7 +309,7 @@ public:
|
||||
|
||||
void refitPartial(btStridingMeshInterface* triangles,const btVector3& aabbMin, const btVector3& aabbMax);
|
||||
|
||||
void updateBvhNodes(btStridingMeshInterface* meshInterface,int firstNode,int endNode);
|
||||
void updateBvhNodes(btStridingMeshInterface* meshInterface,int firstNode,int endNode,int index);
|
||||
|
||||
|
||||
QuantizedNodeArray& getQuantizedNodeArray()
|
||||
|
||||
@@ -26,11 +26,14 @@ btSphereShape ::btSphereShape (btScalar radius)
|
||||
|
||||
btVector3 btSphereShape::localGetSupportingVertexWithoutMargin(const btVector3& vec)const
|
||||
{
|
||||
(void)vec;
|
||||
return btVector3(btScalar(0.),btScalar(0.),btScalar(0.));
|
||||
}
|
||||
|
||||
void btSphereShape::batchedUnitVectorGetSupportingVertexWithoutMargin(const btVector3* vectors,btVector3* supportVerticesOut,int numVectors) const
|
||||
{
|
||||
(void)vectors;
|
||||
|
||||
for (int i=0;i<numVectors;i++)
|
||||
{
|
||||
supportVerticesOut[i].setValue(btScalar(0.),btScalar(0.),btScalar(0.));
|
||||
|
||||
@@ -34,6 +34,8 @@ btStaticPlaneShape::~btStaticPlaneShape()
|
||||
|
||||
void btStaticPlaneShape::getAabb(const btTransform& t,btVector3& aabbMin,btVector3& aabbMax) const
|
||||
{
|
||||
(void)t;
|
||||
/*
|
||||
btVector3 infvec (btScalar(1e30),btScalar(1e30),btScalar(1e30));
|
||||
|
||||
btVector3 center = m_planeNormal*m_planeConstant;
|
||||
@@ -41,6 +43,7 @@ void btStaticPlaneShape::getAabb(const btTransform& t,btVector3& aabbMin,btVecto
|
||||
aabbMax = aabbMin;
|
||||
aabbMin.setMin(center - infvec*m_planeNormal);
|
||||
aabbMax.setMax(center - infvec*m_planeNormal);
|
||||
*/
|
||||
|
||||
aabbMin.setValue(btScalar(-1e30),btScalar(-1e30),btScalar(-1e30));
|
||||
aabbMax.setValue(btScalar(1e30),btScalar(1e30),btScalar(1e30));
|
||||
@@ -85,6 +88,8 @@ void btStaticPlaneShape::processAllTriangles(btTriangleCallback* callback,const
|
||||
|
||||
void btStaticPlaneShape::calculateLocalInertia(btScalar mass,btVector3& inertia)
|
||||
{
|
||||
(void)mass;
|
||||
|
||||
//moving concave objects not supported
|
||||
|
||||
inertia.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
|
||||
|
||||
@@ -23,6 +23,8 @@ btStridingMeshInterface::~btStridingMeshInterface()
|
||||
|
||||
void btStridingMeshInterface::InternalProcessAllTriangles(btInternalTriangleIndexCallback* callback,const btVector3& aabbMin,const btVector3& aabbMax) const
|
||||
{
|
||||
(void)aabbMin;
|
||||
(void)aabbMax;
|
||||
int numtotalphysicsverts = 0;
|
||||
int part,graphicssubparts = getNumSubParts();
|
||||
const unsigned char * vertexbase;
|
||||
@@ -99,6 +101,9 @@ void btStridingMeshInterface::calculateAabbBruteForce(btVector3& aabbMin,btVecto
|
||||
|
||||
virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex)
|
||||
{
|
||||
(void)partId;
|
||||
(void)triangleIndex;
|
||||
|
||||
m_aabbMin.setMin(triangle[0]);
|
||||
m_aabbMax.setMax(triangle[0]);
|
||||
m_aabbMin.setMin(triangle[1]);
|
||||
|
||||
@@ -178,17 +178,17 @@ int btBU_Simplex1to4::getNumPlanes() const
|
||||
}
|
||||
|
||||
|
||||
void btBU_Simplex1to4::getPlane(btVector3& planeNormal,btPoint3& planeSupport,int i) const
|
||||
void btBU_Simplex1to4::getPlane(btVector3&, btPoint3& ,int ) const
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
int btBU_Simplex1to4::getIndex(int i) const
|
||||
int btBU_Simplex1to4::getIndex(int ) const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool btBU_Simplex1to4::isInside(const btPoint3& pt,btScalar tolerance) const
|
||||
bool btBU_Simplex1to4::isInside(const btPoint3& ,btScalar ) const
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ ATTRIBUTE_ALIGNED16( struct) btIndexedMesh
|
||||
int m_numVertices;
|
||||
const unsigned char * m_vertexBase;
|
||||
int m_vertexStride;
|
||||
int pad[2];
|
||||
}
|
||||
;
|
||||
|
||||
@@ -43,6 +44,7 @@ typedef btAlignedObjectArray<btIndexedMesh> IndexedMeshArray;
|
||||
ATTRIBUTE_ALIGNED16( class) btTriangleIndexVertexArray : public btStridingMeshInterface
|
||||
{
|
||||
IndexedMeshArray m_indexedMeshes;
|
||||
int m_pad[3];
|
||||
|
||||
|
||||
public:
|
||||
@@ -66,9 +68,9 @@ public:
|
||||
|
||||
/// unLockVertexBase finishes the access to a subpart of the triangle mesh
|
||||
/// make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished
|
||||
virtual void unLockVertexBase(int subpart) {}
|
||||
virtual void unLockVertexBase(int subpart) {(void)subpart;}
|
||||
|
||||
virtual void unLockReadOnlyVertexBase(int subpart) const {}
|
||||
virtual void unLockReadOnlyVertexBase(int subpart) const {(void)subpart;}
|
||||
|
||||
/// getNumSubParts returns the number of seperate subparts
|
||||
/// each subpart has a continuous array of vertices and indices
|
||||
@@ -86,8 +88,8 @@ public:
|
||||
return m_indexedMeshes;
|
||||
}
|
||||
|
||||
virtual void preallocateVertices(int numverts){}
|
||||
virtual void preallocateIndices(int numindices){}
|
||||
virtual void preallocateVertices(int numverts){(void) numverts;}
|
||||
virtual void preallocateIndices(int numindices){(void) numindices;}
|
||||
|
||||
}
|
||||
;
|
||||
|
||||
@@ -24,6 +24,7 @@ btTriangleMesh::btTriangleMesh ()
|
||||
|
||||
void btTriangleMesh::getLockedVertexIndexBase(unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart)
|
||||
{
|
||||
(void)subpart;
|
||||
numverts = m_vertices.size();
|
||||
*vertexbase = (unsigned char*)&m_vertices[0];
|
||||
type = PHY_FLOAT;
|
||||
@@ -38,6 +39,7 @@ void btTriangleMesh::getLockedVertexIndexBase(unsigned char **vertexbase, int& n
|
||||
|
||||
void btTriangleMesh::getLockedReadOnlyVertexIndexBase(const unsigned char **vertexbase, int& numverts,PHY_ScalarType& type, int& stride,const unsigned char **indexbase,int & indexstride,int& numfaces,PHY_ScalarType& indicestype,int subpart) const
|
||||
{
|
||||
(void)subpart;
|
||||
numverts = m_vertices.size();
|
||||
*vertexbase = (unsigned char*)&m_vertices[0];
|
||||
type = PHY_FLOAT;
|
||||
|
||||
@@ -57,16 +57,16 @@ class btTriangleMesh : public btStridingMeshInterface
|
||||
|
||||
/// unLockVertexBase finishes the access to a subpart of the triangle mesh
|
||||
/// make a call to unLockVertexBase when the read and write access (using getLockedVertexIndexBase) is finished
|
||||
virtual void unLockVertexBase(int subpart) {}
|
||||
virtual void unLockVertexBase(int subpart) {(void) subpart;}
|
||||
|
||||
virtual void unLockReadOnlyVertexBase(int subpart) const {}
|
||||
virtual void unLockReadOnlyVertexBase(int subpart) const { (void) subpart;}
|
||||
|
||||
/// getNumSubParts returns the number of seperate subparts
|
||||
/// each subpart has a continuous array of vertices and indices
|
||||
virtual int getNumSubParts() const;
|
||||
|
||||
virtual void preallocateVertices(int numverts){}
|
||||
virtual void preallocateIndices(int numindices){}
|
||||
virtual void preallocateVertices(int numverts){(void) numverts;}
|
||||
virtual void preallocateIndices(int numindices){(void) numindices;}
|
||||
|
||||
|
||||
};
|
||||
|
||||
@@ -93,6 +93,8 @@ public:
|
||||
|
||||
virtual void processTriangle( btVector3* triangle,int partId, int triangleIndex)
|
||||
{
|
||||
(void)partId;
|
||||
(void)triangleIndex;
|
||||
for (int i=0;i<3;i++)
|
||||
{
|
||||
btScalar dot = m_supportVecLocal.dot(triangle[i]);
|
||||
@@ -176,8 +178,9 @@ void btTriangleMeshShape::processAllTriangles(btTriangleCallback* callback,const
|
||||
|
||||
void btTriangleMeshShape::calculateLocalInertia(btScalar mass,btVector3& inertia)
|
||||
{
|
||||
(void)mass;
|
||||
//moving concave objects not supported
|
||||
assert(0);
|
||||
btAssert(0);
|
||||
inertia.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
|
||||
}
|
||||
|
||||
|
||||
@@ -24,9 +24,9 @@ subject to the following restrictions:
|
||||
class btTriangleMeshShape : public btConcaveShape
|
||||
{
|
||||
protected:
|
||||
btStridingMeshInterface* m_meshInterface;
|
||||
btVector3 m_localAabbMin;
|
||||
btVector3 m_localAabbMax;
|
||||
btStridingMeshInterface* m_meshInterface;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@@ -111,12 +111,14 @@ public:
|
||||
|
||||
virtual void getPlaneEquation(int i, btVector3& planeNormal,btPoint3& planeSupport) const
|
||||
{
|
||||
(void)i;
|
||||
calcNormal(planeNormal);
|
||||
planeSupport = m_vertices1[0];
|
||||
}
|
||||
|
||||
virtual void calculateLocalInertia(btScalar mass,btVector3& inertia)
|
||||
{
|
||||
(void)mass;
|
||||
btAssert(0);
|
||||
inertia.setValue(btScalar(0.),btScalar(0.),btScalar(0.));
|
||||
}
|
||||
|
||||
@@ -37,8 +37,8 @@ public:
|
||||
{
|
||||
//virtual bool addRayResult(const btVector3& normal,btScalar fraction) = 0;
|
||||
|
||||
virtual void DebugDraw(btScalar fraction) {}
|
||||
virtual void drawCoordSystem(const btTransform& trans) {}
|
||||
virtual void DebugDraw(btScalar fraction) {(void)fraction;}
|
||||
virtual void drawCoordSystem(const btTransform& trans) {(void)trans;}
|
||||
|
||||
CastResult()
|
||||
:m_fraction(btScalar(1e30)),
|
||||
|
||||
@@ -30,7 +30,6 @@ struct btDiscreteCollisionDetectorInterface
|
||||
|
||||
struct Result
|
||||
{
|
||||
void operator delete(void* ptr) {};
|
||||
|
||||
virtual ~Result(){}
|
||||
|
||||
|
||||
@@ -26,6 +26,9 @@ bool btGjkEpaPenetrationDepthSolver::calcPenDepth( btSimplexSolverInterface& sim
|
||||
class btIDebugDraw* debugDraw, btStackAlloc* stackAlloc )
|
||||
{
|
||||
|
||||
(void)debugDraw;
|
||||
(void)v;
|
||||
(void)simplexSolver;
|
||||
|
||||
const btScalar radialmargin(btScalar(0.));
|
||||
|
||||
|
||||
@@ -91,7 +91,8 @@ void btGjkPairDetector::getClosestPoints(const ClosestPointInput& input,Result&
|
||||
|
||||
m_simplexSolver->reset();
|
||||
|
||||
while (true)
|
||||
for ( ; ; )
|
||||
//while (true)
|
||||
{
|
||||
|
||||
btVector3 seperatingAxisInA = (-m_cachedSeparatingAxis)* input.m_transformA.getBasis();
|
||||
|
||||
@@ -78,6 +78,9 @@ bool btMinkowskiPenetrationDepthSolver::calcPenDepth(btSimplexSolverInterface& s
|
||||
)
|
||||
{
|
||||
|
||||
(void)stackAlloc;
|
||||
(void)v;
|
||||
|
||||
|
||||
struct btIntermediateResult : public btDiscreteCollisionDetectorInterface::Result
|
||||
{
|
||||
@@ -93,6 +96,10 @@ bool btMinkowskiPenetrationDepthSolver::calcPenDepth(btSimplexSolverInterface& s
|
||||
|
||||
virtual void setShapeIdentifiers(int partId0,int index0, int partId1,int index1)
|
||||
{
|
||||
(void)partId0;
|
||||
(void)index0;
|
||||
(void)partId1;
|
||||
(void)index1;
|
||||
}
|
||||
void addContactPoint(const btVector3& normalOnBInWorld,const btVector3& pointInWorld,btScalar depth)
|
||||
{
|
||||
|
||||
@@ -37,6 +37,10 @@ struct btPointCollector : public btDiscreteCollisionDetectorInterface::Result
|
||||
|
||||
virtual void setShapeIdentifiers(int partId0,int index0, int partId1,int index1)
|
||||
{
|
||||
(void)partId0;
|
||||
(void)index0;
|
||||
(void)partId1;
|
||||
(void)index1;
|
||||
//??
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user