make Bullet compile on Visual Studio 6
This commit is contained in:
@@ -36,7 +36,7 @@ ADD_DEFINITIONS( -DUSE_GRAPHICAL_BENCHMARK)
|
||||
ENDIF (USE_GRAPHICAL_BENCHMARK)
|
||||
|
||||
IF (WIN32)
|
||||
OPTION(USE_GLUT "Use Glut" OFF)
|
||||
OPTION(USE_GLUT "Use Glut" ON)
|
||||
ADD_DEFINITIONS( -D_IRR_STATIC_LIB_ )
|
||||
ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
|
||||
ADD_DEFINITIONS( -D_CRT_SECURE_NO_DEPRECATE )
|
||||
|
||||
@@ -254,7 +254,7 @@ void CollisionInterfaceDemo::clientResetScene()
|
||||
{
|
||||
objects[0].getWorldTransform().setOrigin(btVector3(0.0f,3.f,0.f));
|
||||
|
||||
btQuaternion rotA(0.739,-0.204,0.587,0.257);
|
||||
btQuaternion rotA(0.739f,-0.204f,0.587f,0.257f);
|
||||
rotA.normalize();
|
||||
|
||||
objects[0].getWorldTransform().setRotation(rotA);
|
||||
|
||||
@@ -97,9 +97,9 @@ btScalar(0.)));
|
||||
// Setup some damping on the m_bodies
|
||||
for (int i = 0; i < BODYPART_COUNT; ++i)
|
||||
{
|
||||
m_bodies[i]->setDamping(0.05, 0.85);
|
||||
m_bodies[i]->setDeactivationTime(0.8);
|
||||
m_bodies[i]->setSleepingThresholds(1.6, 2.5);
|
||||
m_bodies[i]->setDamping(0.05f, 0.85f);
|
||||
m_bodies[i]->setDeactivationTime(0.8f);
|
||||
m_bodies[i]->setSleepingThresholds(1.6f, 2.5f);
|
||||
}
|
||||
|
||||
///////////////////////////// SETTING THE CONSTRAINTS /////////////////////////////////////////////7777
|
||||
@@ -191,7 +191,7 @@ btScalar(0.)));
|
||||
joint6DOF->setAngularUpperLimit(btVector3(SIMD_EPSILON,SIMD_EPSILON,SIMD_EPSILON));
|
||||
#else
|
||||
joint6DOF->setAngularLowerLimit(btVector3(-SIMD_EPSILON,-SIMD_EPSILON,-SIMD_EPSILON));
|
||||
joint6DOF->setAngularUpperLimit(btVector3(SIMD_PI*0.7,SIMD_EPSILON,SIMD_EPSILON));
|
||||
joint6DOF->setAngularUpperLimit(btVector3(SIMD_PI*0.7f,SIMD_EPSILON,SIMD_EPSILON));
|
||||
#endif
|
||||
m_joints[JOINT_LEFT_ELBOW] = joint6DOF;
|
||||
m_ownerWorld->addConstraint(m_joints[JOINT_LEFT_ELBOW], true);
|
||||
|
||||
@@ -110,7 +110,9 @@ void GL_DialogDynamicsWorld::setScreenSize(int width, int height)
|
||||
{
|
||||
|
||||
|
||||
for (int i=0;i<m_dynamicsWorld->getCollisionObjectArray().size();i++)
|
||||
int i;
|
||||
|
||||
for ( i=0;i<m_dynamicsWorld->getCollisionObjectArray().size();i++)
|
||||
{
|
||||
btCollisionObject* colObj = m_dynamicsWorld->getCollisionObjectArray()[i];
|
||||
btRigidBody* body = btRigidBody::upcast(colObj);
|
||||
@@ -129,7 +131,7 @@ void GL_DialogDynamicsWorld::setScreenSize(int width, int height)
|
||||
}
|
||||
}
|
||||
|
||||
for (int i=0;i<m_dialogs.size();i++)
|
||||
for ( i=0;i<m_dialogs.size();i++)
|
||||
{
|
||||
m_dialogs[i]->setScreenSize(width,height);
|
||||
}
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
# You shouldn't have to modify anything below this line
|
||||
########################################################
|
||||
|
||||
IF (USE_GLUT)
|
||||
|
||||
|
||||
INCLUDE_DIRECTORIES(
|
||||
@@ -25,3 +26,22 @@ ADD_EXECUTABLE(AppSoftBodyDemo
|
||||
SoftDemo.cpp
|
||||
)
|
||||
|
||||
IF (WIN32)
|
||||
IF (CMAKE_CL_64)
|
||||
ADD_CUSTOM_COMMAND(
|
||||
TARGET AppSoftBodyDemo
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/glut64.dll ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
ELSE(CMAKE_CL_64)
|
||||
ADD_CUSTOM_COMMAND(
|
||||
TARGET AppSoftBodyDemo
|
||||
POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/GLUT32.DLL ${CMAKE_CURRENT_BINARY_DIR}
|
||||
)
|
||||
ENDIF(CMAKE_CL_64)
|
||||
ENDIF(WIN32)
|
||||
|
||||
ELSE(USE_GLUT)
|
||||
|
||||
ENDIF (USE_GLUT)
|
||||
@@ -218,7 +218,7 @@ void SoftDemo::clientMoveAndDisplay()
|
||||
#endif //PRINT_CONTACT_STATISTICS
|
||||
|
||||
|
||||
glutSwapBuffers();
|
||||
swapBuffers();
|
||||
|
||||
}
|
||||
|
||||
@@ -232,7 +232,7 @@ void SoftDemo::displayCallback(void) {
|
||||
renderme();
|
||||
|
||||
glFlush();
|
||||
glutSwapBuffers();
|
||||
swapBuffers();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -19,7 +19,13 @@ subject to the following restrictions:
|
||||
#ifndef SOFT_DEMO_H
|
||||
#define SOFT_DEMO_H
|
||||
|
||||
#ifdef _WINDOWS
|
||||
#include "Win32DemoApplication.h"
|
||||
#define PlatformDemoApplication Win32DemoApplication
|
||||
#else
|
||||
#include "GlutDemoApplication.h"
|
||||
#define PlatformDemoApplication GlutDemoApplication
|
||||
#endif
|
||||
#include "LinearMath/btAlignedObjectArray.h"
|
||||
#include "BulletSoftBody/btSoftBody.h"
|
||||
|
||||
@@ -41,7 +47,7 @@ class btSoftRigidDynamicsWorld;
|
||||
|
||||
|
||||
///CcdPhysicsDemo shows basic stacking using Bullet physics, and allows toggle of Ccd (using key '1')
|
||||
class SoftDemo : public GlutDemoApplication
|
||||
class SoftDemo : public PlatformDemoApplication
|
||||
{
|
||||
public:
|
||||
|
||||
|
||||
@@ -177,7 +177,8 @@ void bDNA::initCmpFlags(bDNA *memDNA)
|
||||
|
||||
|
||||
|
||||
for (int i=0; i<(int)mStructs.size(); i++)
|
||||
int i;
|
||||
for ( i=0; i<(int)mStructs.size(); i++)
|
||||
{
|
||||
short *oldStruct = mStructs[i];
|
||||
|
||||
@@ -258,7 +259,7 @@ void bDNA::initCmpFlags(bDNA *memDNA)
|
||||
|
||||
|
||||
// recurse in
|
||||
for (int i=0; i<(int)mStructs.size(); i++)
|
||||
for ( i=0; i<(int)mStructs.size(); i++)
|
||||
{
|
||||
if (mCMPFlags[i] == FDF_STRUCT_NEQU)
|
||||
initRecurseCmpFlags(i);
|
||||
@@ -368,7 +369,8 @@ void bDNA::init(char *data, int len, bool swap)
|
||||
intPtr++;
|
||||
|
||||
cp = (char*)intPtr;
|
||||
for (int i=0; i<dataLen; i++)
|
||||
int i;
|
||||
for ( i=0; i<dataLen; i++)
|
||||
{
|
||||
bNameInfo info;
|
||||
info.m_name = cp;
|
||||
@@ -406,7 +408,7 @@ void bDNA::init(char *data, int len, bool swap)
|
||||
intPtr++;
|
||||
|
||||
cp = (char*)intPtr;
|
||||
for (int i=0; i<dataLen; i++)
|
||||
for ( i=0; i<dataLen; i++)
|
||||
{
|
||||
mTypes.push_back(cp);
|
||||
while (*cp)cp++;
|
||||
@@ -437,7 +439,7 @@ void bDNA::init(char *data, int len, bool swap)
|
||||
dataLen = (int)mTypes.size();
|
||||
|
||||
shtPtr = (short*)intPtr;
|
||||
for (int i=0; i<dataLen; i++, shtPtr++)
|
||||
for ( i=0; i<dataLen; i++, shtPtr++)
|
||||
{
|
||||
if (swap)
|
||||
shtPtr[0] = ChunkUtils::swapShort(shtPtr[0]);
|
||||
@@ -467,7 +469,7 @@ void bDNA::init(char *data, int len, bool swap)
|
||||
|
||||
|
||||
shtPtr = (short*)intPtr;
|
||||
for (int i=0; i<dataLen; i++)
|
||||
for ( i=0; i<dataLen; i++)
|
||||
{
|
||||
mStructs.push_back (shtPtr);
|
||||
if (swap)
|
||||
@@ -490,7 +492,7 @@ void bDNA::init(char *data, int len, bool swap)
|
||||
|
||||
|
||||
// build reverse lookups
|
||||
for (int i=0; i<(int)mStructs.size(); i++)
|
||||
for ( i=0; i<(int)mStructs.size(); i++)
|
||||
{
|
||||
short *strc = mStructs.at(i);
|
||||
if (!mPtrLen && strcmp(mTypes[strc[0]],"ListBase")==0)
|
||||
@@ -539,7 +541,7 @@ void bDNA::dumpTypeDefinitions()
|
||||
|
||||
}
|
||||
|
||||
for (int i=0; i<(int)mStructs.size(); i++)
|
||||
for ( i=0; i<(int)mStructs.size(); i++)
|
||||
{
|
||||
int totalBytes=0;
|
||||
short *oldStruct = mStructs[i];
|
||||
|
||||
@@ -855,14 +855,15 @@ void bFile::resolvePointersStructRecursive(char *strcPtr, int dna_nr, bool verbo
|
||||
dbPtr = &dbarray[0];
|
||||
if (dbPtr)
|
||||
{
|
||||
int i;
|
||||
getElement(arrayLen, newtype,memType, tmp, (char*)dbPtr);
|
||||
for (int i=0;i<recursion;i++)
|
||||
for (i=0;i<recursion;i++)
|
||||
printf(" ");
|
||||
if (arrayLen==1)
|
||||
printf("<%s type=\"%s\">",memName,memType);
|
||||
else
|
||||
printf("<%s type=\"%s\" count=%d>",memName,memType,arrayLen);
|
||||
for (int i=0;i<arrayLen;i++)
|
||||
for (i=0;i<arrayLen;i++)
|
||||
printf(" %d ",dbPtr[i]);
|
||||
printf("</%s>\n",memName);
|
||||
}
|
||||
@@ -875,14 +876,15 @@ void bFile::resolvePointersStructRecursive(char *strcPtr, int dna_nr, bool verbo
|
||||
dbPtr = &dbarray[0];
|
||||
if (dbPtr)
|
||||
{
|
||||
int i;
|
||||
getElement(arrayLen, newtype,memType, tmp, (char*)dbPtr);
|
||||
for (int i=0;i<recursion;i++)
|
||||
for (i=0;i<recursion;i++)
|
||||
printf(" ");
|
||||
if (arrayLen==1)
|
||||
printf("<%s type=\"%s\">",memName,memType);
|
||||
else
|
||||
printf("<%s type=\"%s\" count=%d>",memName,memType,arrayLen);
|
||||
for (int i=0;i<arrayLen;i++)
|
||||
for (i=0;i<arrayLen;i++)
|
||||
printf(" %f ",dbPtr[i]);
|
||||
printf("</%s>\n",memName);
|
||||
}
|
||||
|
||||
@@ -216,7 +216,8 @@ btCollisionShape* btBulletWorldImporter::convertCollisionShape( btCollisionShap
|
||||
btAlignedObjectArray<btScalar> radii;
|
||||
radii.resize(numSpheres);
|
||||
tmpPos.resize(numSpheres);
|
||||
for (int i=0;i<numSpheres;i++)
|
||||
int i;
|
||||
for ( i=0;i<numSpheres;i++)
|
||||
{
|
||||
tmpPos[i].deSerializeFloat(mss->m_localPositionArrayPtr[i].m_pos);
|
||||
radii[i] = mss->m_localPositionArrayPtr[i].m_radius;
|
||||
@@ -234,7 +235,8 @@ btCollisionShape* btBulletWorldImporter::convertCollisionShape( btCollisionShap
|
||||
|
||||
btAlignedObjectArray<btVector3> tmpPoints;
|
||||
tmpPoints.resize(numPoints);
|
||||
for (int i=0;i<numPoints;i++)
|
||||
int i;
|
||||
for ( i=0;i<numPoints;i++)
|
||||
{
|
||||
#ifdef BT_USE_DOUBLE_PRECISION
|
||||
if (convexData->m_unscaledPointsDoublePtr)
|
||||
@@ -249,7 +251,7 @@ btCollisionShape* btBulletWorldImporter::convertCollisionShape( btCollisionShap
|
||||
#endif //BT_USE_DOUBLE_PRECISION
|
||||
}
|
||||
btConvexHullShape* hullShape = createConvexHullShape();
|
||||
for (int i=0;i<numPoints;i++)
|
||||
for (i=0;i<numPoints;i++)
|
||||
{
|
||||
hullShape->addPoint(tmpPoints[i]);
|
||||
}
|
||||
|
||||
@@ -135,14 +135,13 @@ static int ClipSegmentToLine(ClipVertex vOut[2], ClipVertex vIn[2],
|
||||
static btScalar EdgeSeparation(const btBox2dShape* poly1, const btTransform& xf1, int edge1,
|
||||
const btBox2dShape* poly2, const btTransform& xf2)
|
||||
{
|
||||
//int count1 = poly1->getVertexCount();
|
||||
const btVector3* vertices1 = poly1->getVertices();
|
||||
const btVector3* normals1 = poly1->getNormals();
|
||||
|
||||
int count2 = poly2->getVertexCount();
|
||||
const btVector3* vertices2 = poly2->getVertices();
|
||||
|
||||
btAssert(0 <= edge1 && edge1 < count1);
|
||||
btAssert(0 <= edge1 && edge1 < poly1->getVertexCount());
|
||||
|
||||
// Convert normal from poly1's frame into poly2's frame.
|
||||
btVector3 normal1World = b2Mul(xf1.getBasis(), normals1[edge1]);
|
||||
@@ -271,14 +270,13 @@ static void FindIncidentEdge(ClipVertex c[2],
|
||||
const btBox2dShape* poly1, const btTransform& xf1, int edge1,
|
||||
const btBox2dShape* poly2, const btTransform& xf2)
|
||||
{
|
||||
//int count1 = poly1->getVertexCount();
|
||||
const btVector3* normals1 = poly1->getNormals();
|
||||
|
||||
int count2 = poly2->getVertexCount();
|
||||
const btVector3* vertices2 = poly2->getVertices();
|
||||
const btVector3* normals2 = poly2->getNormals();
|
||||
|
||||
btAssert(0 <= edge1 && edge1 < count1);
|
||||
btAssert(0 <= edge1 && edge1 < poly1->getVertexCount());
|
||||
|
||||
// Get the normal of the reference edge in poly2's frame.
|
||||
btVector3 normal1 = b2MulT(xf2.getBasis(), b2Mul(xf1.getBasis(), normals1[edge1]));
|
||||
|
||||
@@ -172,7 +172,8 @@ protected:
|
||||
intPtr++;
|
||||
|
||||
cp = (char*)intPtr;
|
||||
for (int i=0; i<dataLen; i++)
|
||||
int i;
|
||||
for ( i=0; i<dataLen; i++)
|
||||
{
|
||||
|
||||
while (*cp)cp++;
|
||||
@@ -204,8 +205,9 @@ protected:
|
||||
dataLen = *intPtr;
|
||||
intPtr++;
|
||||
|
||||
|
||||
cp = (char*)intPtr;
|
||||
for (int i=0; i<dataLen; i++)
|
||||
for (i=0; i<dataLen; i++)
|
||||
{
|
||||
mTypes.push_back(cp);
|
||||
while (*cp)cp++;
|
||||
@@ -236,7 +238,7 @@ protected:
|
||||
dataLen = (int)mTypes.size();
|
||||
|
||||
shtPtr = (short*)intPtr;
|
||||
for (int i=0; i<dataLen; i++, shtPtr++)
|
||||
for (i=0; i<dataLen; i++, shtPtr++)
|
||||
{
|
||||
if (!littleEndian)
|
||||
shtPtr[0] = btSwapEndian(shtPtr[0]);
|
||||
@@ -267,7 +269,7 @@ protected:
|
||||
|
||||
|
||||
shtPtr = (short*)intPtr;
|
||||
for (int i=0; i<dataLen; i++)
|
||||
for (i=0; i<dataLen; i++)
|
||||
{
|
||||
mStructs.push_back (shtPtr);
|
||||
|
||||
@@ -292,7 +294,7 @@ protected:
|
||||
}
|
||||
|
||||
// build reverse lookups
|
||||
for (int i=0; i<(int)mStructs.size(); i++)
|
||||
for (i=0; i<(int)mStructs.size(); i++)
|
||||
{
|
||||
short *strc = mStructs.at(i);
|
||||
mStructReverse.insert(strc[0], i);
|
||||
|
||||
Reference in New Issue
Block a user