remove all warnings on Mac OSX Snow Leopard

This commit is contained in:
erwin.coumans
2010-01-30 22:31:56 +00:00
parent 77b773f470
commit 788f48643b
40 changed files with 136 additions and 244 deletions

View File

@@ -66,12 +66,12 @@ int main(int argc,char** argv)
map.remove(key2); map.remove(key2);
const OurValue* ourPtr = map.find(key1); // const OurValue* ourPtr = map.find(key1);
for (int i=0;i<map.size();i++) // for (int i=0;i<map.size();i++)
{ // {
OurValue* tmp = map.getAtIndex(i); // OurValue* tmp = map.getAtIndex(i);
//printf("tmp value=%f,%f,%f\n",tmp->m_position.getX(),tmp->m_position.getY(),tmp->m_position.getZ()); //printf("tmp value=%f,%f,%f\n",tmp->m_position.getX(),tmp->m_position.getY(),tmp->m_position.getZ());
} // }
BasicDemo ccdDemo; BasicDemo ccdDemo;
ccdDemo.initPhysics(); ccdDemo.initPhysics();

View File

@@ -223,7 +223,7 @@ void BenchmarkDemo::clientMoveAndDisplay()
#endif //USE_GRAPHICAL_BENCHMARK #endif //USE_GRAPHICAL_BENCHMARK
//simple dynamics world doesn't handle fixed-time-stepping //simple dynamics world doesn't handle fixed-time-stepping
float ms = getDeltaTimeMicroseconds(); //float ms = getDeltaTimeMicroseconds();
///step the simulation ///step the simulation
if (m_dynamicsWorld) if (m_dynamicsWorld)
@@ -427,7 +427,8 @@ void BenchmarkDemo::createTest1()
pos[0] = offset + (float)i * (cubeSize * 2.0f + spacing); pos[0] = offset + (float)i * (cubeSize * 2.0f + spacing);
trans.setOrigin(pos); trans.setOrigin(pos);
btRigidBody* cmbody = localCreateRigidBody(mass,trans,blockShape); btRigidBody* cmbody;
cmbody= localCreateRigidBody(mass,trans,blockShape);
} }
} }
offset -= 0.05f * spacing * (size-1); offset -= 0.05f * spacing * (size-1);
@@ -449,7 +450,7 @@ void BenchmarkDemo::createWall(const btVector3& offsetPosition,int stackSize,con
btVector3 localInertia(0,0,0); btVector3 localInertia(0,0,0);
blockShape->calculateLocalInertia(mass,localInertia); blockShape->calculateLocalInertia(mass,localInertia);
float diffX = boxSize[0] * 1.0f; // float diffX = boxSize[0] * 1.0f;
float diffY = boxSize[1] * 1.0f; float diffY = boxSize[1] * 1.0f;
float diffZ = boxSize[2] * 1.0f; float diffZ = boxSize[2] * 1.0f;
@@ -863,7 +864,7 @@ void BenchmarkDemo::createTest3()
float sizeX = 1.f; float sizeX = 1.f;
float sizeY = 1.f; float sizeY = 1.f;
int rc=0; //int rc=0;
btScalar scale(3.5); btScalar scale(3.5);
btVector3 pos(0.0f, sizeY, 0.0f); btVector3 pos(0.0f, sizeY, 0.0f);

View File

@@ -47,142 +47,3 @@ static float TaruVtx[] = {
1.08664f,1.99237f,0.0f, 1.08664f,1.99237f,0.0f,
}; };
static float TaruNml[] = {
0.938103f,-0.346356f,0.0f,
0.663339f,-0.346356f,-0.663339f,
0.707107f,0.0f,-0.707107f,
1.0f,0.0f,0.0f,
0.0f,-0.346356f,-0.938103f,
0.0f,0.0f,-1.0f,
0.0f,-0.346356f,-0.938103f,
-0.663339f,-0.346356f,-0.663339f,
-0.707107f,0.0f,-0.707107f,
0.0f,0.0f,-1.0f,
-0.938103f,-0.346356f,0.0f,
-1.0f,0.0f,0.0f,
-0.663339f,-0.346356f,0.663339f,
-0.707107f,0.0f,0.707107f,
0.0f,-0.346356f,0.938103f,
1.21445e-007f,0.0f,1.0f,
0.663339f,-0.346356f,0.663339f,
0.707107f,0.0f,0.707107f,
0.663339f,0.346356f,-0.663339f,
0.938103f,0.346356f,0.0f,
0.0f,0.346356f,-0.938103f,
-0.663339f,0.346356f,-0.663339f,
0.0f,0.346356f,-0.938103f,
-0.938103f,0.346356f,0.0f,
-0.663339f,0.346356f,0.663339f,
1.2508e-007f,0.346356f,0.938103f,
0.663339f,0.346356f,0.663339f,
0.0f,-1.0f,0.0f,
0.0f,-1.0f,0.0f,
0.0f,-1.0f,0.0f,
0.0f,-1.0f,0.0f,
0.0f,-1.0f,0.0f,
0.0f,-1.0f,0.0f,
0.0f,-1.0f,0.0f,
0.0f,-1.0f,0.0f,
0.0f,1.0f,0.0f,
0.0f,1.0f,0.0f,
0.0f,1.0f,0.0f,
0.0f,1.0f,0.0f,
0.0f,1.0f,0.0f,
0.0f,1.0f,0.0f,
0.0f,1.0f,0.0f,
0.0f,1.0f,0.0f,
};
static float TaruTex[] = {
0.75f,0.0f,
0.875f,0.0f,
0.875f,0.5f,
0.75f,0.5f,
1.0f,0.0f,
1.0f,0.5f,
0.0f,0.0f,
0.125f,0.0f,
0.125f,0.5f,
0.0f,0.5f,
0.25f,0.0f,
0.25f,0.5f,
0.375f,0.0f,
0.375f,0.5f,
0.5f,0.0f,
0.5f,0.5f,
0.625f,0.0f,
0.625f,0.5f,
0.875f,1.0f,
0.75f,1.0f,
1.0f,1.0f,
0.125f,1.0f,
0.0f,1.0f,
0.25f,1.0f,
0.375f,1.0f,
0.5f,1.0f,
0.625f,1.0f,
1.0f,0.5f,
0.853553f,0.146447f,
0.5f,0.0f,
0.146447f,0.146447f,
0.0f,0.5f,
0.146447f,0.853553f,
0.5f,1.0f,
0.853553f,0.853553f,
0.146447f,0.853553f,
0.0f,0.5f,
0.146447f,0.146447f,
0.5f,0.0f,
0.853553f,0.146447f,
1.0f,0.5f,
0.853553f,0.853553f,
0.5f,1.0f,
};
static unsigned short TaruIdx[] = {
0,1,2,
2,3,0,
1,4,5,
5,2,1,
6,7,8,
8,9,6,
7,10,11,
11,8,7,
10,12,13,
13,11,10,
12,14,15,
15,13,12,
14,16,17,
17,15,14,
16,0,3,
3,17,16,
3,2,18,
18,19,3,
2,5,20,
20,18,2,
9,8,21,
21,22,9,
8,11,23,
23,21,8,
11,13,24,
24,23,11,
13,15,25,
25,24,13,
15,17,26,
26,25,15,
17,3,19,
19,26,17,
27,28,29,
29,30,31,
31,32,33,
29,31,33,
27,29,33,
34,27,33,
35,36,37,
37,38,39,
39,40,41,
37,39,41,
35,37,41,
42,35,41,
};

