Fix compilation warnings
This commit is contained in:
parent
3b2ce61cf2
commit
bb0da781a7
|
@ -117,7 +117,7 @@ void CollisionDetection::reportCollisionBetweenShapes(CollisionCallback* callbac
|
||||||
|
|
||||||
// For each contact manifold of the overlapping pair
|
// For each contact manifold of the overlapping pair
|
||||||
ContactManifold* manifold = pair->getContactManifold();
|
ContactManifold* manifold = pair->getContactManifold();
|
||||||
for (int i=0; i<manifold->getNbContactPoints(); i++) {
|
for (uint i=0; i<manifold->getNbContactPoints(); i++) {
|
||||||
|
|
||||||
ContactPoint* contactPoint = manifold->getContactPoint(i);
|
ContactPoint* contactPoint = manifold->getContactPoint(i);
|
||||||
|
|
||||||
|
|
|
@ -168,7 +168,7 @@ void BroadPhaseAlgorithm::computeOverlappingPairs() {
|
||||||
// For all collision shapes that have moved (or have been created) during the
|
// For all collision shapes that have moved (or have been created) during the
|
||||||
// last simulation step
|
// last simulation step
|
||||||
for (uint i=0; i<mNbMovedShapes; i++) {
|
for (uint i=0; i<mNbMovedShapes; i++) {
|
||||||
uint shapeID = mMovedShapes[i];
|
int shapeID = mMovedShapes[i];
|
||||||
|
|
||||||
if (shapeID == -1) continue;
|
if (shapeID == -1) continue;
|
||||||
|
|
||||||
|
|
|
@ -50,25 +50,25 @@ int EPAAlgorithm::isOriginInTetrahedron(const Vector3& p1, const Vector3& p2,
|
||||||
|
|
||||||
// Check vertex 1
|
// Check vertex 1
|
||||||
Vector3 normal1 = (p2-p1).cross(p3-p1);
|
Vector3 normal1 = (p2-p1).cross(p3-p1);
|
||||||
if (normal1.dot(p1) > 0.0 == normal1.dot(p4) > 0.0) {
|
if ((normal1.dot(p1) > 0.0) == (normal1.dot(p4) > 0.0)) {
|
||||||
return 4;
|
return 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check vertex 2
|
// Check vertex 2
|
||||||
Vector3 normal2 = (p4-p2).cross(p3-p2);
|
Vector3 normal2 = (p4-p2).cross(p3-p2);
|
||||||
if (normal2.dot(p2) > 0.0 == normal2.dot(p1) > 0.0) {
|
if ((normal2.dot(p2) > 0.0) == (normal2.dot(p1) > 0.0)) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check vertex 3
|
// Check vertex 3
|
||||||
Vector3 normal3 = (p4-p3).cross(p1-p3);
|
Vector3 normal3 = (p4-p3).cross(p1-p3);
|
||||||
if (normal3.dot(p3) > 0.0 == normal3.dot(p2) > 0.0) {
|
if ((normal3.dot(p3) > 0.0) == (normal3.dot(p2) > 0.0)) {
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check vertex 4
|
// Check vertex 4
|
||||||
Vector3 normal4 = (p2-p4).cross(p1-p4);
|
Vector3 normal4 = (p2-p4).cross(p1-p4);
|
||||||
if (normal4.dot(p4) > 0.0 == normal4.dot(p3) > 0.0) {
|
if ((normal4.dot(p4) > 0.0) == (normal4.dot(p3) > 0.0)) {
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -336,7 +336,6 @@ bool GJKAlgorithm::testPointInside(const Vector3& localPoint, ProxyShape* collis
|
||||||
|
|
||||||
Vector3 suppA; // Support point of object A
|
Vector3 suppA; // Support point of object A
|
||||||
Vector3 w; // Support point of Minkowski difference A-B
|
Vector3 w; // Support point of Minkowski difference A-B
|
||||||
decimal vDotw;
|
|
||||||
decimal prevDistSquare;
|
decimal prevDistSquare;
|
||||||
|
|
||||||
// Support point of object B (object B is a single point)
|
// Support point of object B (object B is a single point)
|
||||||
|
@ -359,8 +358,6 @@ bool GJKAlgorithm::testPointInside(const Vector3& localPoint, ProxyShape* collis
|
||||||
// Compute the support point for the Minkowski difference A-B
|
// Compute the support point for the Minkowski difference A-B
|
||||||
w = suppA - suppB;
|
w = suppA - suppB;
|
||||||
|
|
||||||
vDotw = v.dot(w);
|
|
||||||
|
|
||||||
// Add the new support point to the simplex
|
// Add the new support point to the simplex
|
||||||
simplex.addPoint(w, suppA, suppB);
|
simplex.addPoint(w, suppA, suppB);
|
||||||
|
|
||||||
|
|
|
@ -85,13 +85,13 @@ struct JointInfo {
|
||||||
/// Type of the joint
|
/// Type of the joint
|
||||||
JointType type;
|
JointType type;
|
||||||
|
|
||||||
/// True if the two bodies of the joint are allowed to collide with each other
|
|
||||||
bool isCollisionEnabled;
|
|
||||||
|
|
||||||
/// Position correction technique used for the constraint (used for joints).
|
/// Position correction technique used for the constraint (used for joints).
|
||||||
/// By default, the BAUMGARTE technique is used
|
/// By default, the BAUMGARTE technique is used
|
||||||
JointsPositionCorrectionTechnique positionCorrectionTechnique;
|
JointsPositionCorrectionTechnique positionCorrectionTechnique;
|
||||||
|
|
||||||
|
/// True if the two bodies of the joint are allowed to collide with each other
|
||||||
|
bool isCollisionEnabled;
|
||||||
|
|
||||||
/// Constructor
|
/// Constructor
|
||||||
JointInfo(JointType constraintType)
|
JointInfo(JointType constraintType)
|
||||||
: body1(NULL), body2(NULL), type(constraintType),
|
: body1(NULL), body2(NULL), type(constraintType),
|
||||||
|
|
|
@ -36,16 +36,17 @@ using namespace std;
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
DynamicsWorld::DynamicsWorld(const Vector3 &gravity, decimal timeStep = DEFAULT_TIMESTEP)
|
DynamicsWorld::DynamicsWorld(const Vector3 &gravity, decimal timeStep = DEFAULT_TIMESTEP)
|
||||||
: CollisionWorld(), mTimer(timeStep), mGravity(gravity), mIsGravityEnabled(true),
|
: CollisionWorld(), mTimer(timeStep),
|
||||||
mConstrainedLinearVelocities(NULL), mConstrainedAngularVelocities(NULL),
|
|
||||||
mConstrainedPositions(NULL), mConstrainedOrientations(NULL),
|
|
||||||
mContactSolver(mMapBodyToConstrainedVelocityIndex),
|
mContactSolver(mMapBodyToConstrainedVelocityIndex),
|
||||||
mConstraintSolver(mMapBodyToConstrainedVelocityIndex),
|
mConstraintSolver(mMapBodyToConstrainedVelocityIndex),
|
||||||
mNbVelocitySolverIterations(DEFAULT_VELOCITY_SOLVER_NB_ITERATIONS),
|
mNbVelocitySolverIterations(DEFAULT_VELOCITY_SOLVER_NB_ITERATIONS),
|
||||||
mNbPositionSolverIterations(DEFAULT_POSITION_SOLVER_NB_ITERATIONS),
|
mNbPositionSolverIterations(DEFAULT_POSITION_SOLVER_NB_ITERATIONS),
|
||||||
mIsSleepingEnabled(SPLEEPING_ENABLED), mSplitLinearVelocities(NULL),
|
mIsSleepingEnabled(SPLEEPING_ENABLED), mGravity(gravity),
|
||||||
mSplitAngularVelocities(NULL), mNbIslands(0), mNbIslandsCapacity(0),
|
mIsGravityEnabled(true), mConstrainedLinearVelocities(NULL),
|
||||||
mIslands(NULL), mNbBodiesCapacity(0),
|
mConstrainedAngularVelocities(NULL), mSplitLinearVelocities(NULL),
|
||||||
|
mSplitAngularVelocities(NULL), mConstrainedPositions(NULL),
|
||||||
|
mConstrainedOrientations(NULL), mNbIslands(0),
|
||||||
|
mNbIslandsCapacity(0), mIslands(NULL), mNbBodiesCapacity(0),
|
||||||
mSleepLinearVelocity(DEFAULT_SLEEP_LINEAR_VELOCITY),
|
mSleepLinearVelocity(DEFAULT_SLEEP_LINEAR_VELOCITY),
|
||||||
mSleepAngularVelocity(DEFAULT_SLEEP_ANGULAR_VELOCITY),
|
mSleepAngularVelocity(DEFAULT_SLEEP_ANGULAR_VELOCITY),
|
||||||
mTimeBeforeSleep(DEFAULT_TIME_BEFORE_SLEEP) {
|
mTimeBeforeSleep(DEFAULT_TIME_BEFORE_SLEEP) {
|
||||||
|
|
|
@ -51,12 +51,12 @@ struct Impulse {
|
||||||
/// Linear impulse applied to the first body
|
/// Linear impulse applied to the first body
|
||||||
const Vector3 linearImpulseBody1;
|
const Vector3 linearImpulseBody1;
|
||||||
|
|
||||||
/// Linear impulse applied to the second body
|
|
||||||
const Vector3 linearImpulseBody2;
|
|
||||||
|
|
||||||
/// Angular impulse applied to the first body
|
/// Angular impulse applied to the first body
|
||||||
const Vector3 angularImpulseBody1;
|
const Vector3 angularImpulseBody1;
|
||||||
|
|
||||||
|
/// Linear impulse applied to the second body
|
||||||
|
const Vector3 linearImpulseBody2;
|
||||||
|
|
||||||
/// Angular impulse applied to the second body
|
/// Angular impulse applied to the second body
|
||||||
const Vector3 angularImpulseBody2;
|
const Vector3 angularImpulseBody2;
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,8 @@ MemoryAllocator::MemoryAllocator() {
|
||||||
mNbCurrentMemoryBlocks = 0;
|
mNbCurrentMemoryBlocks = 0;
|
||||||
const size_t sizeToAllocate = mNbAllocatedMemoryBlocks * sizeof(MemoryBlock);
|
const size_t sizeToAllocate = mNbAllocatedMemoryBlocks * sizeof(MemoryBlock);
|
||||||
mMemoryBlocks = (MemoryBlock*) malloc(sizeToAllocate);
|
mMemoryBlocks = (MemoryBlock*) malloc(sizeToAllocate);
|
||||||
memset(mMemoryBlocks, NULL, sizeToAllocate);
|
memset(mMemoryBlocks, 0, sizeToAllocate);
|
||||||
memset(mFreeMemoryUnits, NULL, sizeof(mFreeMemoryUnits));
|
memset(mFreeMemoryUnits, 0, sizeof(mFreeMemoryUnits));
|
||||||
|
|
||||||
#ifndef NDEBUG
|
#ifndef NDEBUG
|
||||||
mNbTimesAllocateMethodCalled = 0;
|
mNbTimesAllocateMethodCalled = 0;
|
||||||
|
@ -55,7 +55,7 @@ MemoryAllocator::MemoryAllocator() {
|
||||||
|
|
||||||
// Initialize the array that contains the sizes the memory units that will
|
// Initialize the array that contains the sizes the memory units that will
|
||||||
// be allocated in each different heap
|
// be allocated in each different heap
|
||||||
for (uint i=0; i < NB_HEAPS; i++) {
|
for (int i=0; i < NB_HEAPS; i++) {
|
||||||
mUnitSizes[i] = (i+1) * 8;
|
mUnitSizes[i] = (i+1) * 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -78,7 +78,7 @@ class MemoryAllocator {
|
||||||
// -------------------- Constants -------------------- //
|
// -------------------- Constants -------------------- //
|
||||||
|
|
||||||
/// Number of heaps
|
/// Number of heaps
|
||||||
static const uint NB_HEAPS = 128;
|
static const int NB_HEAPS = 128;
|
||||||
|
|
||||||
/// Maximum memory unit size. An allocation request of a size smaller or equal to
|
/// Maximum memory unit size. An allocation request of a size smaller or equal to
|
||||||
/// this size will be handled using the small block allocator. However, for an
|
/// this size will be handled using the small block allocator. However, for an
|
||||||
|
|
Loading…
Reference in New Issue
Block a user