diff --git a/include/reactphysics3d/components/BallAndSocketJointComponents.h b/include/reactphysics3d/components/BallAndSocketJointComponents.h index 1a080bb6..95725225 100644 --- a/include/reactphysics3d/components/BallAndSocketJointComponents.h +++ b/include/reactphysics3d/components/BallAndSocketJointComponents.h @@ -225,7 +225,7 @@ class BallAndSocketJointComponents : public Components { void setConeLimitImpulse(Entity jointEntity, decimal impulse); /// Return the cone limit half angle - bool getConeLimitHalfAngle(Entity jointEntity) const; + decimal getConeLimitHalfAngle(Entity jointEntity) const; /// Set the cone limit half angle void setConeLimitHalfAngle(Entity jointEntity, decimal halfAngle); @@ -423,7 +423,7 @@ RP3D_FORCE_INLINE void BallAndSocketJointComponents::setConeLimitImpulse(Entity } // Return the cone limit half angle -RP3D_FORCE_INLINE bool BallAndSocketJointComponents::getConeLimitHalfAngle(Entity jointEntity) const { +RP3D_FORCE_INLINE decimal BallAndSocketJointComponents::getConeLimitHalfAngle(Entity jointEntity) const { assert(mMapEntityToComponentIndex.containsKey(jointEntity)); return mConeLimitHalfAngle[mMapEntityToComponentIndex[jointEntity]]; diff --git a/include/reactphysics3d/containers/Array.h b/include/reactphysics3d/containers/Array.h index 341a255c..c9e03d1d 100755 --- a/include/reactphysics3d/containers/Array.h +++ b/include/reactphysics3d/containers/Array.h @@ -111,30 +111,30 @@ class Array { return &(mBuffer[mCurrentIndex]); } - /// Post increment (it++) + /// Pre increment (++it) Iterator& operator++() { assert(mCurrentIndex < mSize); mCurrentIndex++; return *this; } - /// Pre increment (++it) - Iterator operator++(int number) { + /// Post increment (it++) + Iterator operator++(int) { assert(mCurrentIndex < mSize); Iterator tmp = *this; mCurrentIndex++; return tmp; } - /// Post decrement (it--) + /// Pre decrement (--it) Iterator& operator--() { assert(mCurrentIndex > 0); mCurrentIndex--; return *this; } - /// Pre decrement (--it) - Iterator operator--(int number) { + /// Post decrement (it--) + Iterator operator--(int) { assert(mCurrentIndex > 0); Iterator tmp = *this; mCurrentIndex--; diff --git a/include/reactphysics3d/containers/Deque.h b/include/reactphysics3d/containers/Deque.h index ff37b460..ace3ab74 100644 --- a/include/reactphysics3d/containers/Deque.h +++ b/include/reactphysics3d/containers/Deque.h @@ -196,19 +196,11 @@ class Deque { using const_reference = const T&; using iterator_category = std::random_access_iterator_tag; - /// Constructor - Iterator() = default; - /// Constructor Iterator(const Deque* deque, size_t virtualIndex) : mVirtualIndex(virtualIndex), mDeque(deque) { } - /// Copy constructor - Iterator(const Iterator& it) : mVirtualIndex(it.mVirtualIndex), mDeque(it.mDeque) { - - } - /// Deferencable reference operator*() { assert(mVirtualIndex < mDeque->mSize); @@ -227,29 +219,29 @@ class Deque { return &(mDeque->getItem(mVirtualIndex)); } - /// Post increment (it++) + /// Pre increment (++it) Iterator& operator++() { assert(mVirtualIndex < mDeque->mSize); mVirtualIndex++; return *this; } - /// Pre increment (++it) - Iterator operator++(int number) { + /// Post increment (it++) + Iterator operator++(int /*number*/) { assert(mVirtualIndex < mDeque->mSize); Iterator tmp = *this; mVirtualIndex++; return tmp; } - /// Post decrement (it--) + /// Pre decrement (--it) Iterator& operator--() { mVirtualIndex--; return *this; } - /// Pre decrement (--it) - Iterator operator--(int number) { + /// Post decrement (it--) + Iterator operator--(int /*number*/) { Iterator tmp = *this; mVirtualIndex--; return tmp; diff --git a/src/collision/shapes/HeightFieldShape.cpp b/src/collision/shapes/HeightFieldShape.cpp index b508b52e..642f3adf 100644 --- a/src/collision/shapes/HeightFieldShape.cpp +++ b/src/collision/shapes/HeightFieldShape.cpp @@ -47,7 +47,7 @@ HeightFieldShape::HeightFieldShape(int nbGridColumns, int nbGridRows, decimal mi HalfEdgeStructure& triangleHalfEdgeStructure, int upAxis, decimal integerHeightScale, const Vector3& scaling) : ConcaveShape(CollisionShapeName::HEIGHTFIELD, allocator, scaling), mNbColumns(nbGridColumns), mNbRows(nbGridRows), - mWidth(nbGridColumns - 1), mLength(nbGridRows - 1), mMinHeight(minHeight), + mWidth(static_cast(nbGridColumns - 1)), mLength(static_cast(nbGridRows - 1)), mMinHeight(minHeight), mMaxHeight(maxHeight), mUpAxis(upAxis), mIntegerHeightScale(integerHeightScale), mHeightDataType(dataType), mTriangleHalfEdgeStructure(triangleHalfEdgeStructure) { diff --git a/test/tests/collision/TestCollisionWorld.h b/test/tests/collision/TestCollisionWorld.h index 6af337a1..9c472389 100644 --- a/test/tests/collision/TestCollisionWorld.h +++ b/test/tests/collision/TestCollisionWorld.h @@ -79,8 +79,7 @@ struct ContactPairData { std::vector::const_iterator it; for (it = contactPoints.cbegin(); it != contactPoints.cend(); ++it) { - Vector3 vec = it->localPointBody1; - if (it->isContactPointSimilarTo(localPointBody1, localPointBody2, penetrationDepth)) { + if (it->isContactPointSimilarTo(localPointBody1, localPointBody2, penetrationDepth, epsilon)) { return true; } } @@ -127,7 +126,7 @@ struct CollisionData { std::vector::const_iterator it; for (it = contactPairs.cbegin(); it != contactPairs.cend(); ++it) { - if (it->hasContactPointSimilarTo(localPointBody1, localPointBody2, penetrationDepth)) { + if (it->hasContactPointSimilarTo(localPointBody1, localPointBody2, penetrationDepth, epsilon)) { return true; } } diff --git a/test/tests/collision/TestDynamicAABBTree.h b/test/tests/collision/TestDynamicAABBTree.h index 22fc4155..4187736f 100755 --- a/test/tests/collision/TestDynamicAABBTree.h +++ b/test/tests/collision/TestDynamicAABBTree.h @@ -44,7 +44,7 @@ class DynamicTreeRaycastCallback : public DynamicAABBTreeRaycastCallback { std::vector mHitNodes; // Called when the AABB of a leaf node is hit by a ray - virtual decimal raycastBroadPhaseShape(int32 nodeId, const Ray& ray) override { + virtual decimal raycastBroadPhaseShape(int32 nodeId, const Ray& /*ray*/) override { mHitNodes.push_back(nodeId); return 1.0; } @@ -76,7 +76,7 @@ class DefaultTestTreeAllocator : public MemoryAllocator { } /// Release previously allocated memory. - virtual void release(void* pointer, size_t size) override { + virtual void release(void* pointer, size_t /*size*/) override { free(pointer); } }; diff --git a/test/tests/containers/TestMap.h b/test/tests/containers/TestMap.h index 231324ef..0a403545 100644 --- a/test/tests/containers/TestMap.h +++ b/test/tests/containers/TestMap.h @@ -49,7 +49,7 @@ namespace std { template <> struct hash { - size_t operator()(const reactphysics3d::TestKey& key) const { + size_t operator()(const reactphysics3d::TestKey& /*key*/) const { return 1; } }; @@ -421,7 +421,7 @@ class TestMap : public Test { rp3d_test(itBegin == it); - int size = 0; + size_t size = 0; for (auto it = map1.begin(); it != map1.end(); ++it) { rp3d_test(map1.containsKey(it->first)); size++; diff --git a/test/tests/containers/TestSet.h b/test/tests/containers/TestSet.h index 7b11a76c..9df7864b 100644 --- a/test/tests/containers/TestSet.h +++ b/test/tests/containers/TestSet.h @@ -49,7 +49,7 @@ namespace std { template <> struct hash { - size_t operator()(const reactphysics3d::TestValueSet& value) const { + size_t operator()(const reactphysics3d::TestValueSet& /*value*/) const { return 1; } }; @@ -415,7 +415,7 @@ class TestSet : public Test { rp3d_test(itBegin == it); - int size = 0; + size_t size = 0; for (auto it = set1.begin(); it != set1.end(); ++it) { rp3d_test(set1.contains(*it)); size++; diff --git a/test/tests/mathematics/TestMathematicsFunctions.h b/test/tests/mathematics/TestMathematicsFunctions.h index b88ef29b..f4d9568a 100644 --- a/test/tests/mathematics/TestMathematicsFunctions.h +++ b/test/tests/mathematics/TestMathematicsFunctions.h @@ -254,7 +254,7 @@ class TestMathematicsFunctions : public Test { polygonPlanesPoints.add(Vector3(10, 5, 0)); Array clipPolygonVertices(mAllocator); - for (int i=0; i < polygonPlanesPoints.size(); i++) { + for (size_t i=0; i < polygonPlanesPoints.size(); i++) { clipPolygonVertices.clear(); clipPolygonWithPlane(polygonVertices, polygonPlanesPoints[i], polygonPlanesNormals[i], clipPolygonVertices); diff --git a/testbed/common/ConvexMesh.cpp b/testbed/common/ConvexMesh.cpp index f97ac9af..8e17bd3d 100755 --- a/testbed/common/ConvexMesh.cpp +++ b/testbed/common/ConvexMesh.cpp @@ -239,7 +239,7 @@ void ConvexMesh::createVBOAndVAO() { // Return the index of a given vertex in the mesh int ConvexMesh::findVertexIndex(const std::vector& vertices, const openglframework::Vector3& vertex) { - for (int i = 0; i < vertices.size(); i++) { + for (size_t i = 0; i < vertices.size(); i++) { if (vertices[i] == vertex) { return i; } diff --git a/testbed/common/VisualContactPoint.cpp b/testbed/common/VisualContactPoint.cpp index 16bf32f8..c0a41d4c 100644 --- a/testbed/common/VisualContactPoint.cpp +++ b/testbed/common/VisualContactPoint.cpp @@ -36,7 +36,7 @@ openglframework::Mesh VisualContactPoint::mMesh; bool VisualContactPoint::mStaticDataCreated = false; // Constructor -VisualContactPoint::VisualContactPoint(const openglframework::Vector3& position, const std::string& meshFolderPath, +VisualContactPoint::VisualContactPoint(const openglframework::Vector3& position, const openglframework::Vector3& normalLineEndPointLocal, const openglframework::Color& color) : mVBOVerticesNormalLine(GL_ARRAY_BUFFER), mColor(color) { diff --git a/testbed/common/VisualContactPoint.h b/testbed/common/VisualContactPoint.h index b540e751..042fdf68 100644 --- a/testbed/common/VisualContactPoint.h +++ b/testbed/common/VisualContactPoint.h @@ -88,8 +88,8 @@ class VisualContactPoint : public openglframework::Object3D { // -------------------- Methods -------------------- // /// Constructor - VisualContactPoint(const openglframework::Vector3& position, const std::string &meshFolderPath, - const openglframework::Vector3& normalLineEndPointLocal, const openglframework::Color& color); + VisualContactPoint(const openglframework::Vector3& position, const openglframework::Vector3& normalLineEndPointLocal, + const openglframework::Color& color); /// Destructor ~VisualContactPoint(); diff --git a/testbed/opengl-framework/src/MeshReaderWriter.cpp b/testbed/opengl-framework/src/MeshReaderWriter.cpp index 321a1282..f8dfdd84 100644 --- a/testbed/opengl-framework/src/MeshReaderWriter.cpp +++ b/testbed/opengl-framework/src/MeshReaderWriter.cpp @@ -188,9 +188,6 @@ void MeshReaderWriter::loadOBJFile(const string &filename, Mesh& meshToCreate) { else { tmp = line.substr(found1+1); found2 = (int)tmp.find("/"); - if (found2 > 1000) { - int test = 2; - } // If the face definition is of the form "f vert1//normal1 vert2//normal2 ..." if(found2 == 0) { diff --git a/testbed/scenes/ballandsocketjointsnet/BallAndSocketJointsNetScene.cpp b/testbed/scenes/ballandsocketjointsnet/BallAndSocketJointsNetScene.cpp index f4ded287..09354545 100644 --- a/testbed/scenes/ballandsocketjointsnet/BallAndSocketJointsNetScene.cpp +++ b/testbed/scenes/ballandsocketjointsnet/BallAndSocketJointsNetScene.cpp @@ -142,9 +142,7 @@ void BallAndSocketJointsNetScene::createJoints() { // Create the joint info object rp3d::RigidBody* body1 = mNetSpheres[i-1][j]->getRigidBody(); rp3d::RigidBody* body2 = mNetSpheres[i][j]->getRigidBody(); - rp3d::Vector3 body1Position = body1->getTransform().getPosition(); rp3d::Vector3 body2Position = body2->getTransform().getPosition(); - //const rp3d::Vector3 anchorPointWorldSpace = 0.5 * (body1Position + body2Position); const rp3d::Vector3 anchorPointWorldSpace = body2Position; rp3d::BallAndSocketJointInfo jointInfo(body1, body2, anchorPointWorldSpace); jointInfo.isCollisionEnabled = false; @@ -157,7 +155,6 @@ void BallAndSocketJointsNetScene::createJoints() { // Create the joint info object rp3d::RigidBody* body1 = mNetSpheres[i][j-1]->getRigidBody(); rp3d::RigidBody* body2 = mNetSpheres[i][j]->getRigidBody(); - rp3d::Vector3 body1Position = body1->getTransform().getPosition(); rp3d::Vector3 body2Position = body2->getTransform().getPosition(); const rp3d::Vector3 anchorPointWorldSpace = body2Position; rp3d::BallAndSocketJointInfo jointInfo(body1, body2, anchorPointWorldSpace); diff --git a/testbed/scenes/collisiondetection/CollisionDetectionScene.cpp b/testbed/scenes/collisiondetection/CollisionDetectionScene.cpp index 3a736ba9..e066f8ec 100644 --- a/testbed/scenes/collisiondetection/CollisionDetectionScene.cpp +++ b/testbed/scenes/collisiondetection/CollisionDetectionScene.cpp @@ -220,7 +220,7 @@ void CollisionDetectionScene::selectNextShape() { } // Called when a keyboard event occurs -bool CollisionDetectionScene::keyboardEvent(int key, int scancode, int action, int mods) { +bool CollisionDetectionScene::keyboardEvent(int key, int /*scancode*/, int action, int /*mods*/) { // If the space key has been pressed if (key == GLFW_KEY_SPACE && action == GLFW_PRESS) { diff --git a/testbed/scenes/collisiondetection/CollisionDetectionScene.h b/testbed/scenes/collisiondetection/CollisionDetectionScene.h index 5fd529a5..8149abfb 100644 --- a/testbed/scenes/collisiondetection/CollisionDetectionScene.h +++ b/testbed/scenes/collisiondetection/CollisionDetectionScene.h @@ -71,7 +71,7 @@ class ContactManager : public rp3d::CollisionCallback { public: - ContactManager(openglframework::Shader& shader, const std::string& meshFolderPath, + ContactManager(openglframework::Shader& /*shader*/, const std::string& meshFolderPath, std::vector& contactPoints) : mMeshFolderPath(meshFolderPath), mContactPoints(contactPoints) { @@ -151,12 +151,12 @@ inline void CollisionDetectionScene::showHideNormals() { } // Enabled/Disable the shadow mapping -inline void CollisionDetectionScene::setIsShadowMappingEnabled(bool isShadowMappingEnabled) { +inline void CollisionDetectionScene::setIsShadowMappingEnabled(bool /*isShadowMappingEnabled*/) { SceneDemo::setIsShadowMappingEnabled(false); } // Display/Hide the contact points -inline void CollisionDetectionScene::setAreContactPointsDisplayed(bool display) { +inline void CollisionDetectionScene::setAreContactPointsDisplayed(bool /*display*/) { SceneDemo::setAreContactPointsDisplayed(true); } diff --git a/testbed/scenes/raycast/RaycastScene.cpp b/testbed/scenes/raycast/RaycastScene.cpp index 55ede5ae..e7dcde20 100644 --- a/testbed/scenes/raycast/RaycastScene.cpp +++ b/testbed/scenes/raycast/RaycastScene.cpp @@ -346,7 +346,7 @@ void RaycastScene::createVBOAndVAO() { } // Called when a keyboard event occurs -bool RaycastScene::keyboardEvent(int key, int scancode, int action, int mods) { +bool RaycastScene::keyboardEvent(int key, int /*scancode*/, int action, int /*mods*/) { // If the space key has been pressed if (key == GLFW_KEY_SPACE && action == GLFW_PRESS) { diff --git a/testbed/scenes/raycast/RaycastScene.h b/testbed/scenes/raycast/RaycastScene.h index 8c9bd910..7dbebdbf 100644 --- a/testbed/scenes/raycast/RaycastScene.h +++ b/testbed/scenes/raycast/RaycastScene.h @@ -183,12 +183,12 @@ inline void RaycastScene::showHideNormals() { } // Enabled/Disable the shadow mapping -inline void RaycastScene::setIsShadowMappingEnabled(bool isShadowMappingEnabled) { +inline void RaycastScene::setIsShadowMappingEnabled(bool /*isShadowMappingEnabled*/) { SceneDemo::setIsShadowMappingEnabled(false); } // Display/Hide the contact points -inline void RaycastScene::setAreContactPointsDisplayed(bool display) { +inline void RaycastScene::setAreContactPointsDisplayed(bool /*display*/) { SceneDemo::setAreContactPointsDisplayed(true); } diff --git a/testbed/src/Gui.cpp b/testbed/src/Gui.cpp index 082ed4b5..716c98b0 100644 --- a/testbed/src/Gui.cpp +++ b/testbed/src/Gui.cpp @@ -209,14 +209,14 @@ void Gui::createSettingsPanel() { Button* buttonPhysics = new Button(buttonsPanel, "Physics"); buttonPhysics->set_flags(Button::RadioButton); buttonPhysics->set_pushed(true); - buttonPhysics->set_change_callback([&](bool state) { + buttonPhysics->set_change_callback([&](bool /*state*/) { mPhysicsPanel->set_visible(true); mRenderingPanel->set_visible(false); mScreen->perform_layout(); }); Button* buttonRendering = new Button(buttonsPanel, "Rendering"); buttonRendering->set_flags(Button::RadioButton); - buttonRendering->set_change_callback([&](bool state) { + buttonRendering->set_change_callback([&](bool /*state*/) { mRenderingPanel->set_visible(true); mPhysicsPanel->set_visible(false); mScreen->perform_layout(); diff --git a/testbed/src/Scene.cpp b/testbed/src/Scene.cpp index 37ef5fe4..09fb5894 100644 --- a/testbed/src/Scene.cpp +++ b/testbed/src/Scene.cpp @@ -94,7 +94,7 @@ bool Scene::mapMouseCoordinatesToSphere(double xMouse, double yMouse, } // Called when a mouse button event occurs -bool Scene::mouseButtonEvent(int button, bool down, int mods, double mousePosX, double mousePosY) { +bool Scene::mouseButtonEvent(int /*button*/, bool down, int /*mods*/, double mousePosX, double mousePosY) { // If the mouse button is pressed if (down) { @@ -137,7 +137,7 @@ bool Scene::mouseMotionEvent(double xMouse, double yMouse, int leftButtonState, } // Called when a scrolling event occurs -bool Scene::scrollingEvent(float xAxis, float yAxis, float scrollSensitivy) { +bool Scene::scrollingEvent(float /*xAxis*/, float yAxis, float scrollSensitivy) { zoom(yAxis * scrollSensitivy); return true; diff --git a/testbed/src/Scene.h b/testbed/src/Scene.h index 4e46e30b..13e8f40b 100644 --- a/testbed/src/Scene.h +++ b/testbed/src/Scene.h @@ -268,7 +268,7 @@ class Scene : public rp3d::EventListener { }; // Called when a keyboard event occurs -inline bool Scene::keyboardEvent(int key, int scancode, int action, int mods) { +inline bool Scene::keyboardEvent(int /*key*/, int /*scancode*/, int /*action*/, int /*mods*/) { return false; } diff --git a/testbed/src/SceneDemo.cpp b/testbed/src/SceneDemo.cpp index a5085820..8d245d94 100644 --- a/testbed/src/SceneDemo.cpp +++ b/testbed/src/SceneDemo.cpp @@ -467,13 +467,13 @@ void SceneDemo::updateSnapshotContactPoints() { for (it = mSnapshotsContactPoints.begin(); it != mSnapshotsContactPoints.end(); ++it) { // Create a visual contact point for rendering - VisualContactPoint* point = new VisualContactPoint(it->point, mMeshFolderPath, it->point + it->normal, it->color); + VisualContactPoint* point = new VisualContactPoint(it->point, it->point + it->normal, it->color); mVisualContactPoints.push_back(point); } } // Render the contact points -void SceneDemo::renderSnapshotsContactPoints(openglframework::Shader& shader, const openglframework::Matrix4& worldToCameraMatrix) { +void SceneDemo::renderSnapshotsContactPoints(openglframework::Shader& /*shader*/, const openglframework::Matrix4& worldToCameraMatrix) { // Render all the contact points for (std::vector::iterator it = mVisualContactPoints.begin(); diff --git a/testbed/src/TestbedApplication.cpp b/testbed/src/TestbedApplication.cpp index 72f4f699..25561cc2 100755 --- a/testbed/src/TestbedApplication.cpp +++ b/testbed/src/TestbedApplication.cpp @@ -544,8 +544,8 @@ void TestbedApplication::notifyEngineSetttingsChanged() { mCurrentScene->updateEngineSettings(); } -void GLAPIENTRY TestbedApplication::onOpenGLError(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, - const GLchar* message, const void* userParam ) { +void GLAPIENTRY TestbedApplication::onOpenGLError(GLenum /*source*/, GLenum type, GLuint /*id*/, GLenum /*severity*/, GLsizei /*length*/, + const GLchar* /*message*/, const void* /*userParam*/ ) { #ifdef GL_DEBUG_OUTPUT if (type == GL_DEBUG_TYPE_ERROR) {