View File

@@ -44,7 +44,7 @@ int main(int argc,char** argv)
BenchmarkDemo7 benchmarkDemo7; BenchmarkDemo7 benchmarkDemo7;
BenchmarkDemo* demoArray[NUM_DEMOS] = {&benchmarkDemo1,&benchmarkDemo2,&benchmarkDemo3,&benchmarkDemo4,&benchmarkDemo5,&benchmarkDemo6,&benchmarkDemo7}; BenchmarkDemo* demoArray[NUM_DEMOS] = {&benchmarkDemo1,&benchmarkDemo2,&benchmarkDemo3,&benchmarkDemo4,&benchmarkDemo5,&benchmarkDemo6,&benchmarkDemo7};
char* demoNames[NUM_DEMOS] = {"3000 fall", "1000 stack", "136 ragdolls","1000 convex", "prim-trimesh", "convex-trimesh","raytests"}; const char* demoNames[NUM_DEMOS] = {"3000 fall", "1000 stack", "136 ragdolls","1000 convex", "prim-trimesh", "convex-trimesh","raytests"};
float totalTime[NUM_DEMOS] = {0.f,0.f,0.f,0.f,0.f,0.f,0.f}; float totalTime[NUM_DEMOS] = {0.f,0.f,0.f,0.f,0.f,0.f,0.f};
#ifdef USE_GRAPHICAL_BENCHMARK #ifdef USE_GRAPHICAL_BENCHMARK

View File

@@ -114,7 +114,7 @@ void Box2dDemo::initPhysics()
toggle = m_dialogDynamicsWorld->createToggle(settings,"Toggle 2"); toggle = m_dialogDynamicsWorld->createToggle(settings,"Toggle 2");
toggle ->m_active = true; toggle ->m_active = true;
toggle = m_dialogDynamicsWorld->createToggle(settings,"Toggle 3"); toggle = m_dialogDynamicsWorld->createToggle(settings,"Toggle 3");
GL_SliderControl* slider = m_dialogDynamicsWorld->createSlider(settings,"Slider"); // GL_SliderControl* slider = m_dialogDynamicsWorld->createSlider(settings,"Slider");
GL_DialogWindow* dialog = m_dialogDynamicsWorld->createDialog(0,200,420,300,"Help"); GL_DialogWindow* dialog = m_dialogDynamicsWorld->createDialog(0,200,420,300,"Help");
GL_TextControl* txt = new GL_TextControl; GL_TextControl* txt = new GL_TextControl;
@@ -242,9 +242,9 @@ void Box2dDemo::initPhysics()
if (isDynamic) if (isDynamic)
colShape->calculateLocalInertia(mass,localInertia); colShape->calculateLocalInertia(mass,localInertia);
float start_x = START_POS_X - ARRAY_SIZE_X/2; // float start_x = START_POS_X - ARRAY_SIZE_X/2;
float start_y = START_POS_Y; // float start_y = START_POS_Y;
float start_z = START_POS_Z - ARRAY_SIZE_Z/2; // float start_z = START_POS_Z - ARRAY_SIZE_Z/2;
btVector3 x(-ARRAY_SIZE_X, 8.0f,-20.f); btVector3 x(-ARRAY_SIZE_X, 8.0f,-20.f);
btVector3 y; btVector3 y;

View File

@@ -11,6 +11,7 @@ InternalEdgeDemo
GimpactTestDemo GimpactTestDemo
GenericJointDemo GenericJointDemo
SerializeDemo SerializeDemo
SoftDemo
) )

View File

@@ -186,7 +186,7 @@ void CollisionInterfaceDemo::displayCallback(void) {
{ {
btPersistentManifold* contactManifold = manifoldArray[i]; btPersistentManifold* contactManifold = manifoldArray[i];
btCollisionObject* obA = static_cast<btCollisionObject*>(contactManifold->getBody0()); btCollisionObject* obA = static_cast<btCollisionObject*>(contactManifold->getBody0());
btCollisionObject* obB = static_cast<btCollisionObject*>(contactManifold->getBody1()); // btCollisionObject* obB = static_cast<btCollisionObject*>(contactManifold->getBody1());
glDisable(GL_DEPTH_TEST); glDisable(GL_DEPTH_TEST);
int numContacts = contactManifold->getNumContacts(); int numContacts = contactManifold->getNumContacts();

View File

@@ -109,7 +109,8 @@ void ConstraintDemo::initPhysics()
btTransform groundTransform; btTransform groundTransform;
groundTransform.setIdentity(); groundTransform.setIdentity();
groundTransform.setOrigin(btVector3(0,-56,0)); groundTransform.setOrigin(btVector3(0,-56,0));
btRigidBody* groundBody = localCreateRigidBody(0, groundTransform, groundShape); btRigidBody* groundBody;
groundBody= localCreateRigidBody(0, groundTransform, groundShape);

View File

@@ -287,7 +287,7 @@ void ConvexDecompositionDemo::initPhysics(const char* filename)
} }
} }
float mass = 1.f; // float mass = 1.f;
//float collisionMargin = 0.01f; //float collisionMargin = 0.01f;
//this is a tools issue: due to collision margin, convex objects overlap, compensate for it here: //this is a tools issue: due to collision margin, convex objects overlap, compensate for it here:
@@ -463,7 +463,8 @@ void ConvexDecompositionDemo::initPhysics(const char* filename)
btConvexHullShape* convexShape = convexDecomposition.m_convexShapes[i]; btConvexHullShape* convexShape = convexDecomposition.m_convexShapes[i];
compound->addChildShape(trans,convexShape); compound->addChildShape(trans,convexShape);
btRigidBody* body = localCreateRigidBody( 1.0, trans,convexShape); btRigidBody* body;
body = localCreateRigidBody( 1.0, trans,convexShape);
} }
#if 1 #if 1

