fix padding in btSolverConstraint, see Issue 650
fix some warnings
This commit is contained in:
@@ -47,7 +47,7 @@ namespace
|
||||
int framePeriod;//todo: test if this value should be 0
|
||||
int mainWindow;
|
||||
GLUI *glui;
|
||||
float hz;
|
||||
//float hz;
|
||||
float viewZoom=20.f;
|
||||
float viewX;
|
||||
float viewY;
|
||||
|
||||
@@ -114,7 +114,7 @@ void Box2dDemo::initPhysics()
|
||||
toggle = m_dialogDynamicsWorld->createToggle(settings,"Toggle 2");
|
||||
toggle ->m_active = true;
|
||||
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_TextControl* txt = new GL_TextControl;
|
||||
|
||||
@@ -49,7 +49,7 @@ void CcdPhysicsDemo::clientMoveAndDisplay()
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
//simple dynamics world doesn't handle fixed-time-stepping
|
||||
float ms = getDeltaTimeMicroseconds();
|
||||
//float ms = getDeltaTimeMicroseconds();
|
||||
|
||||
///step the simulation
|
||||
if (m_dynamicsWorld)
|
||||
|
||||
@@ -44,11 +44,11 @@ static int gJump = 0;
|
||||
|
||||
CharacterDemo::CharacterDemo()
|
||||
:
|
||||
m_indexVertexArrays(0),
|
||||
m_vertices(0),
|
||||
m_cameraHeight(4.f),
|
||||
m_minCameraDistance(3.f),
|
||||
m_maxCameraDistance(10.f),
|
||||
m_indexVertexArrays(0),
|
||||
m_vertices(0)
|
||||
m_maxCameraDistance(10.f)
|
||||
{
|
||||
m_character = 0;
|
||||
m_cameraPosition = btVector3(30,30,30);
|
||||
|
||||
@@ -246,8 +246,8 @@ void CollisionInterfaceDemo::displayCallback(void) {
|
||||
//GL_ShapeDrawer::drawCoordSystem();
|
||||
|
||||
|
||||
btQuaternion qA = objects[0].getWorldTransform().getRotation();
|
||||
btQuaternion qB = objects[1].getWorldTransform().getRotation();
|
||||
// btQuaternion qA = objects[0].getWorldTransform().getRotation();
|
||||
// btQuaternion qB = objects[1].getWorldTransform().getRotation();
|
||||
|
||||
|
||||
if (!m_idle)
|
||||
|
||||
@@ -92,7 +92,7 @@ public:
|
||||
this->min_y = min_y;
|
||||
this->max_y = max_y;
|
||||
sign = 1.0;
|
||||
btScalar dalpha = 2*SIMD_2_PI/NUMRAYS_IN_BAR;
|
||||
// btScalar dalpha = 2*SIMD_2_PI/NUMRAYS_IN_BAR;
|
||||
for (int i = 0; i < NUMRAYS_IN_BAR; i++)
|
||||
{
|
||||
btScalar z = (max_z-min_z)/NUMRAYS_IN_BAR * i + min_z;
|
||||
|
||||
@@ -127,7 +127,7 @@ void ConstraintDemo::initPhysics()
|
||||
btRigidBody* body0 = localCreateRigidBody( mass,trans,shape);
|
||||
trans.setOrigin(btVector3(2*CUBE_HALF_EXTENTS,20,0));
|
||||
mass = 1.f;
|
||||
btRigidBody* body1 = 0;//localCreateRigidBody( mass,trans,shape);
|
||||
// btRigidBody* body1 = 0;//localCreateRigidBody( mass,trans,shape);
|
||||
btVector3 pivotInA(CUBE_HALF_EXTENTS,CUBE_HALF_EXTENTS,0);
|
||||
btTypedConstraint* p2p = new btPoint2PointConstraint(*body0,pivotInA);
|
||||
m_dynamicsWorld->addConstraint(p2p);
|
||||
@@ -145,7 +145,7 @@ void ConstraintDemo::initPhysics()
|
||||
trans.setOrigin(btVector3(2*CUBE_HALF_EXTENTS,20,0));
|
||||
|
||||
mass = 1.f;
|
||||
btRigidBody* body1 = 0;//localCreateRigidBody( mass,trans,shape);
|
||||
// btRigidBody* body1 = 0;//localCreateRigidBody( mass,trans,shape);
|
||||
// btRigidBody* body1 = localCreateRigidBody( 0.0,trans,0);
|
||||
//body1->setActivationState(DISABLE_DEACTIVATION);
|
||||
//body1->setDamping(0.3,0.3);
|
||||
@@ -153,9 +153,9 @@ void ConstraintDemo::initPhysics()
|
||||
btVector3 pivotInA(CUBE_HALF_EXTENTS,-CUBE_HALF_EXTENTS,-CUBE_HALF_EXTENTS);
|
||||
btVector3 axisInA(0,0,1);
|
||||
|
||||
btVector3 pivotInB = body1 ? body1->getCenterOfMassTransform().inverse()(body0->getCenterOfMassTransform()(pivotInA)) : pivotInA;
|
||||
btVector3 axisInB = body1?
|
||||
(body1->getCenterOfMassTransform().getBasis().inverse()*(body1->getCenterOfMassTransform().getBasis() * axisInA)) :
|
||||
// btVector3 pivotInB = body1 ? body1->getCenterOfMassTransform().inverse()(body0->getCenterOfMassTransform()(pivotInA)) : pivotInA;
|
||||
// btVector3 axisInB = body1?
|
||||
// (body1->getCenterOfMassTransform().getBasis().inverse()*(body1->getCenterOfMassTransform().getBasis() * axisInA)) :
|
||||
body0->getCenterOfMassTransform().getBasis() * axisInA;
|
||||
|
||||
#define P2P
|
||||
|
||||
@@ -29,7 +29,7 @@ void btFractureDynamicsWorld::glueCallback()
|
||||
for (i=0;i<getCollisionObjectArray().size(); i++)
|
||||
{
|
||||
btCollisionObject* collisionObject= getCollisionObjectArray()[i];
|
||||
btRigidBody* body = btRigidBody::upcast(collisionObject);
|
||||
// btRigidBody* body = btRigidBody::upcast(collisionObject);
|
||||
//Adding filtering here
|
||||
#ifdef STATIC_SIMULATION_ISLAND_OPTIMIZATION
|
||||
if (!collisionObject->isStaticOrKinematicObject())
|
||||
@@ -68,8 +68,8 @@ void btFractureDynamicsWorld::glueCallback()
|
||||
btCollisionObject* colObj1 = (btCollisionObject*)manifold->getBody1();
|
||||
int tag0 = (colObj0)->getIslandTag();
|
||||
int tag1 = (colObj1)->getIslandTag();
|
||||
btRigidBody* body0 = btRigidBody::upcast(colObj0);
|
||||
btRigidBody* body1 = btRigidBody::upcast(colObj1);
|
||||
//btRigidBody* body0 = btRigidBody::upcast(colObj0);
|
||||
//btRigidBody* body1 = btRigidBody::upcast(colObj1);
|
||||
|
||||
|
||||
if (!colObj0->isStaticOrKinematicObject() && !colObj1->isStaticOrKinematicObject())
|
||||
@@ -410,7 +410,7 @@ void btFractureDynamicsWorld::breakDisconnectedParts( btFractureBody* fracObj)
|
||||
{
|
||||
}
|
||||
|
||||
int fractureObjectIndex = -1;
|
||||
// int fractureObjectIndex = -1;
|
||||
|
||||
int numShapes=0;
|
||||
|
||||
@@ -422,7 +422,7 @@ void btFractureDynamicsWorld::breakDisconnectedParts( btFractureBody* fracObj)
|
||||
for (idx=startIslandIndex;idx<endIslandIndex;idx++)
|
||||
{
|
||||
int i = unionFind.getElement(idx).m_sz;
|
||||
btCollisionShape* shape = compound->getChildShape(i);
|
||||
// btCollisionShape* shape = compound->getChildShape(i);
|
||||
newCompound->addChildShape(compound->getChildTransform(i),compound->getChildShape(i));
|
||||
masses.push_back(fracObj->m_masses[i]);
|
||||
numShapes++;
|
||||
|
||||
@@ -160,8 +160,8 @@ void MultiMaterialDemo::initPhysics()
|
||||
|
||||
int vertStride = sizeof(btVector3);
|
||||
int indexStride = 3*sizeof(int);
|
||||
int materialStride = sizeof(CustomMaterial);
|
||||
int triangleMaterialStride = sizeof(int);
|
||||
// int materialStride = sizeof(CustomMaterial);
|
||||
// int triangleMaterialStride = sizeof(int);
|
||||
|
||||
gVertices = new btVector3[totalVerts];
|
||||
gIndices = new int[totalTriangles*3];
|
||||
|
||||
@@ -176,7 +176,7 @@ void MultiThreadedDemo::clientMoveAndDisplay()
|
||||
|
||||
|
||||
|
||||
float dt = getDeltaTimeMicroseconds() * 0.000001f;
|
||||
// float dt = getDeltaTimeMicroseconds() * 0.000001f;
|
||||
|
||||
// printf("dt = %f: ",dt);
|
||||
|
||||
|
||||
@@ -12,6 +12,10 @@ GLDebugDrawer::GLDebugDrawer()
|
||||
|
||||
}
|
||||
|
||||
GLDebugDrawer::~GLDebugDrawer()
|
||||
{
|
||||
}
|
||||
|
||||
void GLDebugDrawer::drawLine(const btVector3& from,const btVector3& to,const btVector3& fromColor, const btVector3& toColor)
|
||||
{
|
||||
glBegin(GL_LINES);
|
||||
|
||||
@@ -12,7 +12,7 @@ class GLDebugDrawer : public btIDebugDraw
|
||||
public:
|
||||
|
||||
GLDebugDrawer();
|
||||
|
||||
virtual ~GLDebugDrawer();
|
||||
|
||||
virtual void drawLine(const btVector3& from,const btVector3& to,const btVector3& fromColor, const btVector3& toColor);
|
||||
|
||||
|
||||
@@ -34,6 +34,10 @@ GL_Simplex1to4::GL_Simplex1to4()
|
||||
{
|
||||
}
|
||||
|
||||
GL_Simplex1to4::~GL_Simplex1to4()
|
||||
{
|
||||
}
|
||||
|
||||
///
|
||||
/// Debugging method calcClosest calculates the closest point to the origin, using m_simplexSolver
|
||||
///
|
||||
|
||||
@@ -28,6 +28,7 @@ class GL_Simplex1to4 : public btBU_Simplex1to4
|
||||
public:
|
||||
|
||||
GL_Simplex1to4();
|
||||
virtual ~GL_Simplex1to4();
|
||||
|
||||
void calcClosest(btScalar* m);
|
||||
|
||||
|
||||
@@ -1402,7 +1402,6 @@ static uint8 *resample_row_generic(uint8 *out, uint8 *in_near, uint8 *in_far, in
|
||||
{
|
||||
// resample with nearest-neighbor
|
||||
int i,j;
|
||||
in_far = in_far;
|
||||
for (i=0; i < w; ++i)
|
||||
for (j=0; j < hs; ++j)
|
||||
out[i*hs+j] = in_near[i];
|
||||
|
||||
@@ -631,8 +631,8 @@ void btParticlesDynamicsWorld::runCollideParticlesKernel()
|
||||
{
|
||||
btAlignedObjectArray<int> pairs;
|
||||
|
||||
float particleRad = m_simParams.m_particleRad;
|
||||
float collideDist2 = (particleRad + particleRad)*(particleRad + particleRad);
|
||||
// float particleRad = m_simParams.m_particleRad;
|
||||
// float collideDist2 = (particleRad + particleRad)*(particleRad + particleRad);
|
||||
cl_int ciErrNum;
|
||||
if(m_useCpuControls[SIMSTAGE_COLLIDE_PARTICLES]->m_active)
|
||||
{ // CPU version
|
||||
|
||||
@@ -227,7 +227,7 @@ bool Raytracer::worldRaytest(const btVector3& rayFrom,const btVector3& rayTo,btV
|
||||
bool Raytracer::singleObjectRaytest(const btVector3& rayFrom,const btVector3& rayTo,btVector3& worldNormal,btVector3& worldHitPoint)
|
||||
{
|
||||
|
||||
btScalar closestHitResults = 1.f;
|
||||
// btScalar closestHitResults = 1.f;
|
||||
|
||||
btCollisionWorld::ClosestRayResultCallback resultCallback(rayFrom,rayTo);
|
||||
|
||||
@@ -478,7 +478,9 @@ void Raytracer::displayCallback()
|
||||
rgba[3] = 1.f;
|
||||
raytracePicture->setPixel(x,y,rgba);
|
||||
} else
|
||||
btVector4 rgba = raytracePicture->getPixel(x,y);
|
||||
{
|
||||
// btVector4 rgba = raytracePicture->getPixel(x,y);
|
||||
}
|
||||
if (!rgba.length2())
|
||||
{
|
||||
raytracePicture->setPixel(x,y,btVector4(1,1,1,1));
|
||||
|
||||
@@ -98,8 +98,8 @@ void SerializeDemo::keyboardCallback(unsigned char key, int x, int y)
|
||||
|
||||
btCollisionObject* colObj0 = (btCollisionObject*)manifold->getBody0();
|
||||
btCollisionObject* colObj1 = (btCollisionObject*)manifold->getBody1();
|
||||
int tag0 = (colObj0)->getIslandTag();
|
||||
int tag1 = (colObj1)->getIslandTag();
|
||||
// int tag0 = (colObj0)->getIslandTag();
|
||||
// int tag1 = (colObj1)->getIslandTag();
|
||||
btRigidBody* body0 = btRigidBody::upcast(colObj0);
|
||||
btRigidBody* body1 = btRigidBody::upcast(colObj1);
|
||||
if (bodies.findLinearSearch(body0)==bodies.size())
|
||||
|
||||
@@ -755,7 +755,7 @@ cl_kernel btOpenCLUtils::compileCLKernelFromString(cl_context clContext, cl_devi
|
||||
printf("compiling kernel %s ",kernelName);
|
||||
cl_kernel kernel;
|
||||
cl_int localErrNum;
|
||||
size_t program_length = strlen(kernelSource);
|
||||
//size_t program_length = strlen(kernelSource);
|
||||
|
||||
|
||||
cl_program m_cpProgram = prog;
|
||||
|
||||
@@ -55,7 +55,7 @@ April 24, 2008
|
||||
#endif
|
||||
|
||||
static btPoint2PointConstraint* spP2PConst;
|
||||
static btHingeConstraint* spHingeConst;
|
||||
//static btHingeConstraint* spHingeConst;
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ static btRigidBody* staticBody = 0;
|
||||
static float waveheight = 5.f;
|
||||
|
||||
const float TRIANGLE_SIZE=8.f;
|
||||
unsigned int current_demo=20;
|
||||
int current_demo=20;
|
||||
#define DEMO_MODE_TIMEOUT 15.f //15 seconds for each demo
|
||||
|
||||
|
||||
@@ -1663,7 +1663,7 @@ void SoftDemo::clientMoveAndDisplay()
|
||||
|
||||
#else
|
||||
//during idle mode, just run 1 simulation step maximum, otherwise 4 at max
|
||||
int maxSimSubSteps = m_idle ? 1 : 4;
|
||||
// int maxSimSubSteps = m_idle ? 1 : 4;
|
||||
//if (m_idle)
|
||||
// dt = 1.0/420.f;
|
||||
|
||||
@@ -1743,10 +1743,10 @@ void SoftDemo::renderme()
|
||||
glDisable(GL_LIGHTING);
|
||||
m_dynamicsWorld->debugDrawWorld();
|
||||
|
||||
int debugMode = m_dynamicsWorld->getDebugDrawer()? m_dynamicsWorld->getDebugDrawer()->getDebugMode() : -1;
|
||||
//int debugMode = m_dynamicsWorld->getDebugDrawer()? m_dynamicsWorld->getDebugDrawer()->getDebugMode() : -1;
|
||||
|
||||
btSoftRigidDynamicsWorld* softWorld = (btSoftRigidDynamicsWorld*)m_dynamicsWorld;
|
||||
btIDebugDraw* sdraw = softWorld ->getDebugDrawer();
|
||||
//btIDebugDraw* sdraw = softWorld ->getDebugDrawer();
|
||||
|
||||
|
||||
for ( int i=0;i<softWorld->getSoftBodyArray().size();i++)
|
||||
|
||||
@@ -223,8 +223,8 @@ int main(int argc, char **argv)
|
||||
const char* cSourceFile = "VectorAddKernels.cl";
|
||||
|
||||
printf("loadProgSource (%s)...\n", cSourceFile);
|
||||
const char* cPathAndName = cSourceFile;
|
||||
#ifdef LOAD_FROM_FILE
|
||||
const char* cPathAndName = cSourceFile;
|
||||
size_t szKernelLength;
|
||||
const char* cSourceCL = loadProgSource(cPathAndName, "", &szKernelLength);
|
||||
#else
|
||||
|
||||
@@ -65,8 +65,8 @@ void VoronoiFractureDemo::attachFixedConstraints()
|
||||
|
||||
btCollisionObject* colObj0 = (btCollisionObject*)manifold->getBody0();
|
||||
btCollisionObject* colObj1 = (btCollisionObject*)manifold->getBody1();
|
||||
int tag0 = (colObj0)->getIslandTag();
|
||||
int tag1 = (colObj1)->getIslandTag();
|
||||
// int tag0 = (colObj0)->getIslandTag();
|
||||
// int tag1 = (colObj1)->getIslandTag();
|
||||
btRigidBody* body0 = btRigidBody::upcast(colObj0);
|
||||
btRigidBody* body1 = btRigidBody::upcast(colObj1);
|
||||
if (bodies.findLinearSearch(body0)==bodies.size())
|
||||
|
||||
Reference in New Issue
Block a user