Cleanup compilation warnings.

This commit is contained in:
sjbaker
2008-02-12 04:22:31 +00:00
parent 05877799af
commit 04d41b7a0a
15 changed files with 53 additions and 26 deletions

View File

@@ -385,7 +385,7 @@ static GLfloat floorShadow[4][4];
static void static void
redraw(void) redraw(void)
{ {
int start, end; int start = 0, end = 0 ;
if (reportSpeed) { if (reportSpeed) {
start = glutGet(GLUT_ELAPSED_TIME); start = glutGet(GLUT_ELAPSED_TIME);

View File

@@ -138,7 +138,7 @@ void ConvexDecompositionDemo::initPhysics(const char* filename)
std::vector<btVector3> vertices; std::vector<btVector3> vertices;
if ( 1 ) if ( 1 )
{ {
const unsigned int *src = result.mHullIndices; //const unsigned int *src = result.mHullIndices;
for (unsigned int i=0; i<result.mHullVcount; i++) for (unsigned int i=0; i<result.mHullVcount; i++)
{ {
btVector3 vertex(result.mHullVertices[i*3],result.mHullVertices[i*3+1],result.mHullVertices[i*3+2]); btVector3 vertex(result.mHullVertices[i*3],result.mHullVertices[i*3+1],result.mHullVertices[i*3+2]);
@@ -152,7 +152,7 @@ void ConvexDecompositionDemo::initPhysics(const char* filename)
if ( 1 ) if ( 1 )
{ {
const unsigned int *src = result.mHullIndices; //const unsigned int *src = result.mHullIndices;
for (unsigned int i=0; i<result.mHullVcount; i++) for (unsigned int i=0; i<result.mHullVcount; i++)
{ {
btVector3 vertex(result.mHullVertices[i*3],result.mHullVertices[i*3+1],result.mHullVertices[i*3+2]); btVector3 vertex(result.mHullVertices[i*3],result.mHullVertices[i*3+1],result.mHullVertices[i*3+2]);
@@ -197,7 +197,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:
//#define SHRINK_OBJECT_INWARDS 1 //#define SHRINK_OBJECT_INWARDS 1

View File

@@ -300,7 +300,7 @@ static bool TestEPA(const MyConvex& hull0, const MyConvex& hull1)
#endif #endif
btConvexPenetrationDepthSolver* Solver; btConvexPenetrationDepthSolver* Solver = NULL ;
if(gMethod==0) if(gMethod==0)
Solver = &Solver0; Solver = &Solver0;
else if(gMethod==1) else if(gMethod==1)

View File

@@ -431,7 +431,6 @@ void DemoApplication::shootBox(const btVector3& destination)
if (m_dynamicsWorld) if (m_dynamicsWorld)
{ {
bool isDynamic = true;
float mass = 1.f; float mass = 1.f;
btTransform startTransform; btTransform startTransform;
startTransform.setIdentity(); startTransform.setIdentity();
@@ -851,14 +850,11 @@ void DemoApplication::renderme()
//bool useBulletLCP = !(getDebugMode() & btIDebugDraw::DBG_DisableBulletLCP); //bool useBulletLCP = !(getDebugMode() & btIDebugDraw::DBG_DisableBulletLCP);
//bool useCCD = (getDebugMode() & btIDebugDraw::DBG_EnableCCD);
bool useCCD = (getDebugMode() & btIDebugDraw::DBG_EnableCCD); //glRasterPos3f(xOffset,yStart,0);
//sprintf(buf,"1 CCD mode (adhoc) = %i",useCCD);
/* glRasterPos3f(xOffset,yStart,0); //BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf);
sprintf(buf,"1 CCD mode (adhoc) = %i",useCCD); //yStart += yIncr;
BMF_DrawString(BMF_GetFont(BMF_kHelvetica10),buf);
yStart += yIncr;
*/
glRasterPos3f(xOffset,yStart,0); glRasterPos3f(xOffset,yStart,0);

View File

@@ -93,4 +93,5 @@ void GLDebugDrawer::drawAabb(const btVector3& from,const btVector3& to,const btV
} }
} }

View File

@@ -1389,7 +1389,7 @@ Last column is added as the position
*/ */
#define ADJOINT_4X4(a,m) \ #define ADJOINT_4X4(a,m) \
{ \ { \
char _i_,_j_; \ int _i_,_j_; \
\ \
for (_i_=0; _i_<4; _i_++) { \ for (_i_=0; _i_<4; _i_++) { \
for (_j_=0; _j_<4; _j_++) { \ for (_j_=0; _j_<4; _j_++) { \

View File

@@ -74,6 +74,7 @@ void btGIMPACTMeshData::addMeshPart(btStridingMeshInterface* meshInterface, int
int_type = G_STYPE_INT; int_type = G_STYPE_INT;
break; break;
case PHY_SHORT: case PHY_SHORT:
default :
int_type = G_STYPE_SHORT; int_type = G_STYPE_SHORT;
break; break;
} }
@@ -85,6 +86,7 @@ void btGIMPACTMeshData::addMeshPart(btStridingMeshInterface* meshInterface, int
vert_type = G_STYPE_REAL; vert_type = G_STYPE_REAL;
break; break;
case PHY_DOUBLE: case PHY_DOUBLE:
default :
vert_type = G_STYPE_REAL2; vert_type = G_STYPE_REAL2;
break; break;
} }

View File

@@ -170,25 +170,35 @@ FrameBufferObject::FrameBufferObject ( int _width ,
break ; break ;
} }
fprintf(stderr,"@a\n" ) ;
glGenTextures ( 1, & textureHandle ) ; glGenTextures ( 1, & textureHandle ) ;
fprintf(stderr,"@b\n" ) ;
glBindTexture ( GL_TEXTURE_2D, textureHandle ) ; glBindTexture ( GL_TEXTURE_2D, textureHandle ) ;
fprintf(stderr,"@c\n" ) ;
glTexParameterf ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ) ; glTexParameterf ( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST ) ;
fprintf(stderr,"@d\n" ) ;
glTexParameterf ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ) ; glTexParameterf ( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST ) ;
fprintf(stderr,"@e\n" ) ;
//glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ) ; //glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE ) ;
//glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ) ; //glTexParameteri ( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE ) ;
fillTexture ( (void *) NULL ) ; fillTexture ( (void *) NULL ) ;
fprintf(stderr,"@f\n" ) ;
glGenFramebuffersEXT ( 1, & fboHandle ) ; glGenFramebuffersEXT ( 1, & fboHandle ) ;
fprintf(stderr,"@g\n" ) ;
glBindFramebufferEXT ( GL_FRAMEBUFFER_EXT, fboHandle ) ; glBindFramebufferEXT ( GL_FRAMEBUFFER_EXT, fboHandle ) ;
fprintf(stderr,"@h\n" ) ;
glFramebufferTexture2DEXT ( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT, glFramebufferTexture2DEXT ( GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0_EXT,
GL_TEXTURE_2D, textureHandle, 0 ) ; GL_TEXTURE_2D, textureHandle, 0 ) ;
fprintf(stderr,"@i\n" ) ;
#ifdef NEED_DEPTH_BUFFER #ifdef NEED_DEPTH_BUFFER
static GLuint depth_rb = 0 ; static GLuint depth_rb = 0 ;
if ( depth_rb == 0 ) if ( depth_rb == 0 )
{ {
fprintf(stderr,"@j\n" ) ;
glGenRenderbuffersEXT ( 1, & depth_rb ) ; glGenRenderbuffersEXT ( 1, & depth_rb ) ;
glBindRenderbufferEXT ( GL_RENDERBUFFER_EXT, depth_rb ) ; glBindRenderbufferEXT ( GL_RENDERBUFFER_EXT, depth_rb ) ;
glRenderbufferStorageEXT ( GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24, glRenderbufferStorageEXT ( GL_RENDERBUFFER_EXT, GL_DEPTH_COMPONENT24,
@@ -197,13 +207,19 @@ FrameBufferObject::FrameBufferObject ( int _width ,
GL_RENDERBUFFER_EXT, depth_rb ) ; GL_RENDERBUFFER_EXT, depth_rb ) ;
} }
else else
{
fprintf(stderr,"@k\n" ) ;
glFramebufferRenderbufferEXT ( GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT, glFramebufferRenderbufferEXT ( GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, depth_rb ) ; GL_RENDERBUFFER_EXT, depth_rb ) ;
}
#else #else
fprintf(stderr,"@l\n" ) ;
glDisable ( GL_DEPTH_TEST ) ; glDisable ( GL_DEPTH_TEST ) ;
glDepthMask ( 0 ) ; glDepthMask ( 0 ) ;
fprintf(stderr,"@m\n" ) ;
glFramebufferRenderbufferEXT ( GL_FRAMEBUFFER_EXT , GL_DEPTH_ATTACHMENT_EXT, glFramebufferRenderbufferEXT ( GL_FRAMEBUFFER_EXT , GL_DEPTH_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, 0 ) ; GL_RENDERBUFFER_EXT, 0 ) ;
fprintf(stderr,"@n\n" ) ;
#endif #endif
#ifdef NEED_STENCIL_BUFFER #ifdef NEED_STENCIL_BUFFER
@@ -211,6 +227,7 @@ FrameBufferObject::FrameBufferObject ( int _width ,
if ( stencil_rb == 0 ) if ( stencil_rb == 0 )
{ {
fprintf(stderr,"@o\n" ) ;
glGenRenderbuffersEXT ( 1, & stencil_rb ) ; glGenRenderbuffersEXT ( 1, & stencil_rb ) ;
glBindRenderbufferEXT ( GL_RENDERBUFFER_EXT, stencil_rb ) ; glBindRenderbufferEXT ( GL_RENDERBUFFER_EXT, stencil_rb ) ;
glRenderbufferStorageEXT ( GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX, glRenderbufferStorageEXT ( GL_RENDERBUFFER_EXT, GL_STENCIL_INDEX,
@@ -222,16 +239,21 @@ FrameBufferObject::FrameBufferObject ( int _width ,
glFramebufferRenderbufferEXT ( GL_FRAMEBUFFER_EXT , GL_STENCIL_ATTACHMENT_EXT, glFramebufferRenderbufferEXT ( GL_FRAMEBUFFER_EXT , GL_STENCIL_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, stencil_rb ) ; GL_RENDERBUFFER_EXT, stencil_rb ) ;
#else #else
fprintf(stderr,"@p\n" ) ;
glDisable ( GL_STENCIL_TEST ) ; glDisable ( GL_STENCIL_TEST ) ;
glStencilMask ( 0 ) ; glStencilMask ( 0 ) ;
fprintf(stderr,"@q\n" ) ;
glFramebufferRenderbufferEXT ( GL_FRAMEBUFFER_EXT , GL_STENCIL_ATTACHMENT_EXT, glFramebufferRenderbufferEXT ( GL_FRAMEBUFFER_EXT , GL_STENCIL_ATTACHMENT_EXT,
GL_RENDERBUFFER_EXT, 0 ) ; GL_RENDERBUFFER_EXT, 0 ) ;
fprintf(stderr,"@r\n" ) ;
#endif #endif
// Check framebuffer completeness at the end of initialization. // Check framebuffer completeness at the end of initialization.
checkFrameBufferStatus () ; checkFrameBufferStatus () ;
fprintf(stderr,"@s\n" ) ;
restoreFrameBuffer () ; restoreFrameBuffer () ;
fprintf(stderr,"@t\n" ) ;
} }

View File

@@ -45,4 +45,5 @@ private:
}; };
#endif //SPHERE_TRIANGLE_DETECTOR_H #endif //SPHERE_TRIANGLE_DETECTOR_H

View File

@@ -282,4 +282,5 @@ float btConvexConvexAlgorithm::calculateTimeOfImpact(btCollisionObject* col0,btC
return resultFraction; return resultFraction;
} }

View File

@@ -39,3 +39,4 @@ void btTriangleBuffer::processTriangle(btVector3* triangle,int partId,int trian
m_triangleBuffer.push_back(tri); m_triangleBuffer.push_back(tri);
} }

View File

@@ -57,4 +57,5 @@ public:
}; };
#endif //BT_TRIANGLE_BUFFER_H #endif //BT_TRIANGLE_BUFFER_H

View File

@@ -104,7 +104,7 @@ float resolveSingleCollision(
btScalar Kfps = 1.f / solverInfo.m_timeStep ; btScalar Kfps = 1.f / solverInfo.m_timeStep ;
float damping = solverInfo.m_damping ; // float damping = solverInfo.m_damping ;
float Kerp = solverInfo.m_erp; float Kerp = solverInfo.m_erp;
float Kcor = Kerp *Kfps; float Kcor = Kerp *Kfps;
@@ -136,7 +136,7 @@ float resolveSingleCollision(
{ {
body2.internalApplyImpulse(contactPoint.m_normalWorldOnB*body2.getInvMass(),cpd->m_angularComponentB,-normalImpulse); body2.internalApplyImpulse(contactPoint.m_normalWorldOnB*body2.getInvMass(),cpd->m_angularComponentB,-normalImpulse);
} }
#else USE_INTERNAL_APPLY_IMPULSE #else //USE_INTERNAL_APPLY_IMPULSE
body1.applyImpulse(normal*(normalImpulse), rel_pos1); body1.applyImpulse(normal*(normalImpulse), rel_pos1);
body2.applyImpulse(-normal*(normalImpulse), rel_pos2); body2.applyImpulse(-normal*(normalImpulse), rel_pos2);
#endif //USE_INTERNAL_APPLY_IMPULSE #endif //USE_INTERNAL_APPLY_IMPULSE
@@ -215,7 +215,7 @@ float resolveSingleFriction(
body2.internalApplyImpulse(cpd->m_frictionWorldTangential0*body2.getInvMass(),cpd->m_frictionAngularComponent0B,-j1); body2.internalApplyImpulse(cpd->m_frictionWorldTangential0*body2.getInvMass(),cpd->m_frictionAngularComponent0B,-j1);
body2.internalApplyImpulse(cpd->m_frictionWorldTangential1*body2.getInvMass(),cpd->m_frictionAngularComponent1B,-j2); body2.internalApplyImpulse(cpd->m_frictionWorldTangential1*body2.getInvMass(),cpd->m_frictionAngularComponent1B,-j2);
} }
#else USE_INTERNAL_APPLY_IMPULSE #else //USE_INTERNAL_APPLY_IMPULSE
body1.applyImpulse((j1 * cpd->m_frictionWorldTangential0)+(j2 * cpd->m_frictionWorldTangential1), rel_pos1); body1.applyImpulse((j1 * cpd->m_frictionWorldTangential0)+(j2 * cpd->m_frictionWorldTangential1), rel_pos1);
body2.applyImpulse((j1 * -cpd->m_frictionWorldTangential0)+(j2 * -cpd->m_frictionWorldTangential1), rel_pos2); body2.applyImpulse((j1 * -cpd->m_frictionWorldTangential0)+(j2 * -cpd->m_frictionWorldTangential1), rel_pos2);
#endif //USE_INTERNAL_APPLY_IMPULSE #endif //USE_INTERNAL_APPLY_IMPULSE
@@ -317,7 +317,7 @@ float resolveSingleCollisionCombined(
btScalar Kfps = 1.f / solverInfo.m_timeStep ; btScalar Kfps = 1.f / solverInfo.m_timeStep ;
float damping = solverInfo.m_damping ; //float damping = solverInfo.m_damping ;
float Kerp = solverInfo.m_erp; float Kerp = solverInfo.m_erp;
float Kcor = Kerp *Kfps; float Kcor = Kerp *Kfps;
@@ -350,7 +350,7 @@ float resolveSingleCollisionCombined(
{ {
body2.internalApplyImpulse(contactPoint.m_normalWorldOnB*body2.getInvMass(),cpd->m_angularComponentB,-normalImpulse); body2.internalApplyImpulse(contactPoint.m_normalWorldOnB*body2.getInvMass(),cpd->m_angularComponentB,-normalImpulse);
} }
#else USE_INTERNAL_APPLY_IMPULSE #else //USE_INTERNAL_APPLY_IMPULSE
body1.applyImpulse(normal*(normalImpulse), rel_pos1); body1.applyImpulse(normal*(normalImpulse), rel_pos1);
body2.applyImpulse(-normal*(normalImpulse), rel_pos2); body2.applyImpulse(-normal*(normalImpulse), rel_pos2);
#endif //USE_INTERNAL_APPLY_IMPULSE #endif //USE_INTERNAL_APPLY_IMPULSE

View File

@@ -165,4 +165,5 @@ void btGeometryUtil::getVerticesFromPlaneEquations(const std::vector<btVector3>&
} }
} }
} }
} }

View File

@@ -36,4 +36,5 @@ class btGeometryUtil
}; };
#endif //BT_GEOMETRY_UTIL_H #endif //BT_GEOMETRY_UTIL_H