View File

@@ -482,12 +482,14 @@ void GimpactConcaveDemo::initPhysics()
startTransform.setOrigin(btVector3(0,height,-5)); startTransform.setOrigin(btVector3(0,height,-5));
startTransform.setRotation(btQuaternion(0,0,3.14159265*0.5)); startTransform.setRotation(btQuaternion(0,0,3.14159265*0.5));
btRigidBody* bodyA = localCreateRigidBody(massT, startTransform,m_trimeshShape); btRigidBody* bodyA;
bodyA= localCreateRigidBody(massT, startTransform,m_trimeshShape);
height -= step; height -= step;
startTransform.setOrigin(btVector3(0,height,-5)); startTransform.setOrigin(btVector3(0,height,-5));
startTransform.setRotation(btQuaternion(3.14159265*0.5,0,3.14159265*0.5)); startTransform.setRotation(btQuaternion(3.14159265*0.5,0,3.14159265*0.5));
btRigidBody* bodyB = localCreateRigidBody(massT, startTransform,m_trimeshShape); btRigidBody* bodyB;
bodyB= localCreateRigidBody(massT, startTransform,m_trimeshShape);
} }
#else #else
@@ -601,7 +603,7 @@ void GimpactConcaveDemo::clientMoveAndDisplay()
unsigned long int time = getDeltaTimeMicroseconds()/btScalar(1000); unsigned long int time = getDeltaTimeMicroseconds()/btScalar(1000);
printf("%i time %i ms \n",m_steps_done,time); printf("%i time %i ms \n",m_steps_done,int(time));
//#ifdef BULLET_GIMPACT //#ifdef BULLET_GIMPACT
// printf("%i time %.1f ms \n",m_steps_done,btGImpactCollisionAlgorithm::getAverageTreeCollisionTime()); // printf("%i time %.1f ms \n",m_steps_done,btGImpactCollisionAlgorithm::getAverageTreeCollisionTime());

View File

@@ -60,17 +60,23 @@ class GimpactConcaveDemo : public PlatformDemoApplication
public: public:
GimpactConcaveDemo() GimpactConcaveDemo()
: m_trimeshShape(NULL), : m_steps_done(0),
m_trimeshShape(NULL),
m_trimeshShape2(NULL), m_trimeshShape2(NULL),
m_indexVertexArrays(NULL), m_indexVertexArrays(NULL),
m_indexVertexArrays2(NULL), m_indexVertexArrays2(NULL),
m_collisionConfiguration(NULL),
m_dispatcher(NULL),
m_broadphase(NULL),
kinematicTorus(NULL), kinematicTorus(NULL),
m_constraintSolver(NULL),
m_gimpactCollisionCreateFunc(NULL), m_gimpactCollisionCreateFunc(NULL),
m_steps_done(0) m_collisionConfiguration(NULL),
m_dispatcher(NULL),
m_broadphase(NULL),
m_constraintSolver(NULL)
{ {
} }

View File

