Fix warnings

This commit is contained in:
Daniel Chappuis 2015-08-17 06:44:26 +02:00
parent 1bde11f245
commit 7ce44f9775
12 changed files with 22 additions and 30 deletions

View File

@ -23,6 +23,10 @@ OPTION(COMPILE_TESTS "Select this if you want to build the tests" OFF)
OPTION(PROFILING_ENABLED "Select this if you want to compile with enabled profiling" OFF) OPTION(PROFILING_ENABLED "Select this if you want to compile with enabled profiling" OFF)
OPTION(DOUBLE_PRECISION_ENABLED "Select this if you want to compile using double precision floating OPTION(DOUBLE_PRECISION_ENABLED "Select this if you want to compile using double precision floating
values" OFF) values" OFF)
# Compiler flags
set(CMAKE_CXX_FLAGS "-Wall")
# Headers # Headers
INCLUDE_DIRECTORIES(src) INCLUDE_DIRECTORIES(src)

View File

@ -92,8 +92,8 @@ void CollisionDetection::reportCollisionBetweenShapes(CollisionCallback* callbac
OverlappingPair* pair = it->second; OverlappingPair* pair = it->second;
ProxyShape* shape1 = pair->getShape1(); const ProxyShape* shape1 = pair->getShape1();
ProxyShape* shape2 = pair->getShape2(); const ProxyShape* shape2 = pair->getShape2();
assert(shape1->mBroadPhaseID != shape2->mBroadPhaseID); assert(shape1->mBroadPhaseID != shape2->mBroadPhaseID);

View File

@ -158,10 +158,10 @@ class ContactPoint {
~ContactPoint(); ~ContactPoint();
/// Return the reference to the body 1 /// Return the reference to the body 1
CollisionBody* const getBody1() const; CollisionBody* getBody1() const;
/// Return the reference to the body 2 /// Return the reference to the body 2
CollisionBody* const getBody2() const; CollisionBody* getBody2() const;
/// Return the normal vector of the contact /// Return the normal vector of the contact
Vector3 getNormal() const; Vector3 getNormal() const;
@ -231,12 +231,12 @@ class ContactPoint {
}; };
// Return the reference to the body 1 // Return the reference to the body 1
inline CollisionBody* const ContactPoint::getBody1() const { inline CollisionBody* ContactPoint::getBody1() const {
return mBody1; return mBody1;
} }
// Return the reference to the body 2 // Return the reference to the body 2
inline CollisionBody* const ContactPoint::getBody2() const { inline CollisionBody* ContactPoint::getBody2() const {
return mBody2; return mBody2;
} }

View File

@ -181,10 +181,10 @@ class Joint {
virtual ~Joint(); virtual ~Joint();
/// Return the reference to the body 1 /// Return the reference to the body 1
RigidBody* const getBody1() const; RigidBody* getBody1() const;
/// Return the reference to the body 2 /// Return the reference to the body 2
RigidBody* const getBody2() const; RigidBody* getBody2() const;
/// Return true if the constraint is active /// Return true if the constraint is active
bool isActive() const; bool isActive() const;
@ -206,7 +206,7 @@ class Joint {
/** /**
* @return The first body involved in the joint * @return The first body involved in the joint
*/ */
inline RigidBody* const Joint::getBody1() const { inline RigidBody* Joint::getBody1() const {
return mBody1; return mBody1;
} }
@ -214,7 +214,7 @@ inline RigidBody* const Joint::getBody1() const {
/** /**
* @return The second body involved in the joint * @return The second body involved in the joint
*/ */
inline RigidBody* const Joint::getBody2() const { inline RigidBody* Joint::getBody2() const {
return mBody2; return mBody2;
} }

View File

@ -53,7 +53,7 @@ class EventListener {
/** /**
* @param contact Information about the contact * @param contact Information about the contact
*/ */
virtual void beginContact(const ContactPointInfo& contact) {} virtual void beginContact(const ContactPointInfo& contact) {};
/// Called when a new contact point is found between two bodies /// Called when a new contact point is found between two bodies
/** /**

View File

@ -82,10 +82,10 @@ class OverlappingPair {
~OverlappingPair(); ~OverlappingPair();
/// Return the pointer to first proxy collision shape /// Return the pointer to first proxy collision shape
ProxyShape* const getShape1() const; ProxyShape* getShape1() const;
/// Return the pointer to second body /// Return the pointer to second body
ProxyShape* const getShape2() const; ProxyShape* getShape2() const;
/// Add a contact to the contact cache /// Add a contact to the contact cache
void addContact(ContactPoint* contact); void addContact(ContactPoint* contact);
@ -120,12 +120,12 @@ class OverlappingPair {
}; };
// Return the pointer to first body // Return the pointer to first body
inline ProxyShape* const OverlappingPair::getShape1() const { inline ProxyShape* OverlappingPair::getShape1() const {
return mShape1; return mShape1;
} }
// Return the pointer to second body // Return the pointer to second body
inline ProxyShape* const OverlappingPair::getShape2() const { inline ProxyShape* OverlappingPair::getShape2() const {
return mShape2; return mShape2;
} }

View File

@ -32,7 +32,7 @@ using namespace reactphysics3d;
/// Constructor /// Constructor
Test::Test(const std::string& name, std::ostream* stream) Test::Test(const std::string& name, std::ostream* stream)
: mName(name), mOutputStream(stream), mNbPassedTests(0), mNbFailedTests(0) { : mName(name), mNbPassedTests(0), mNbFailedTests(0), mOutputStream(stream) {
} }

View File

@ -470,8 +470,6 @@ class TestPointInside : public Test {
// ----- Tests without using edges information ----- // // ----- Tests without using edges information ----- //
bool value = mConvexMeshBody->testPointInside(Vector3(0, 0, 0));
// Tests with CollisionBody // Tests with CollisionBody
test(mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 0))); test(mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(0, 0, 0)));
test(mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(-1.9, 0, 0))); test(mConvexMeshBody->testPointInside(mLocalShapeToWorld * Vector3(-1.9, 0, 0)));

View File

@ -23,9 +23,7 @@ FILE(COPY "meshes/" DESTINATION "${EXECUTABLE_OUTPUT_PATH}/meshes/")
FILE(COPY "imgui/DroidSans.ttf" DESTINATION "${EXECUTABLE_OUTPUT_PATH}") FILE(COPY "imgui/DroidSans.ttf" DESTINATION "${EXECUTABLE_OUTPUT_PATH}")
# Enable C++11 features # Enable C++11 features
SET(CMAKE_CXX_FLAGS "-std=c++0x") SET(CMAKE_CXX_FLAGS "-Wall -std=c++0x")
#ADD_DEFINITIONS(-DGL3)
# Headers # Headers
INCLUDE_DIRECTORIES(${GLEW_INCLUDE_PATH} "src/" "opengl-framework/src/" "glfw/include/" "common/" "scenes/" "imgui/") INCLUDE_DIRECTORIES(${GLEW_INCLUDE_PATH} "src/" "opengl-framework/src/" "glfw/include/" "common/" "scenes/" "imgui/")

View File

@ -123,7 +123,6 @@ Dumbbell::Dumbbell(const openglframework::Vector3 &position,
// ReactPhysics3D will clone this object to create an internal one. Therefore, // ReactPhysics3D will clone this object to create an internal one. Therefore,
// it is OK if this object is destroyed right after calling RigidBody::addCollisionShape() // it is OK if this object is destroyed right after calling RigidBody::addCollisionShape()
const rp3d::decimal radiusSphere = rp3d::decimal(1.5); const rp3d::decimal radiusSphere = rp3d::decimal(1.5);
const rp3d::decimal massSphere = rp3d::decimal(2.0);
const rp3d::SphereShape sphereCollisionShape(radiusSphere); const rp3d::SphereShape sphereCollisionShape(radiusSphere);
// Create a cylinder collision shape for the middle of the dumbbell // Create a cylinder collision shape for the middle of the dumbbell
@ -131,7 +130,6 @@ Dumbbell::Dumbbell(const openglframework::Vector3 &position,
// it is OK if this object is destroyed right after calling RigidBody::addCollisionShape() // it is OK if this object is destroyed right after calling RigidBody::addCollisionShape()
const rp3d::decimal radiusCylinder = rp3d::decimal(0.5); const rp3d::decimal radiusCylinder = rp3d::decimal(0.5);
const rp3d::decimal heightCylinder = rp3d::decimal(8.0); const rp3d::decimal heightCylinder = rp3d::decimal(8.0);
const rp3d::decimal massCylinder = rp3d::decimal(1.0);
const rp3d::CylinderShape cylinderCollisionShape(radiusCylinder, heightCylinder); const rp3d::CylinderShape cylinderCollisionShape(radiusCylinder, heightCylinder);
// Initial position and orientation of the rigid body // Initial position and orientation of the rigid body

View File

@ -43,9 +43,6 @@ CubesScene::CubesScene(const std::string& name)
// Gravity vector in the dynamics world // Gravity vector in the dynamics world
rp3d::Vector3 gravity(0, rp3d::decimal(-9.81), 0); rp3d::Vector3 gravity(0, rp3d::decimal(-9.81), 0);
// Time step for the physics simulation
rp3d::decimal timeStep = 1.0f / 60.0f;
// Create the dynamics world for the physics simulation // Create the dynamics world for the physics simulation
mDynamicsWorld = new rp3d::DynamicsWorld(gravity); mDynamicsWorld = new rp3d::DynamicsWorld(gravity);

View File

@ -71,9 +71,6 @@ class RaycastManager : public rp3d::RaycastCallback {
/// All the normals at hit points /// All the normals at hit points
std::vector<Line*> mNormals; std::vector<Line*> mNormals;
/// Shader
openglframework::Shader& mShader;
/// Contact point mesh folder path /// Contact point mesh folder path
std::string mMeshFolderPath; std::string mMeshFolderPath;
@ -81,7 +78,7 @@ class RaycastManager : public rp3d::RaycastCallback {
RaycastManager(openglframework::Shader& shader, RaycastManager(openglframework::Shader& shader,
const std::string& meshFolderPath) const std::string& meshFolderPath)
: mShader(shader), mMeshFolderPath(meshFolderPath) { : mMeshFolderPath(meshFolderPath) {
} }