cleaned up, removed warning under MSVC2005 (Level 4)
Mostly related to alignment and unused variables
This commit is contained in:
@@ -227,6 +227,9 @@ void DemoApplication::reshape(int w, int h)
|
||||
|
||||
void DemoApplication::keyboardCallback(unsigned char key, int x, int y)
|
||||
{
|
||||
(void)x;
|
||||
(void)y;
|
||||
|
||||
m_lastKey = 0;
|
||||
|
||||
switch (key)
|
||||
@@ -367,6 +370,9 @@ void DemoApplication::keyboardCallback(unsigned char key, int x, int y)
|
||||
|
||||
void DemoApplication::specialKeyboard(int key, int x, int y)
|
||||
{
|
||||
(void)x;
|
||||
(void)y;
|
||||
|
||||
switch (key)
|
||||
{
|
||||
case GLUT_KEY_F1:
|
||||
|
||||
@@ -211,6 +211,10 @@ public:
|
||||
virtual void processTriangle(btVector3* triangle,int partId, int triangleIndex)
|
||||
{
|
||||
|
||||
(void)triangleIndex;
|
||||
(void)partId;
|
||||
|
||||
|
||||
if (m_wireframe)
|
||||
{
|
||||
glBegin(GL_LINES);
|
||||
@@ -243,6 +247,10 @@ class TriangleGlDrawcallback : public btInternalTriangleIndexCallback
|
||||
public:
|
||||
virtual void internalProcessTriangleIndex(btVector3* triangle,int partId,int triangleIndex)
|
||||
{
|
||||
(void)triangleIndex;
|
||||
(void)partId;
|
||||
|
||||
|
||||
glBegin(GL_TRIANGLES);//LINES);
|
||||
glColor3f(1, 0, 0);
|
||||
glVertex3d(triangle[0].getX(), triangle[0].getY(), triangle[0].getZ());
|
||||
@@ -453,7 +461,7 @@ void GL_ShapeDrawer::drawOpenGL(btScalar* m, const btCollisionShape* shape, cons
|
||||
if (debugMode==btIDebugDraw::DBG_DrawFeaturesText)
|
||||
{
|
||||
glRasterPos3f(0.0, 0.0, 0.0);
|
||||
BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),polyshape->getExtraDebugInfo());
|
||||
//BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),polyshape->getExtraDebugInfo());
|
||||
|
||||
glColor3f(1.f, 1.f, 1.f);
|
||||
for (i=0;i<polyshape->getNumVertices();i++)
|
||||
@@ -544,7 +552,7 @@ void GL_ShapeDrawer::drawOpenGL(btScalar* m, const btCollisionShape* shape, cons
|
||||
|
||||
if (debugMode& btIDebugDraw::DBG_DrawFeaturesText)
|
||||
{
|
||||
BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),shape->getExtraDebugInfo());
|
||||
//BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),shape->getExtraDebugInfo());
|
||||
}
|
||||
glEnable(GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -77,6 +77,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:
|
||||
|
||||
enum CollisionFlags
|
||||
|
||||
@@ -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;
|
||||
//??
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,10 @@ void resolveSingleBilateral(btRigidBody& body1, const btVector3& pos1,
|
||||
btRigidBody& body2, const btVector3& pos2,
|
||||
btScalar distance, const btVector3& normal,btScalar& impulse ,btScalar timeStep)
|
||||
{
|
||||
(void)timeStep;
|
||||
(void)distance;
|
||||
|
||||
|
||||
btScalar normalLenSqr = normal.length2();
|
||||
ASSERT2(btFabs(normalLenSqr) < btScalar(1.1));
|
||||
if (normalLenSqr > btScalar(1.1))
|
||||
@@ -153,6 +157,8 @@ btScalar resolveSingleFriction(
|
||||
const btContactSolverInfo& solverInfo)
|
||||
{
|
||||
|
||||
(void)solverInfo;
|
||||
|
||||
const btVector3& pos1 = contactPoint.getPositionWorldOnA();
|
||||
const btVector3& pos2 = contactPoint.getPositionWorldOnB();
|
||||
|
||||
@@ -234,6 +240,8 @@ btScalar resolveSingleFrictionOriginal(
|
||||
const btContactSolverInfo& solverInfo)
|
||||
{
|
||||
|
||||
(void)solverInfo;
|
||||
|
||||
const btVector3& pos1 = contactPoint.getPositionWorldOnA();
|
||||
const btVector3& pos2 = contactPoint.getPositionWorldOnB();
|
||||
|
||||
@@ -391,12 +399,19 @@ btScalar resolveSingleCollisionCombined(
|
||||
|
||||
return normalImpulse;
|
||||
}
|
||||
|
||||
btScalar resolveSingleFrictionEmpty(
|
||||
btRigidBody& body1,
|
||||
btRigidBody& body2,
|
||||
btManifoldPoint& contactPoint,
|
||||
const btContactSolverInfo& solverInfo)
|
||||
{
|
||||
(void)contactPoint;
|
||||
(void)body1;
|
||||
(void)body2;
|
||||
(void)solverInfo;
|
||||
|
||||
|
||||
return btScalar(0.);
|
||||
};
|
||||
|
||||
|
||||
@@ -168,9 +168,10 @@ bool MatrixToEulerXYZ(const btMatrix3x3& mat,btVector3& xyz)
|
||||
xyz[0] = btAtan2(getMatrixElem(mat,3),getMatrixElem(mat,4));
|
||||
xyz[1] = SIMD_HALF_PI;
|
||||
xyz[2] = 0.0;
|
||||
return false;
|
||||
|
||||
}
|
||||
return false;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@@ -329,12 +330,13 @@ void btGeneric6DofConstraint::solveConstraint(btScalar timeStep)
|
||||
|
||||
void btGeneric6DofConstraint::updateRHS(btScalar timeStep)
|
||||
{
|
||||
(void)timeStep;
|
||||
|
||||
}
|
||||
|
||||
btScalar btGeneric6DofConstraint::computeAngle(int axis) const
|
||||
{
|
||||
btScalar angle;
|
||||
btScalar angle = btScalar(0.f);
|
||||
|
||||
switch (axis)
|
||||
{
|
||||
@@ -376,9 +378,12 @@ btScalar btGeneric6DofConstraint::computeAngle(int axis) const
|
||||
angle = btAtan2( s, c );
|
||||
}
|
||||
break;
|
||||
default: assert ( 0 ) ; break ;
|
||||
default:
|
||||
btAssert ( 0 ) ;
|
||||
|
||||
break ;
|
||||
}
|
||||
|
||||
return angle;
|
||||
return angle;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,12 +40,19 @@ class btGeneric6DofConstraint : public btTypedConstraint
|
||||
|
||||
btScalar m_accumulatedImpulse[6];
|
||||
|
||||
btGeneric6DofConstraint& operator=(btGeneric6DofConstraint& other)
|
||||
{
|
||||
btAssert(0);
|
||||
(void) other;
|
||||
return *this;
|
||||
}
|
||||
|
||||
public:
|
||||
btGeneric6DofConstraint(btRigidBody& rbA, btRigidBody& rbB, const btTransform& frameInA, const btTransform& frameInB );
|
||||
|
||||
btGeneric6DofConstraint();
|
||||
|
||||
|
||||
virtual void buildJacobian();
|
||||
|
||||
virtual void solveConstraint(btScalar timeStep);
|
||||
|
||||
@@ -223,6 +223,7 @@ void btHingeConstraint::solveConstraint(btScalar timeStep)
|
||||
|
||||
void btHingeConstraint::updateRHS(btScalar timeStep)
|
||||
{
|
||||
(void)timeStep;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -37,8 +37,8 @@ class btHingeConstraint : public btTypedConstraint
|
||||
|
||||
bool m_angularOnly;
|
||||
|
||||
float m_motorTargetVelocity;
|
||||
float m_maxMotorImpulse;
|
||||
btScalar m_motorTargetVelocity;
|
||||
btScalar m_maxMotorImpulse;
|
||||
bool m_enableAngularMotor;
|
||||
|
||||
public:
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
m_angularOnly = angularOnly;
|
||||
}
|
||||
|
||||
void enableAngularMotor(bool enableMotor,float targetVelocity,float maxMotorImpulse)
|
||||
void enableAngularMotor(bool enableMotor,btScalar targetVelocity,btScalar maxMotorImpulse)
|
||||
{
|
||||
m_enableAngularMotor = enableMotor;
|
||||
m_motorTargetVelocity = targetVelocity;
|
||||
|
||||
@@ -110,6 +110,7 @@ void btPoint2PointConstraint::solveConstraint(btScalar timeStep)
|
||||
|
||||
void btPoint2PointConstraint::updateRHS(btScalar timeStep)
|
||||
{
|
||||
(void)timeStep;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -42,8 +42,8 @@ int gTotalContactPoints = 0;
|
||||
|
||||
struct btOrderIndex
|
||||
{
|
||||
short int m_manifoldIndex;
|
||||
short int m_pointIndex;
|
||||
int m_manifoldIndex;
|
||||
int m_pointIndex;
|
||||
};
|
||||
|
||||
|
||||
@@ -124,11 +124,12 @@ m_btSeed2(0)
|
||||
|
||||
void initSolverBody(btSolverBody* solverBody, btRigidBody* rigidbody)
|
||||
{
|
||||
int size = sizeof(btSolverBody);
|
||||
/* int size = sizeof(btSolverBody);
|
||||
int sizeofrb = sizeof(btRigidBody);
|
||||
int sizemanifold = sizeof(btPersistentManifold);
|
||||
int sizeofmp = sizeof(btManifoldPoint);
|
||||
int sizeofPersistData = sizeof (btConstraintPersistentData);
|
||||
*/
|
||||
|
||||
solverBody->m_angularVelocity = rigidbody->getAngularVelocity();
|
||||
solverBody->m_centerOfMassPosition = rigidbody->getCenterOfMassPosition();
|
||||
@@ -159,6 +160,8 @@ SIMD_FORCE_INLINE btScalar resolveSingleCollisionCombinedCacheFriendly(
|
||||
btSolverConstraint& contactConstraint,
|
||||
const btContactSolverInfo& solverInfo)
|
||||
{
|
||||
(void)solverInfo;
|
||||
|
||||
btScalar normalImpulse(0.f);
|
||||
{
|
||||
if (contactConstraint.m_penetration < 0.f)
|
||||
@@ -225,6 +228,7 @@ SIMD_FORCE_INLINE btScalar resolveSingleFrictionCacheFriendly(
|
||||
const btContactSolverInfo& solverInfo,
|
||||
btScalar appliedNormalImpulse)
|
||||
{
|
||||
(void)solverInfo;
|
||||
|
||||
|
||||
const btScalar combinedFriction = contactConstraint.m_friction;
|
||||
@@ -335,6 +339,8 @@ btAlignedObjectArray<btSolverConstraint> tmpSolverFrictionConstraintPool;
|
||||
|
||||
btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendly(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifoldPtr, int numManifolds,btTypedConstraint** constraints,int numConstraints,const btContactSolverInfo& infoGlobal,btIDebugDraw* debugDrawer,btStackAlloc* stackAlloc)
|
||||
{
|
||||
(void)stackAlloc;
|
||||
(void)debugDrawer;
|
||||
|
||||
if (!(numConstraints + numManifolds))
|
||||
{
|
||||
@@ -364,7 +370,7 @@ btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendly(btCollisio
|
||||
//int sizeofSC = sizeof(btSolverConstraint);
|
||||
|
||||
|
||||
if (1)
|
||||
//if (1)
|
||||
{
|
||||
//if m_stackAlloc, try to pack bodies/constraints to speed up solving
|
||||
// btBlock* sablock;
|
||||
@@ -407,8 +413,8 @@ btScalar btSequentialImpulseConstraintSolver::solveGroupCacheFriendly(btCollisio
|
||||
btRigidBody* rb1 = (btRigidBody*)manifold->getBody1();
|
||||
|
||||
|
||||
int solverBodyIdA;
|
||||
int solverBodyIdB;
|
||||
int solverBodyIdA=-1;
|
||||
int solverBodyIdB=-1;
|
||||
|
||||
if (manifold->getNumContacts())
|
||||
{
|
||||
@@ -766,13 +772,13 @@ btScalar btSequentialImpulseConstraintSolver::solveGroup(btCollisionObject** bod
|
||||
|
||||
|
||||
{
|
||||
int j;
|
||||
short j;
|
||||
for (j=0;j<numManifolds;j++)
|
||||
{
|
||||
btPersistentManifold* manifold = manifoldPtr[j];
|
||||
prepareConstraints(manifold,info,debugDrawer);
|
||||
|
||||
for (int p=0;p<manifoldPtr[j]->getNumContacts();p++)
|
||||
for (short p=0;p<manifoldPtr[j]->getNumContacts();p++)
|
||||
{
|
||||
gOrder[totalPoints].m_manifoldIndex = j;
|
||||
gOrder[totalPoints].m_pointIndex = p;
|
||||
@@ -859,6 +865,8 @@ btScalar btSequentialImpulseConstraintSolver::solveGroup(btCollisionObject** bod
|
||||
void btSequentialImpulseConstraintSolver::prepareConstraints(btPersistentManifold* manifoldPtr, const btContactSolverInfo& info,btIDebugDraw* debugDrawer)
|
||||
{
|
||||
|
||||
(void)debugDrawer;
|
||||
|
||||
btRigidBody* body0 = (btRigidBody*)manifoldPtr->getBody0();
|
||||
btRigidBody* body1 = (btRigidBody*)manifoldPtr->getBody1();
|
||||
|
||||
@@ -1117,6 +1125,9 @@ btScalar btSequentialImpulseConstraintSolver::solve(btRigidBody* body0,btRigidBo
|
||||
btScalar btSequentialImpulseConstraintSolver::solveFriction(btRigidBody* body0,btRigidBody* body1, btManifoldPoint& cp, const btContactSolverInfo& info,int iter,btIDebugDraw* debugDrawer)
|
||||
{
|
||||
|
||||
(void)debugDrawer;
|
||||
(void)iter;
|
||||
|
||||
|
||||
{
|
||||
|
||||
|
||||
@@ -43,6 +43,12 @@ void btSolve2LinearConstraint::resolveUnilateralPairConstraint(
|
||||
btScalar depthB, const btVector3& normalB,
|
||||
btScalar& imp0,btScalar& imp1)
|
||||
{
|
||||
(void)linvelA;
|
||||
(void)linvelB;
|
||||
(void)angvelB;
|
||||
(void)angvelA;
|
||||
|
||||
|
||||
|
||||
imp0 = btScalar(0.);
|
||||
imp1 = btScalar(0.);
|
||||
@@ -126,6 +132,13 @@ void btSolve2LinearConstraint::resolveBilateralPairConstraint(
|
||||
btScalar& imp0,btScalar& imp1)
|
||||
{
|
||||
|
||||
(void)linvelA;
|
||||
(void)linvelB;
|
||||
(void)angvelA;
|
||||
(void)angvelB;
|
||||
|
||||
|
||||
|
||||
imp0 = btScalar(0.);
|
||||
imp1 = btScalar(0.);
|
||||
|
||||
@@ -221,7 +234,7 @@ void btSolve2LinearConstraint::resolveBilateralPairConstraint(
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
void btSolve2LinearConstraint::resolveAngularConstraint( const btMatrix3x3& invInertiaAWS,
|
||||
const btScalar invMassA,
|
||||
const btVector3& linvelA,const btVector3& angvelA,
|
||||
@@ -238,4 +251,5 @@ void btSolve2LinearConstraint::resolveAngularConstraint( const btMatrix3x3& invI
|
||||
{
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ public:
|
||||
btScalar depthB, const btVector3& normalB,
|
||||
btScalar& imp0,btScalar& imp1);
|
||||
|
||||
|
||||
/*
|
||||
void resolveAngularConstraint( const btMatrix3x3& invInertiaAWS,
|
||||
const btScalar invMassA,
|
||||
const btVector3& linvelA,const btVector3& angvelA,
|
||||
@@ -100,6 +100,7 @@ public:
|
||||
btScalar depthB, const btVector3& normalB,
|
||||
btScalar& imp0,btScalar& imp1);
|
||||
|
||||
*/
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ ATTRIBUTE_ALIGNED16 (struct) btSolverConstraint
|
||||
|
||||
int m_constraintType;
|
||||
int m_frictionIndex;
|
||||
// int m_unusedPadding[2];
|
||||
int m_unusedPadding[2];
|
||||
|
||||
enum btSolverConstraintType
|
||||
{
|
||||
|
||||
@@ -25,6 +25,12 @@ class btTypedConstraint
|
||||
int m_userConstraintType;
|
||||
int m_userConstraintId;
|
||||
|
||||
btTypedConstraint& operator=(btTypedConstraint& other)
|
||||
{
|
||||
btAssert(0);
|
||||
(void) other;
|
||||
return *this;
|
||||
}
|
||||
|
||||
protected:
|
||||
btRigidBody& m_rbA;
|
||||
|
||||
@@ -318,8 +318,8 @@ void btDiscreteDynamicsWorld::addRigidBody(btRigidBody* body)
|
||||
if (body->getCollisionShape())
|
||||
{
|
||||
bool isDynamic = !(body->isStaticObject() || body->isKinematicObject());
|
||||
short collisionFilterGroup = isDynamic? btBroadphaseProxy::DefaultFilter : btBroadphaseProxy::StaticFilter;
|
||||
short collisionFilterMask = isDynamic? btBroadphaseProxy::AllFilter : btBroadphaseProxy::AllFilter ^ btBroadphaseProxy::StaticFilter;
|
||||
short collisionFilterGroup = isDynamic? short(btBroadphaseProxy::DefaultFilter) : short(btBroadphaseProxy::StaticFilter);
|
||||
short collisionFilterMask = isDynamic? short(btBroadphaseProxy::AllFilter) : short(btBroadphaseProxy::AllFilter ^ btBroadphaseProxy::StaticFilter);
|
||||
|
||||
addCollisionObject(body,collisionFilterGroup,collisionFilterMask);
|
||||
}
|
||||
@@ -449,6 +449,12 @@ void btDiscreteDynamicsWorld::solveConstraints(btContactSolverInfo& solverInfo)
|
||||
|
||||
}
|
||||
|
||||
InplaceSolverIslandCallback& operator=(InplaceSolverIslandCallback& other)
|
||||
{
|
||||
btAssert(0);
|
||||
(void)other;
|
||||
return *this;
|
||||
}
|
||||
virtual void ProcessIsland(btCollisionObject** bodies,int numBodies,btPersistentManifold** manifolds,int numManifolds, int islandId)
|
||||
{
|
||||
//also add all non-contact constraints/joints for this island
|
||||
@@ -646,6 +652,7 @@ void btDiscreteDynamicsWorld::predictUnconstraintMotion(btScalar timeStep)
|
||||
|
||||
void btDiscreteDynamicsWorld::startProfiling(btScalar timeStep)
|
||||
{
|
||||
(void)timeStep;
|
||||
#ifdef USE_QUICKPROF
|
||||
|
||||
|
||||
@@ -706,6 +713,9 @@ public:
|
||||
|
||||
virtual void processTriangle(btVector3* triangle,int partId, int triangleIndex)
|
||||
{
|
||||
(void)partId;
|
||||
(void)triangleIndex;
|
||||
|
||||
btVector3 wv0,wv1,wv2;
|
||||
wv0 = m_worldTrans*triangle[0];
|
||||
wv1 = m_worldTrans*triangle[1];
|
||||
|
||||
@@ -43,13 +43,13 @@ class btDynamicsWorld : public btCollisionWorld
|
||||
|
||||
virtual void updateAabbs() = 0;
|
||||
|
||||
virtual void addConstraint(btTypedConstraint* constraint) {};
|
||||
virtual void addConstraint(btTypedConstraint* constraint) { (void)constraint;};
|
||||
|
||||
virtual void removeConstraint(btTypedConstraint* constraint) {};
|
||||
virtual void removeConstraint(btTypedConstraint* constraint) {(void)constraint;};
|
||||
|
||||
virtual void addVehicle(btRaycastVehicle* vehicle) {};
|
||||
virtual void addVehicle(btRaycastVehicle* vehicle) {(void)vehicle;};
|
||||
|
||||
virtual void removeVehicle(btRaycastVehicle* vehicle) {};
|
||||
virtual void removeVehicle(btRaycastVehicle* vehicle) {(void)vehicle;};
|
||||
|
||||
|
||||
virtual void setDebugDrawer(btIDebugDraw* debugDrawer) = 0;
|
||||
@@ -68,9 +68,9 @@ class btDynamicsWorld : public btCollisionWorld
|
||||
|
||||
virtual int getNumConstraints() const { return 0; }
|
||||
|
||||
virtual btTypedConstraint* getConstraint(int index) { return 0; }
|
||||
virtual btTypedConstraint* getConstraint(int index) { (void)index; return 0; }
|
||||
|
||||
virtual const btTypedConstraint* getConstraint(int index) const { return 0; }
|
||||
virtual const btTypedConstraint* getConstraint(int index) const { (void)index; return 0; }
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -51,6 +51,10 @@ btSimpleDynamicsWorld::~btSimpleDynamicsWorld()
|
||||
|
||||
int btSimpleDynamicsWorld::stepSimulation( btScalar timeStep,int maxSubSteps, btScalar fixedTimeStep)
|
||||
{
|
||||
(void)fixedTimeStep;
|
||||
(void)maxSubSteps;
|
||||
|
||||
|
||||
///apply gravity, predict motion
|
||||
predictUnconstraintMotion(timeStep);
|
||||
|
||||
|
||||
@@ -40,6 +40,7 @@ m_pitchControl(btScalar(0.))
|
||||
|
||||
void btRaycastVehicle::defaultInit(const btVehicleTuning& tuning)
|
||||
{
|
||||
(void)tuning;
|
||||
m_currentVehicleSpeedKmHour = btScalar(0.);
|
||||
m_steeringValue = btScalar(0.);
|
||||
|
||||
@@ -397,12 +398,13 @@ btWheelInfo& btRaycastVehicle::getWheelInfo(int index)
|
||||
void btRaycastVehicle::setBrake(btScalar brake,int wheelIndex)
|
||||
{
|
||||
btAssert((wheelIndex >= 0) && (wheelIndex < getNumWheels()));
|
||||
getWheelInfo(wheelIndex).m_brake;
|
||||
getWheelInfo(wheelIndex).m_brake = brake;
|
||||
}
|
||||
|
||||
|
||||
void btRaycastVehicle::updateSuspension(btScalar deltaTime)
|
||||
{
|
||||
(void)deltaTime;
|
||||
|
||||
btScalar chassisMass = btScalar(1.) / m_chassisBody->getInvMass();
|
||||
|
||||
|
||||
@@ -156,6 +156,7 @@ public:
|
||||
|
||||
virtual void solveConstraint(btScalar timeStep)
|
||||
{
|
||||
(void)timeStep;
|
||||
//not yet
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ btScalar btWheelInfo::getSuspensionRestLength() const
|
||||
|
||||
void btWheelInfo::updateWheel(const btRigidBody& chassis,RaycastInfo& raycastInfo)
|
||||
{
|
||||
(void)raycastInfo;
|
||||
|
||||
|
||||
if (m_raycastInfo.m_isInContact)
|
||||
|
||||
@@ -55,6 +55,7 @@ public:
|
||||
pointer address ( reference ref ) const { return &ref; }
|
||||
const_pointer address ( const_reference ref ) const { return &ref; }
|
||||
pointer allocate ( size_type n , const_pointer * hint = 0 ) {
|
||||
(void)hint;
|
||||
return reinterpret_cast< pointer >(btAlignedAlloc( sizeof(value_type) * n , Alignment ));
|
||||
}
|
||||
void construct ( pointer ptr , const value_type & value ) { new (ptr) value_type( value ); }
|
||||
|
||||
@@ -26,12 +26,12 @@ template <typename T>
|
||||
//template <class T>
|
||||
class btAlignedObjectArray
|
||||
{
|
||||
btAlignedAllocator<T , 16> m_allocator;
|
||||
|
||||
int m_size;
|
||||
int m_capacity;
|
||||
T* m_data;
|
||||
|
||||
btAlignedAllocator<T , 16> m_allocator;
|
||||
|
||||
protected:
|
||||
SIMD_FORCE_INLINE int allocSize(int size)
|
||||
{
|
||||
|
||||
@@ -31,12 +31,7 @@ struct btDefaultMotionState : public btMotionState
|
||||
m_graphicsWorldTrans = centerOfMassWorldTrans * m_centerOfMassOffset ;
|
||||
}
|
||||
|
||||
///Bullet gives a callback for objects that are about to be deactivated (put asleep)
|
||||
/// You can intercept this callback for your own bookkeeping.
|
||||
///Also you can return false to disable deactivation for this object this frame.
|
||||
virtual bool deactivationCallback(void* userPointer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
@@ -176,7 +176,7 @@ class btMatrix3x3 {
|
||||
void getRotation(btQuaternion& q) const
|
||||
{
|
||||
btScalar trace = m_el[0].x() + m_el[1].y() + m_el[2].z();
|
||||
float temp[4];
|
||||
btScalar temp[4];
|
||||
|
||||
if (trace > btScalar(0.0))
|
||||
{
|
||||
|
||||
@@ -34,10 +34,7 @@ class btMotionState
|
||||
//Bullet only calls the update of worldtransform for active objects
|
||||
virtual void setWorldTransform(const btTransform& worldTrans)=0;
|
||||
|
||||
//future: when Bullet makes attempt to deactivate object, you can intercept this callback (return false to disable deactivation for this object this frame)
|
||||
virtual bool deactivationCallback(void* userPointer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
#endif //BT_MOTIONSTATE_H
|
||||
|
||||
Reference in New Issue
Block a user