@@ -65,23 +65,24 @@ m_ele(20.f),
m_azi(0.f), m_azi(0.f),
m_cameraPosition(0.f,0.f,0.f), m_cameraPosition(0.f,0.f,0.f),
m_cameraTargetPosition(0.f,0.f,0.f), m_cameraTargetPosition(0.f,0.f,0.f),
m_mouseOldX(0),
m_mouseOldY(0),
m_mouseButtons(0),
m_modifierKeys(0),
m_scaleBottom(0.5f), m_scaleBottom(0.5f),
m_scaleFactor(2.f), m_scaleFactor(2.f),
m_cameraUp(0,1,0), m_cameraUp(0,1,0),
m_forwardAxis(2), m_forwardAxis(2),
m_glutScreenWidth(0), m_glutScreenWidth(0),
m_glutScreenHeight(0), m_glutScreenHeight(0),
m_ortho(0),
m_ShootBoxInitialSpeed(40.f), m_ShootBoxInitialSpeed(40.f),
m_stepping(true), m_stepping(true),
m_singleStep(false), m_singleStep(false),
m_idle(false), m_idle(false),
m_enableshadows(false), m_enableshadows(false),
m_sundirection(btVector3(1,-2,1)*1000), m_sundirection(btVector3(1,-2,1)*1000)
m_ortho(0),
m_mouseOldX(0),
m_mouseOldY(0),
m_mouseButtons(0),
m_modifierKeys(0)
{ {
#ifndef BT_NO_PROFILE #ifndef BT_NO_PROFILE
m_profileIterator = CProfileManager::Get_Iterator(); m_profileIterator = CProfileManager::Get_Iterator();

View File

@@ -48,6 +48,8 @@ subject to the following restrictions:
#include <string.h> //for memset #include <string.h> //for memset
extern unsigned char sFontData[]; extern unsigned char sFontData[];
static bool sTexturesInitialized = false;
static GLuint sTexture = -1; static GLuint sTexture = -1;
static int sScreenWidth = -1; static int sScreenWidth = -1;
static int sScreenHeight = -1; static int sScreenHeight = -1;
@@ -62,8 +64,9 @@ void GLDebugResetFont(int screenWidth,int screenHeight)
sScreenWidth = screenWidth; sScreenWidth = screenWidth;
sScreenHeight = screenHeight; sScreenHeight = screenHeight;
if (sTexture==-1) if (!sTexturesInitialized)
{ {
sTexturesInitialized = true;
glGenTextures(1, &sTexture); glGenTextures(1, &sTexture);
glBindTexture(GL_TEXTURE_2D, sTexture); glBindTexture(GL_TEXTURE_2D, sTexture);
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR);
@@ -71,8 +74,6 @@ void GLDebugResetFont(int screenWidth,int screenHeight)
glTexImage2D(GL_TEXTURE_2D, 0, 3, 256 , 256 , 0, GL_RGB, GL_UNSIGNED_BYTE, &sFontData[0]); glTexImage2D(GL_TEXTURE_2D, 0, 3, 256 , 256 , 0, GL_RGB, GL_UNSIGNED_BYTE, &sFontData[0]);
} }
int windowWidth=screenWidth;
int windowHeight = screenHeight;
printf("generating font at resolution %d,%d\n",screenWidth,screenHeight); printf("generating font at resolution %d,%d\n",screenWidth,screenHeight);
} }
@@ -82,9 +83,7 @@ void GLDebugResetFont(int screenWidth,int screenHeight)
void GLDebugDrawStringInternal(int x,int y,const char* string, const btVector3& rgb) void GLDebugDrawStringInternal(int x,int y,const char* string, const btVector3& rgb)
{ {
if (!sTexturesInitialized)
const char* string2 = "test";
if (sTexture==-1)
{ {
GLDebugResetFont(sScreenWidth,sScreenHeight); GLDebugResetFont(sScreenWidth,sScreenHeight);
} }

View File

@@ -249,12 +249,13 @@ GL_SliderControl* GL_DialogDynamicsWorld::createSlider(GL_DialogWindow* dialog,
btTransform frameInB; btTransform frameInB;
frameInB.setIdentity(); frameInB.setIdentity();
//frameInB.setOrigin(-offset/2); //frameInB.setOrigin(-offset/2);
bool useFrameA = false;
btScalar lowerLimit = 80.f; btScalar lowerLimit = 80.f;
btScalar upperLimit = 170.f; btScalar upperLimit = 170.f;
#if 0 #if 0
bool useFrameA = false;
btGeneric6DofConstraint* constraint = new btGeneric6DofConstraint(*dialogBody,*body,frameInA,frameInB,useFrameA); btGeneric6DofConstraint* constraint = new btGeneric6DofConstraint(*dialogBody,*body,frameInA,frameInB,useFrameA);
m_dynamicsWorld->addConstraint(constraint,true); m_dynamicsWorld->addConstraint(constraint,true);
constraint->setLimit(0,lowerLimit,upperLimit); constraint->setLimit(0,lowerLimit,upperLimit);
@@ -339,7 +340,7 @@ void GL_DialogDynamicsWorld::draw(btScalar timeStep)
static btRigidBody* pickedBody = 0;//for deactivation state static btRigidBody* pickedBody = 0;//for deactivation state
static btScalar mousePickClamping = 111130.f; static btScalar mousePickClamping = 111130.f;
static int gPickingConstraintId = 0; //static int gPickingConstraintId = 0;
static btVector3 gOldPickingPos; static btVector3 gOldPickingPos;
static btVector3 gHitPos(-1,-1,-1); static btVector3 gHitPos(-1,-1,-1);

View File

@@ -30,9 +30,10 @@ m_dialogWidth(dialogWidth),
m_dialogHeight(dialogHeight), m_dialogHeight(dialogHeight),
m_screenWidth(0), m_screenWidth(0),
m_screenHeight(0), m_screenHeight(0),
m_dialogTitle(dialogTitle),
m_MaxClipPlanes(-1), m_MaxClipPlanes(-1),
m_collisionObject(collisionObject), m_collisionObject(collisionObject)
m_dialogTitle(dialogTitle)
{ {
} }
@@ -291,7 +292,7 @@ void GL_ToggleControl::draw(int& parentHorPos2,int& parentVertPos2,btScalar delt
if (m_active) if (m_active)
{ {
//unsigned int red = 0xff8f0000; //unsigned int red = 0xff8f0000;
unsigned int white = 0xff8f0000; // unsigned int white = 0xff8f0000;
unsigned int black = 0xff1f1f1f; unsigned int black = 0xff1f1f1f;
borderSize = 4; borderSize = 4;
drawRect(parentHorPos+borderSize, parentVertPos+borderSize, parentHorPos+16-borderSize, parentVertPos+16-borderSize, black,black,black,black); drawRect(parentHorPos+borderSize, parentVertPos+borderSize, parentHorPos+16-borderSize, parentVertPos+16-borderSize, black,black,black,black);

View File

@@ -130,10 +130,10 @@ public:
GL_SliderControl(const char* sliderText,btCollisionObject* sliderBody, GL_DialogWindow* parentWindow, btScalar lowerLimit,btScalar upperLimit,btTypedConstraint* constaint) GL_SliderControl(const char* sliderText,btCollisionObject* sliderBody, GL_DialogWindow* parentWindow, btScalar lowerLimit,btScalar upperLimit,btTypedConstraint* constaint)
:m_sliderBody(sliderBody), :m_sliderBody(sliderBody),
m_parentWindow(parentWindow), m_parentWindow(parentWindow),
m_sliderText(sliderText),
m_lowerLimit(lowerLimit), m_lowerLimit(lowerLimit),
m_upperLimit(upperLimit), m_upperLimit(upperLimit),
m_constraint(constaint) m_constraint(constaint),
m_sliderText(sliderText)
{ {
m_type = GL_SLIDER_CONTROL; m_type = GL_SLIDER_CONTROL;
} }

View File

@@ -532,7 +532,7 @@ void GL_ShapeDrawer::drawOpenGL(btScalar* m, const btCollisionShape* shape, cons
static const GLfloat planex[]={1,0,0,0}; static const GLfloat planex[]={1,0,0,0};
static const GLfloat planey[]={0,1,0,0}; // static const GLfloat planey[]={0,1,0,0};
static const GLfloat planez[]={0,0,1,0}; static const GLfloat planez[]={0,0,1,0};
glTexGenfv(GL_S,GL_OBJECT_PLANE,planex); glTexGenfv(GL_S,GL_OBJECT_PLANE,planex);
glTexGenfv(GL_T,GL_OBJECT_PLANE,planez); glTexGenfv(GL_T,GL_OBJECT_PLANE,planez);
@@ -839,10 +839,10 @@ void GL_ShapeDrawer::drawOpenGL(btScalar* m, const btCollisionShape* shape, cons
btVector3 normal; btVector3 normal;
btVector3 vtx; btVector3 vtx;
polyshape->getPlane(normal,vtx,i); polyshape->getPlane(normal,vtx,i);
btScalar d = vtx.dot(normal); //btScalar d = vtx.dot(normal);
char buf[12]; //char buf[12];
sprintf(buf," plane %d",i); //sprintf(buf," plane %d",i);
//btDrawString(BMF_GetFont(BMF_kHelvetica10),buf); //btDrawString(BMF_GetFont(BMF_kHelvetica10),buf);
} }
@@ -921,7 +921,7 @@ void GL_ShapeDrawer::drawShadow(btScalar* m,const btVector3& extrusion,const bt
} }
else else
{ {
bool useWireframeFallback = true; // bool useWireframeFallback = true;
if (shape->isConvex()) if (shape->isConvex())
{ {
ShapeCache* sc=cache((btConvexShape*)shape); ShapeCache* sc=cache((btConvexShape*)shape);

View File

@@ -66,12 +66,12 @@ int main(int argc,char** argv)
map.remove(key2); map.remove(key2);
const OurValue* ourPtr = map.find(key1); // const OurValue* ourPtr = map.find(key1);
for (int i=0;i<map.size();i++) // for (int i=0;i<map.size();i++)
{ // {
OurValue* tmp = map.getAtIndex(i); // OurValue* tmp = map.getAtIndex(i);
//printf("tmp value=%f,%f,%f\n",tmp->m_position.getX(),tmp->m_position.getY(),tmp->m_position.getZ()); // //printf("tmp value=%f,%f,%f\n",tmp->m_position.getX(),tmp->m_position.getY(),tmp->m_position.getZ());
} // }
SerializeDemo ccdDemo; SerializeDemo ccdDemo;
ccdDemo.initPhysics(); ccdDemo.initPhysics();

View File

@@ -1526,7 +1526,7 @@ void SoftDemo::renderme()
} }
long ms=btMax<long>(m_clock.getTimeMilliseconds(),1); long ms=btMax<long>(m_clock.getTimeMilliseconds(),1);
long rayperseconds=(1000*(origins.size()*sbs.size()))/ms; long rayperseconds=(1000*(origins.size()*sbs.size()))/ms;
printf("%d ms (%d rays/s)\r\n",ms,rayperseconds); printf("%d ms (%d rays/s)\r\n",int(ms),int(rayperseconds));
} }
/* Draw rays */ /* Draw rays */
const btVector3 c[]={ origins[0], const btVector3 c[]={ origins[0],

View File

@@ -603,12 +603,12 @@ int OBJ::LoadMesh(const char *fname,GeometryInterface *iface)
return ret; return ret;
} }
static const char * GetArg(const char **argv,int i,int argc) //static const char * GetArg(const char **argv,int i,int argc)
{ //{
const char * ret = 0; // const char * ret = 0;
if ( i < argc ) ret = argv[i]; // if ( i < argc ) ret = argv[i];
return ret; // return ret;
} //}
void OBJ::getVertex(GeometryVertex &v,const char *face) const void OBJ::getVertex(GeometryVertex &v,const char *face) const
{ {

View File

@@ -382,7 +382,7 @@ void bDNA::init(char *data, int len, bool swap)
{ {
nr= (long)cp; nr= (long)cp;
long mask=3; //long mask=3;
nr= ((nr+3)&~3)-nr; nr= ((nr+3)&~3)-nr;
while (nr--) while (nr--)
{ {
@@ -415,7 +415,7 @@ void bDNA::init(char *data, int len, bool swap)
{ {
nr= (long)cp; nr= (long)cp;
long mask=3; // long mask=3;
nr= ((nr+3)&~3)-nr; nr= ((nr+3)&~3)-nr;
while (nr--) while (nr--)
{ {

View File

@@ -88,7 +88,7 @@ void btBulletFile::parseData()
printf ("Chunk size = %d",CHUNK_HEADER_LEN); printf ("Chunk size = %d",CHUNK_HEADER_LEN);
printf ("File chunk size = %d",ChunkUtils::getOffset(mFlags)); printf ("File chunk size = %d",ChunkUtils::getOffset(mFlags));
const bool swap = (mFlags&FD_ENDIAN_SWAP)!=0; //const bool swap = (mFlags&FD_ENDIAN_SWAP)!=0;
mDataStart = 12; mDataStart = 12;

View File

@@ -226,9 +226,9 @@ btCollisionShape* btBulletWorldImporter::convertCollisionShape( btCollisionShap
} }
case CONVEX_HULL_SHAPE_PROXYTYPE: case CONVEX_HULL_SHAPE_PROXYTYPE:
{ {
int sz = sizeof(btConvexHullShapeData); // int sz = sizeof(btConvexHullShapeData);
int sz2 = sizeof(btConvexInternalShapeData); // int sz2 = sizeof(btConvexInternalShapeData);
int sz3 = sizeof(btCollisionShapeData); // int sz3 = sizeof(btCollisionShapeData);
btConvexHullShapeData* convexData = (btConvexHullShapeData*)bsd; btConvexHullShapeData* convexData = (btConvexHullShapeData*)bsd;
int numPoints = convexData->m_numUnscaledPoints; int numPoints = convexData->m_numUnscaledPoints;
@@ -407,11 +407,11 @@ bool btBulletWorldImporter::loadFileFromMemory( bParse::btBulletFile* bulletFil
} }
} }
for (i=0;i<bulletFile2->m_collisionObjects.size();i++) // for (i=0;i<bulletFile2->m_collisionObjects.size();i++)
{ // {
btCollisionObjectData* colObjData = (btCollisionObjectData*)bulletFile2->m_collisionObjects[i]; // btCollisionObjectData* colObjData = (btCollisionObjectData*)bulletFile2->m_collisionObjects[i];
printf("bla"); // printf("bla");
} // }
for (i=0;i<bulletFile2->m_constraints.size();i++) for (i=0;i<bulletFile2->m_constraints.size();i++)

View File

@@ -135,7 +135,7 @@ static int ClipSegmentToLine(ClipVertex vOut[2], ClipVertex vIn[2],
static btScalar EdgeSeparation(const btBox2dShape* poly1, const btTransform& xf1, int edge1, static btScalar EdgeSeparation(const btBox2dShape* poly1, const btTransform& xf1, int edge1,
const btBox2dShape* poly2, const btTransform& xf2) const btBox2dShape* poly2, const btTransform& xf2)
{ {
int count1 = poly1->getVertexCount(); //int count1 = poly1->getVertexCount();
const btVector3* vertices1 = poly1->getVertices(); const btVector3* vertices1 = poly1->getVertices();
const btVector3* normals1 = poly1->getNormals(); const btVector3* normals1 = poly1->getNormals();
@@ -271,7 +271,7 @@ static void FindIncidentEdge(ClipVertex c[2],
const btBox2dShape* poly1, const btTransform& xf1, int edge1, const btBox2dShape* poly1, const btTransform& xf1, int edge1,
const btBox2dShape* poly2, const btTransform& xf2) const btBox2dShape* poly2, const btTransform& xf2)
{ {
int count1 = poly1->getVertexCount(); //int count1 = poly1->getVertexCount();
const btVector3* normals1 = poly1->getNormals(); const btVector3* normals1 = poly1->getNormals();
int count2 = poly2->getVertexCount(); int count2 = poly2->getVertexCount();

View File

@@ -30,8 +30,8 @@ btCollisionObject::btCollisionObject()
m_deactivationTime(btScalar(0.)), m_deactivationTime(btScalar(0.)),
m_friction(btScalar(0.5)), m_friction(btScalar(0.5)),
m_restitution(btScalar(0.)), m_restitution(btScalar(0.)),
m_userObjectPointer(0),
m_internalType(CO_COLLISION_OBJECT), m_internalType(CO_COLLISION_OBJECT),
m_userObjectPointer(0),
m_hitFraction(btScalar(1.)), m_hitFraction(btScalar(1.)),
m_ccdSweptSphereRadius(btScalar(0.)), m_ccdSweptSphereRadius(btScalar(0.)),
m_ccdMotionThreshold(btScalar(0.)), m_ccdMotionThreshold(btScalar(0.)),

View File

@@ -238,8 +238,8 @@ struct btPerturbedContactResult : public btManifoldResult
:m_originalManifoldResult(originalResult), :m_originalManifoldResult(originalResult),
m_transformA(transformA), m_transformA(transformA),
m_transformB(transformB), m_transformB(transformB),
m_perturbA(perturbA),
m_unPerturbedTransform(unPerturbedTransform), m_unPerturbedTransform(unPerturbedTransform),
m_perturbA(perturbA),
m_debugDrawer(debugDrawer) m_debugDrawer(debugDrawer)
{ {
} }

View File

@@ -461,16 +461,16 @@ void btAdjustInternalEdgeContacts(btManifoldPoint& cp, const btCollisionObject*
btVector3 center = (v0+v1+v2)*btScalar(1./3.); btVector3 center = (v0+v1+v2)*btScalar(1./3.);
btVector3 red(1,0,0), green(0,1,0),blue(0,0,1),white(1,1,1),black(0,0,0); btVector3 red(1,0,0), green(0,1,0),blue(0,0,1),white(1,1,1),black(0,0,0);
const btTransform& tr = colObj0->getWorldTransform();
btVector3 tri_normal; btVector3 tri_normal;
tri_shape->calcNormal(tri_normal); tri_shape->calcNormal(tri_normal);
btScalar dot = tri_normal.dot(cp.m_normalWorldOnB); //btScalar dot = tri_normal.dot(cp.m_normalWorldOnB);
btVector3 nearest; btVector3 nearest;
btNearestPointInLineSegment(cp.m_localPointB,v0,v1,nearest); btNearestPointInLineSegment(cp.m_localPointB,v0,v1,nearest);
btVector3 contact = cp.m_localPointB; btVector3 contact = cp.m_localPointB;
#ifdef BT_INTERNAL_EDGE_DEBUG_DRAW #ifdef BT_INTERNAL_EDGE_DEBUG_DRAW
const btTransform& tr = colObj0->getWorldTransform();
btDebugDrawLine(tr*nearest,tr*cp.m_localPointB,red); btDebugDrawLine(tr*nearest,tr*cp.m_localPointB,red);
#endif //BT_INTERNAL_EDGE_DEBUG_DRAW #endif //BT_INTERNAL_EDGE_DEBUG_DRAW

View File

@@ -189,7 +189,7 @@ bool btConvexHullShape::isInside(const btVector3& ,btScalar ) const
///fills the dataBuffer and returns the struct name (and 0 on failure) ///fills the dataBuffer and returns the struct name (and 0 on failure)
const char* btConvexHullShape::serialize(void* dataBuffer, btSerializer* serializer) const const char* btConvexHullShape::serialize(void* dataBuffer, btSerializer* serializer) const
{ {
int szc = sizeof(btConvexHullShapeData); //int szc = sizeof(btConvexHullShapeData);
btConvexHullShapeData* shapeData = (btConvexHullShapeData*) dataBuffer; btConvexHullShapeData* shapeData = (btConvexHullShapeData*) dataBuffer;
btConvexInternalShape::serialize(&shapeData->m_convexInternalShapeData, serializer); btConvexInternalShape::serialize(&shapeData->m_convexInternalShapeData, serializer);
@@ -206,8 +206,8 @@ const char* btConvexHullShape::serialize(void* dataBuffer, btSerializer* seriali
if (numElem) if (numElem)
{ {
int sz = sizeof(btVector3Data); int sz = sizeof(btVector3Data);
int sz2 = sizeof(btVector3DoubleData); // int sz2 = sizeof(btVector3DoubleData);
int sz3 = sizeof(btVector3FloatData); // int sz3 = sizeof(btVector3FloatData);
btChunk* chunk = serializer->allocate(sz,numElem); btChunk* chunk = serializer->allocate(sz,numElem);
btVector3Data* memPtr = (btVector3Data*)chunk->m_oldPtr; btVector3Data* memPtr = (btVector3Data*)chunk->m_oldPtr;
for (int i=0;i<numElem;i++,memPtr++) for (int i=0;i<numElem;i++,memPtr++)

View File

@@ -190,7 +190,7 @@ const char* btStridingMeshInterface::serialize(void* dataBuffer, btSerializer* s
trimeshData->m_numMeshParts = getNumSubParts(); trimeshData->m_numMeshParts = getNumSubParts();
void* uniquePtr = 0; //void* uniquePtr = 0;
trimeshData->m_meshPartsPtr = 0; trimeshData->m_meshPartsPtr = 0;
@@ -201,7 +201,7 @@ const char* btStridingMeshInterface::serialize(void* dataBuffer, btSerializer* s
trimeshData->m_meshPartsPtr = memPtr; trimeshData->m_meshPartsPtr = memPtr;
int numtotalphysicsverts = 0; // int numtotalphysicsverts = 0;
int part,graphicssubparts = getNumSubParts(); int part,graphicssubparts = getNumSubParts();
const unsigned char * vertexbase; const unsigned char * vertexbase;
const unsigned char * indexbase; const unsigned char * indexbase;
@@ -210,7 +210,7 @@ const char* btStridingMeshInterface::serialize(void* dataBuffer, btSerializer* s
PHY_ScalarType gfxindextype; PHY_ScalarType gfxindextype;
int stride,numverts,numtriangles; int stride,numverts,numtriangles;
int gfxindex; int gfxindex;
btVector3 triangle[3]; // btVector3 triangle[3];
btVector3 meshScaling = getScaling(); btVector3 meshScaling = getScaling();

View File

@@ -56,9 +56,9 @@ m_useSolveConstraintObsolete(D6_USE_OBSOLETE_METHOD)
static btRigidBody s_fixed(0, 0, 0); static btRigidBody s_fixed(0, 0, 0);
btGeneric6DofConstraint::btGeneric6DofConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB) btGeneric6DofConstraint::btGeneric6DofConstraint(btRigidBody& rbB, const btTransform& frameInB, bool useLinearReferenceFrameB)
: btTypedConstraint(D6_CONSTRAINT_TYPE, s_fixed, rbB), : btTypedConstraint(D6_CONSTRAINT_TYPE, s_fixed, rbB),
m_useSolveConstraintObsolete(false),
m_frameInB(frameInB), m_frameInB(frameInB),
m_useLinearReferenceFrameA(useLinearReferenceFrameB) m_useLinearReferenceFrameA(useLinearReferenceFrameB),
m_useSolveConstraintObsolete(false)
{ {
///not providing rigidbody A means implicitly using worldspace for body A ///not providing rigidbody A means implicitly using worldspace for body A
m_frameInA = rbB.getCenterOfMassTransform() * m_frameInB; m_frameInA = rbB.getCenterOfMassTransform() * m_frameInB;

View File

@@ -713,8 +713,8 @@ class btClosestNotMeConvexResultCallback : public btCollisionWorld::ClosestConve
public: public:
btClosestNotMeConvexResultCallback (btCollisionObject* me,const btVector3& fromA,const btVector3& toA,btOverlappingPairCache* pairCache,btDispatcher* dispatcher) : btClosestNotMeConvexResultCallback (btCollisionObject* me,const btVector3& fromA,const btVector3& toA,btOverlappingPairCache* pairCache,btDispatcher* dispatcher) :
btCollisionWorld::ClosestConvexResultCallback(fromA,toA), btCollisionWorld::ClosestConvexResultCallback(fromA,toA),
m_allowedPenetration(0.0f),
m_me(me), m_me(me),
m_allowedPenetration(0.0f),
m_pairCache(pairCache), m_pairCache(pairCache),
m_dispatcher(dispatcher) m_dispatcher(dispatcher)
{ {

View File

@@ -70,7 +70,7 @@ void processMiniCLTask(void* userPtr, void* lsMemory)
{ {
// BT_PROFILE("processSampleTask"); // BT_PROFILE("processSampleTask");
MiniCLTask_LocalStoreMemory* localMemory = (MiniCLTask_LocalStoreMemory*)lsMemory; //MiniCLTask_LocalStoreMemory* localMemory = (MiniCLTask_LocalStoreMemory*)lsMemory;
MiniCLTaskDesc* taskDescPtr = (MiniCLTaskDesc*)userPtr; MiniCLTaskDesc* taskDescPtr = (MiniCLTaskDesc*)userPtr;
MiniCLTaskDesc& taskDesc = *taskDescPtr; MiniCLTaskDesc& taskDesc = *taskDescPtr;

View File

@@ -172,7 +172,7 @@ void PosixThreadSupport::waitForResponse(unsigned int *puiArgument0, unsigned in
// get at least one thread which has finished // get at least one thread which has finished
size_t last = -1; size_t last = -1;
for(size_t t=0; t < m_activeSpuStatus.size(); ++t) { for(size_t t=0; t < size_t(m_activeSpuStatus.size()); ++t) {
if(2 == m_activeSpuStatus[t].m_status) { if(2 == m_activeSpuStatus[t].m_status) {
last = t; last = t;
break; break;
@@ -233,9 +233,9 @@ void PosixThreadSupport::startSPU()
///tell the task scheduler we are done with the SPU tasks ///tell the task scheduler we are done with the SPU tasks
void PosixThreadSupport::stopSPU() void PosixThreadSupport::stopSPU()
{ {
for(size_t t=0; t < m_activeSpuStatus.size(); ++t) { for(size_t t=0; t < size_t(m_activeSpuStatus.size()); ++t) {
btSpuStatus& spuStatus = m_activeSpuStatus[t]; btSpuStatus& spuStatus = m_activeSpuStatus[t];
printf("%s: Thread %i used: %ld\n", __FUNCTION__, t, spuStatus.threadUsed); printf("%s: Thread %i used: %ld\n", __FUNCTION__, int(t), spuStatus.threadUsed);
destroySem(spuStatus.startSemaphore); destroySem(spuStatus.startSemaphore);
checkPThreadFunction(pthread_cancel(spuStatus.thread)); checkPThreadFunction(pthread_cancel(spuStatus.thread));

View File

@@ -26,7 +26,7 @@ subject to the following restrictions:
void SpuCollisionTaskProcess::setNumTasks(int maxNumTasks) void SpuCollisionTaskProcess::setNumTasks(int maxNumTasks)
{ {
if (m_maxNumOutstandingTasks != maxNumTasks) if (int(m_maxNumOutstandingTasks) != maxNumTasks)
{ {
m_maxNumOutstandingTasks = maxNumTasks; m_maxNumOutstandingTasks = maxNumTasks;
m_taskBusy.resize(m_maxNumOutstandingTasks); m_taskBusy.resize(m_maxNumOutstandingTasks);
@@ -69,7 +69,7 @@ m_maxNumOutstandingTasks(0)
m_threadInterface->startSPU(); m_threadInterface->startSPU();
//printf("sizeof vec_float4: %d\n", sizeof(vec_float4)); //printf("sizeof vec_float4: %d\n", sizeof(vec_float4));
printf("sizeof SpuGatherAndProcessWorkUnitInput: %d\n", sizeof(SpuGatherAndProcessWorkUnitInput)); printf("sizeof SpuGatherAndProcessWorkUnitInput: %d\n", int(sizeof(SpuGatherAndProcessWorkUnitInput)));
} }

View File

@@ -1033,7 +1033,7 @@ void processCollisionTask(void* userPtr, void* lsMemPtr)
collisionPairInput.m_isSwapped); collisionPairInput.m_isSwapped);
float distance=0.f; //float distance=0.f;
btVector3 normalInB; btVector3 normalInB;

View File

@@ -2327,7 +2327,7 @@ void btSoftBody::solveClusters(btScalar sor)
void btSoftBody::applyClusters(bool drift) void btSoftBody::applyClusters(bool drift)
{ {
BT_PROFILE("ApplyClusters"); BT_PROFILE("ApplyClusters");
const btScalar f0=m_sst.sdt; // const btScalar f0=m_sst.sdt;
//const btScalar f1=f0/2; //const btScalar f1=f0/2;
btAlignedObjectArray<btVector3> deltas; btAlignedObjectArray<btVector3> deltas;
btAlignedObjectArray<btScalar> weights; btAlignedObjectArray<btScalar> weights;
@@ -2625,6 +2625,9 @@ void btSoftBody::applyForces()
nrm=NormalizeAny(rel_v);break; nrm=NormalizeAny(rel_v);break;
case btSoftBody::eAeroModel::V_TwoSided: case btSoftBody::eAeroModel::V_TwoSided:
nrm*=(btScalar)(btDot(nrm,rel_v)<0?-1:+1);break; nrm*=(btScalar)(btDot(nrm,rel_v)<0?-1:+1);break;
default:
{
}
} }
const btScalar dvn=btDot(rel_v,nrm); const btScalar dvn=btDot(rel_v,nrm);
/* Compute forces */ /* Compute forces */
@@ -2671,6 +2674,9 @@ void btSoftBody::applyForces()
{ {
case btSoftBody::eAeroModel::F_TwoSided: case btSoftBody::eAeroModel::F_TwoSided:
nrm*=(btScalar)(btDot(nrm,rel_v)<0?-1:+1);break; nrm*=(btScalar)(btDot(nrm,rel_v)<0?-1:+1);break;
default:
{
}
} }
const btScalar dvn=btDot(rel_v,nrm); const btScalar dvn=btDot(rel_v,nrm);
/* Compute forces */ /* Compute forces */
@@ -2815,6 +2821,9 @@ btSoftBody::psolver_t btSoftBody::getSolver(ePSolver::_ solver)
return(&btSoftBody::PSolve_RContacts); return(&btSoftBody::PSolve_RContacts);
case ePSolver::SContacts: case ePSolver::SContacts:
return(&btSoftBody::PSolve_SContacts); return(&btSoftBody::PSolve_SContacts);
default:
{
}
} }
return(0); return(0);
} }
@@ -2825,6 +2834,9 @@ btSoftBody::vsolver_t btSoftBody::getSolver(eVSolver::_ solver)
switch(solver) switch(solver)
{ {
case eVSolver::Linear: return(&btSoftBody::VSolve_Links); case eVSolver::Linear: return(&btSoftBody::VSolve_Links);
default:
{
}
} }
return(0); return(0);
} }

View File

@@ -380,7 +380,12 @@ void btSoftBodyHelpers::Draw( btSoftBody* psb,
idraw->drawLine(o0,o0+a1*10,btVector3(1,1,0)); idraw->drawLine(o0,o0+a1*10,btVector3(1,1,0));
idraw->drawLine(o1,o1+a0*10,btVector3(0,1,1)); idraw->drawLine(o1,o1+a0*10,btVector3(0,1,1));
idraw->drawLine(o1,o1+a1*10,btVector3(0,1,1)); idraw->drawLine(o1,o1+a1*10,btVector3(0,1,1));
break;
} }
default:
{
}
} }
} }
} }

View File

@@ -1156,7 +1156,7 @@ void HullLibrary::BringOutYourDead(const btVector3* verts,unsigned int vcount, b
for (int k=0;k<m_vertexIndexMapping.size();k++) for (int k=0;k<m_vertexIndexMapping.size();k++)
{ {
if (tmpIndices[k]==v) if (tmpIndices[k]==int(v))
m_vertexIndexMapping[k]=ocount; m_vertexIndexMapping[k]=ocount;
} }

View File

@@ -1,6 +1,6 @@
/* /*
/*************************************************************************************************** ***************************************************************************************************
** **
** profile.cpp ** profile.cpp
** **

View File

@@ -180,7 +180,7 @@ protected:
} }
{ {
nr= (long)cp; nr= (long)cp;
long mask=3; // long mask=3;
nr= ((nr+3)&~3)-nr; nr= ((nr+3)&~3)-nr;
while (nr--) while (nr--)
{ {
@@ -214,7 +214,7 @@ protected:
{ {
nr= (long)cp; nr= (long)cp;
long mask=3; // long mask=3;
nr= ((nr+3)&~3)-nr; nr= ((nr+3)&~3)-nr;
while (nr--) while (nr--)
{ {