From 2932403ff4e2302a6c2446409409bbcce6fcdc75 Mon Sep 17 00:00:00 2001 From: Daniel Chappuis Date: Tue, 19 Jul 2016 06:52:18 +0200 Subject: [PATCH] Use default keyword for default constructors/destructors --- src/body/Body.cpp | 5 ----- src/body/Body.h | 2 +- src/collision/CollisionDetection.cpp | 5 ----- src/collision/CollisionDetection.h | 2 +- src/collision/RaycastInfo.h | 4 +--- src/collision/TriangleMesh.cpp | 10 ---------- src/collision/TriangleMesh.h | 4 ++-- src/collision/TriangleVertexArray.cpp | 5 ----- src/collision/TriangleVertexArray.h | 2 +- src/collision/broadphase/BroadPhaseAlgorithm.h | 2 +- src/collision/broadphase/DynamicAABBTree.h | 4 ++-- src/collision/narrowphase/CollisionDispatch.h | 4 ++-- .../narrowphase/ConcaveVsConvexAlgorithm.cpp | 10 ---------- .../narrowphase/ConcaveVsConvexAlgorithm.h | 18 +++++++++--------- .../narrowphase/DefaultCollisionDispatch.cpp | 10 ---------- .../narrowphase/DefaultCollisionDispatch.h | 4 ++-- src/collision/narrowphase/EPA/EPAAlgorithm.cpp | 10 ---------- src/collision/narrowphase/EPA/EPAAlgorithm.h | 4 ++-- src/collision/narrowphase/EPA/EdgeEPA.cpp | 10 ---------- src/collision/narrowphase/EPA/EdgeEPA.h | 4 ++-- src/collision/narrowphase/EPA/TriangleEPA.cpp | 10 ---------- src/collision/narrowphase/EPA/TriangleEPA.h | 4 ++-- .../narrowphase/EPA/TrianglesStore.cpp | 5 ----- src/collision/narrowphase/EPA/TrianglesStore.h | 2 +- src/collision/narrowphase/GJK/GJKAlgorithm.cpp | 5 ----- src/collision/narrowphase/GJK/GJKAlgorithm.h | 2 +- .../narrowphase/NarrowPhaseAlgorithm.cpp | 5 ----- .../narrowphase/NarrowPhaseAlgorithm.h | 4 ++-- .../narrowphase/SphereVsSphereAlgorithm.cpp | 12 +----------- .../narrowphase/SphereVsSphereAlgorithm.h | 4 ++-- src/collision/shapes/AABB.cpp | 10 ---------- src/collision/shapes/AABB.h | 4 ++-- src/collision/shapes/BoxShape.cpp | 5 ----- src/collision/shapes/BoxShape.h | 2 +- src/collision/shapes/CapsuleShape.cpp | 5 ----- src/collision/shapes/CapsuleShape.h | 2 +- src/collision/shapes/CollisionShape.cpp | 5 ----- src/collision/shapes/CollisionShape.h | 2 +- src/collision/shapes/ConcaveMeshShape.cpp | 5 ----- src/collision/shapes/ConcaveMeshShape.h | 2 +- src/collision/shapes/ConcaveShape.cpp | 5 ----- src/collision/shapes/ConcaveShape.h | 4 ++-- src/collision/shapes/ConeShape.cpp | 5 ----- src/collision/shapes/ConeShape.h | 2 +- src/collision/shapes/ConvexMeshShape.cpp | 5 ----- src/collision/shapes/ConvexMeshShape.h | 2 +- src/collision/shapes/ConvexShape.cpp | 5 ----- src/collision/shapes/ConvexShape.h | 5 +---- src/collision/shapes/CylinderShape.cpp | 5 ----- src/collision/shapes/CylinderShape.h | 2 +- src/collision/shapes/HeightFieldShape.cpp | 5 ----- src/collision/shapes/HeightFieldShape.h | 2 +- src/collision/shapes/SphereShape.cpp | 5 ----- src/collision/shapes/SphereShape.h | 5 +---- src/collision/shapes/TriangleShape.cpp | 5 ----- src/collision/shapes/TriangleShape.h | 2 +- src/constraint/BallAndSocketJoint.cpp | 5 ----- src/constraint/BallAndSocketJoint.h | 2 +- src/constraint/ContactPoint.cpp | 5 ----- src/constraint/ContactPoint.h | 2 +- src/constraint/FixedJoint.cpp | 5 ----- src/constraint/FixedJoint.h | 2 +- src/constraint/HingeJoint.cpp | 5 ----- src/constraint/HingeJoint.h | 2 +- src/constraint/Joint.cpp | 5 ----- src/constraint/Joint.h | 4 ++-- src/constraint/SliderJoint.cpp | 5 ----- src/constraint/SliderJoint.h | 2 +- src/engine/ConstraintSolver.cpp | 5 ----- src/engine/ConstraintSolver.h | 2 +- src/engine/ContactSolver.cpp | 5 ----- src/engine/ContactSolver.h | 2 +- src/engine/EventListener.h | 4 ++-- src/engine/Material.cpp | 5 ----- src/engine/Material.h | 2 +- src/engine/OverlappingPair.cpp | 7 +------ src/engine/OverlappingPair.h | 2 +- src/engine/Timer.cpp | 5 ----- src/engine/Timer.h | 2 +- src/mathematics/Matrix2x2.cpp | 5 ----- src/mathematics/Matrix2x2.h | 2 +- src/mathematics/Matrix3x3.cpp | 5 ----- src/mathematics/Matrix3x3.h | 2 +- src/mathematics/Quaternion.cpp | 5 ----- src/mathematics/Quaternion.h | 2 +- src/mathematics/Ray.h | 4 +--- src/mathematics/Transform.cpp | 5 ----- src/mathematics/Transform.h | 2 +- src/mathematics/Vector2.cpp | 5 ----- src/mathematics/Vector2.h | 2 +- src/mathematics/Vector3.cpp | 5 ----- src/mathematics/Vector3.h | 2 +- 92 files changed, 72 insertions(+), 337 deletions(-) diff --git a/src/body/Body.cpp b/src/body/Body.cpp index b143321e..0f02a55b 100644 --- a/src/body/Body.cpp +++ b/src/body/Body.cpp @@ -39,8 +39,3 @@ Body::Body(bodyindex id) mIsSleeping(false), mSleepTime(0), mUserData(nullptr) { } - -// Destructor -Body::~Body() { - -} diff --git a/src/body/Body.h b/src/body/Body.h index c5f011fb..b1b18325 100644 --- a/src/body/Body.h +++ b/src/body/Body.h @@ -89,7 +89,7 @@ class Body { Body& operator=(const Body& body) = delete; /// Destructor - virtual ~Body(); + virtual ~Body() = default; /// Return the ID of the body bodyindex getID() const; diff --git a/src/collision/CollisionDetection.cpp b/src/collision/CollisionDetection.cpp index ed721343..7d9f6fb2 100644 --- a/src/collision/CollisionDetection.cpp +++ b/src/collision/CollisionDetection.cpp @@ -53,11 +53,6 @@ CollisionDetection::CollisionDetection(CollisionWorld* world, MemoryAllocator& m fillInCollisionMatrix(); } -// Destructor -CollisionDetection::~CollisionDetection() { - -} - // Compute the collision detection void CollisionDetection::computeCollisionDetection() { diff --git a/src/collision/CollisionDetection.h b/src/collision/CollisionDetection.h index 04d44f34..2a95b2f5 100644 --- a/src/collision/CollisionDetection.h +++ b/src/collision/CollisionDetection.h @@ -143,7 +143,7 @@ class CollisionDetection : public NarrowPhaseCallback { CollisionDetection(CollisionWorld* world, MemoryAllocator& memoryAllocator); /// Destructor - ~CollisionDetection(); + ~CollisionDetection() = default; /// Deleted copy-constructor CollisionDetection(const CollisionDetection& collisionDetection) = delete; diff --git a/src/collision/RaycastInfo.h b/src/collision/RaycastInfo.h index d693f02c..06510e04 100644 --- a/src/collision/RaycastInfo.h +++ b/src/collision/RaycastInfo.h @@ -80,9 +80,7 @@ struct RaycastInfo { } /// Destructor - ~RaycastInfo() { - - } + ~RaycastInfo() = default; /// Deleted copy constructor RaycastInfo(const RaycastInfo& raycastInfo) = delete; diff --git a/src/collision/TriangleMesh.cpp b/src/collision/TriangleMesh.cpp index 5439b3f3..3fdc48c5 100644 --- a/src/collision/TriangleMesh.cpp +++ b/src/collision/TriangleMesh.cpp @@ -27,13 +27,3 @@ #include "TriangleMesh.h" using namespace reactphysics3d; - -// Constructor -TriangleMesh::TriangleMesh() { - -} - -// Destructor -TriangleMesh::~TriangleMesh() { - -} diff --git a/src/collision/TriangleMesh.h b/src/collision/TriangleMesh.h index 52dabbe7..936824e9 100644 --- a/src/collision/TriangleMesh.h +++ b/src/collision/TriangleMesh.h @@ -51,10 +51,10 @@ class TriangleMesh { public: /// Constructor - TriangleMesh(); + TriangleMesh() = default; /// Destructor - ~TriangleMesh(); + ~TriangleMesh() = default; /// Add a subpart of the mesh void addSubpart(TriangleVertexArray* triangleVertexArray); diff --git a/src/collision/TriangleVertexArray.cpp b/src/collision/TriangleVertexArray.cpp index f1808a3c..883b0ab7 100644 --- a/src/collision/TriangleVertexArray.cpp +++ b/src/collision/TriangleVertexArray.cpp @@ -54,8 +54,3 @@ TriangleVertexArray::TriangleVertexArray(uint nbVertices, void* verticesStart, i mVertexDataType = vertexDataType; mIndexDataType = indexDataType; } - -// Destructor -TriangleVertexArray::~TriangleVertexArray() { - -} diff --git a/src/collision/TriangleVertexArray.h b/src/collision/TriangleVertexArray.h index f4403092..8e434919 100644 --- a/src/collision/TriangleVertexArray.h +++ b/src/collision/TriangleVertexArray.h @@ -87,7 +87,7 @@ class TriangleVertexArray { VertexDataType vertexDataType, IndexDataType indexDataType); /// Destructor - ~TriangleVertexArray(); + ~TriangleVertexArray() = default; /// Return the vertex data type VertexDataType getVertexDataType() const; diff --git a/src/collision/broadphase/BroadPhaseAlgorithm.h b/src/collision/broadphase/BroadPhaseAlgorithm.h index c4ea2c51..45c8acfb 100644 --- a/src/collision/broadphase/BroadPhaseAlgorithm.h +++ b/src/collision/broadphase/BroadPhaseAlgorithm.h @@ -110,7 +110,7 @@ class BroadPhaseRaycastCallback : public DynamicAABBTreeRaycastCallback { } // Destructor - virtual ~BroadPhaseRaycastCallback() override {} + virtual ~BroadPhaseRaycastCallback() override = default; // Called for a broad-phase shape that has to be tested for raycast virtual decimal raycastBroadPhaseShape(int32 nodeId, const Ray& ray) override; diff --git a/src/collision/broadphase/DynamicAABBTree.h b/src/collision/broadphase/DynamicAABBTree.h index 67999d0a..8025e4f9 100644 --- a/src/collision/broadphase/DynamicAABBTree.h +++ b/src/collision/broadphase/DynamicAABBTree.h @@ -103,7 +103,7 @@ class DynamicAABBTreeOverlapCallback { virtual void notifyOverlappingNode(int nodeId)=0; // Destructor - virtual ~DynamicAABBTreeOverlapCallback() {} + virtual ~DynamicAABBTreeOverlapCallback() = default; }; // Class DynamicAABBTreeRaycastCallback @@ -118,7 +118,7 @@ class DynamicAABBTreeRaycastCallback { // Called when the AABB of a leaf node is hit by a ray virtual decimal raycastBroadPhaseShape(int32 nodeId, const Ray& ray)=0; - virtual ~DynamicAABBTreeRaycastCallback() {} + virtual ~DynamicAABBTreeRaycastCallback() = default; }; diff --git a/src/collision/narrowphase/CollisionDispatch.h b/src/collision/narrowphase/CollisionDispatch.h index 29b6426b..8fa24f87 100644 --- a/src/collision/narrowphase/CollisionDispatch.h +++ b/src/collision/narrowphase/CollisionDispatch.h @@ -44,10 +44,10 @@ class CollisionDispatch { public: /// Constructor - CollisionDispatch() {} + CollisionDispatch() = default; /// Destructor - virtual ~CollisionDispatch() {} + virtual ~CollisionDispatch() = default; /// Initialize the collision dispatch configuration virtual void init(CollisionDetection* collisionDetection, diff --git a/src/collision/narrowphase/ConcaveVsConvexAlgorithm.cpp b/src/collision/narrowphase/ConcaveVsConvexAlgorithm.cpp index ab07c629..1e3c86c6 100644 --- a/src/collision/narrowphase/ConcaveVsConvexAlgorithm.cpp +++ b/src/collision/narrowphase/ConcaveVsConvexAlgorithm.cpp @@ -33,16 +33,6 @@ using namespace reactphysics3d; -// Constructor -ConcaveVsConvexAlgorithm::ConcaveVsConvexAlgorithm() { - -} - -// Destructor -ConcaveVsConvexAlgorithm::~ConcaveVsConvexAlgorithm() { - -} - // Return true and compute a contact info if the two bounding volumes collide void ConcaveVsConvexAlgorithm::testCollision(const CollisionShapeInfo& shape1Info, const CollisionShapeInfo& shape2Info, diff --git a/src/collision/narrowphase/ConcaveVsConvexAlgorithm.h b/src/collision/narrowphase/ConcaveVsConvexAlgorithm.h index c8ba0fce..bcd4ef8f 100644 --- a/src/collision/narrowphase/ConcaveVsConvexAlgorithm.h +++ b/src/collision/narrowphase/ConcaveVsConvexAlgorithm.h @@ -73,7 +73,7 @@ class ConvexVsTriangleCallback : public TriangleCallback { public: /// Destructor - virtual ~ConvexVsTriangleCallback() override {} + virtual ~ConvexVsTriangleCallback() override = default; /// Set the collision detection pointer void setCollisionDetection(CollisionDetection* collisionDetection) { @@ -191,12 +191,6 @@ class ConcaveVsConvexAlgorithm : public NarrowPhaseAlgorithm { // -------------------- Methods -------------------- // - /// Private copy-constructor - ConcaveVsConvexAlgorithm(const ConcaveVsConvexAlgorithm& algorithm); - - /// Private assignment operator - ConcaveVsConvexAlgorithm& operator=(const ConcaveVsConvexAlgorithm& algorithm); - /// Process the concave triangle mesh collision using the smooth mesh collision algorithm void processSmoothMeshCollision(OverlappingPair* overlappingPair, std::vector contactPoints, @@ -215,10 +209,16 @@ class ConcaveVsConvexAlgorithm : public NarrowPhaseAlgorithm { // -------------------- Methods -------------------- // /// Constructor - ConcaveVsConvexAlgorithm(); + ConcaveVsConvexAlgorithm() = default; /// Destructor - virtual ~ConcaveVsConvexAlgorithm() override; + virtual ~ConcaveVsConvexAlgorithm() override = default; + + /// Private copy-constructor + ConcaveVsConvexAlgorithm(const ConcaveVsConvexAlgorithm& algorithm) = delete; + + /// Private assignment operator + ConcaveVsConvexAlgorithm& operator=(const ConcaveVsConvexAlgorithm& algorithm) = delete; /// Compute a contact info if the two bounding volume collide virtual void testCollision(const CollisionShapeInfo& shape1Info, diff --git a/src/collision/narrowphase/DefaultCollisionDispatch.cpp b/src/collision/narrowphase/DefaultCollisionDispatch.cpp index bc48c001..109b5de3 100644 --- a/src/collision/narrowphase/DefaultCollisionDispatch.cpp +++ b/src/collision/narrowphase/DefaultCollisionDispatch.cpp @@ -29,16 +29,6 @@ using namespace reactphysics3d; -// Constructor -DefaultCollisionDispatch::DefaultCollisionDispatch() { - -} - -// Destructor -DefaultCollisionDispatch::~DefaultCollisionDispatch() { - -} - /// Initialize the collision dispatch configuration void DefaultCollisionDispatch::init(CollisionDetection* collisionDetection, MemoryAllocator* memoryAllocator) { diff --git a/src/collision/narrowphase/DefaultCollisionDispatch.h b/src/collision/narrowphase/DefaultCollisionDispatch.h index 28f114f9..9bf15b11 100644 --- a/src/collision/narrowphase/DefaultCollisionDispatch.h +++ b/src/collision/narrowphase/DefaultCollisionDispatch.h @@ -56,10 +56,10 @@ class DefaultCollisionDispatch : public CollisionDispatch { public: /// Constructor - DefaultCollisionDispatch(); + DefaultCollisionDispatch() = default; /// Destructor - virtual ~DefaultCollisionDispatch() override; + virtual ~DefaultCollisionDispatch() override = default; /// Initialize the collision dispatch configuration virtual void init(CollisionDetection* collisionDetection, diff --git a/src/collision/narrowphase/EPA/EPAAlgorithm.cpp b/src/collision/narrowphase/EPA/EPAAlgorithm.cpp index 03647182..68fdce35 100644 --- a/src/collision/narrowphase/EPA/EPAAlgorithm.cpp +++ b/src/collision/narrowphase/EPA/EPAAlgorithm.cpp @@ -32,16 +32,6 @@ // We want to use the ReactPhysics3D namespace using namespace reactphysics3d; -// Constructor -EPAAlgorithm::EPAAlgorithm() { - -} - -// Destructor -EPAAlgorithm::~EPAAlgorithm() { - -} - // Decide if the origin is in the tetrahedron. /// Return 0 if the origin is in the tetrahedron and return the number (1,2,3 or 4) of /// the vertex that is wrong if the origin is not in the tetrahedron diff --git a/src/collision/narrowphase/EPA/EPAAlgorithm.h b/src/collision/narrowphase/EPA/EPAAlgorithm.h index 81e35bf5..d9dca0e6 100644 --- a/src/collision/narrowphase/EPA/EPAAlgorithm.h +++ b/src/collision/narrowphase/EPA/EPAAlgorithm.h @@ -108,10 +108,10 @@ class EPAAlgorithm { // -------------------- Methods -------------------- // /// Constructor - EPAAlgorithm(); + EPAAlgorithm() = default; /// Destructor - ~EPAAlgorithm(); + ~EPAAlgorithm() = default; /// Deleted copy-constructor EPAAlgorithm(const EPAAlgorithm& algorithm) = delete; diff --git a/src/collision/narrowphase/EPA/EdgeEPA.cpp b/src/collision/narrowphase/EPA/EdgeEPA.cpp index 842f445d..dcbf61fd 100644 --- a/src/collision/narrowphase/EPA/EdgeEPA.cpp +++ b/src/collision/narrowphase/EPA/EdgeEPA.cpp @@ -32,11 +32,6 @@ // We want to use the ReactPhysics3D namespace using namespace reactphysics3d; -// Constructor -EdgeEPA::EdgeEPA() { - -} - // Constructor EdgeEPA::EdgeEPA(TriangleEPA* ownerTriangle, int index) : mOwnerTriangle(ownerTriangle), mIndex(index) { @@ -49,11 +44,6 @@ EdgeEPA::EdgeEPA(const EdgeEPA& edge) { mIndex = edge.mIndex; } -// Destructor -EdgeEPA::~EdgeEPA() { - -} - // Return the index of the source vertex of the edge (vertex starting the edge) uint EdgeEPA::getSourceVertexIndex() const { return (*mOwnerTriangle)[mIndex]; diff --git a/src/collision/narrowphase/EPA/EdgeEPA.h b/src/collision/narrowphase/EPA/EdgeEPA.h index ca580919..ba3dcfee 100644 --- a/src/collision/narrowphase/EPA/EdgeEPA.h +++ b/src/collision/narrowphase/EPA/EdgeEPA.h @@ -59,7 +59,7 @@ class EdgeEPA { // -------------------- Methods -------------------- // /// Constructor - EdgeEPA(); + EdgeEPA() = default; /// Constructor EdgeEPA(TriangleEPA* ownerTriangle, int index); @@ -68,7 +68,7 @@ class EdgeEPA { EdgeEPA(const EdgeEPA& edge); /// Destructor - ~EdgeEPA(); + ~EdgeEPA() = default; /// Return the pointer to the owner triangle TriangleEPA* getOwnerTriangle() const; diff --git a/src/collision/narrowphase/EPA/TriangleEPA.cpp b/src/collision/narrowphase/EPA/TriangleEPA.cpp index c4a279a2..c322059f 100644 --- a/src/collision/narrowphase/EPA/TriangleEPA.cpp +++ b/src/collision/narrowphase/EPA/TriangleEPA.cpp @@ -32,11 +32,6 @@ // We use the ReactPhysics3D namespace using namespace reactphysics3d; -// Constructor -TriangleEPA::TriangleEPA() { - -} - // Constructor TriangleEPA::TriangleEPA(uint indexVertex1, uint indexVertex2, uint indexVertex3) : mIsObsolete(false) { @@ -45,11 +40,6 @@ TriangleEPA::TriangleEPA(uint indexVertex1, uint indexVertex2, uint indexVertex3 mIndicesVertices[2] = indexVertex3; } -// Destructor -TriangleEPA::~TriangleEPA() { - -} - // Compute the point v closest to the origin of this triangle bool TriangleEPA::computeClosestPoint(const Vector3* vertices) { const Vector3& p0 = vertices[mIndicesVertices[0]]; diff --git a/src/collision/narrowphase/EPA/TriangleEPA.h b/src/collision/narrowphase/EPA/TriangleEPA.h index 4cb40f38..865c69d4 100644 --- a/src/collision/narrowphase/EPA/TriangleEPA.h +++ b/src/collision/narrowphase/EPA/TriangleEPA.h @@ -79,13 +79,13 @@ class TriangleEPA { // -------------------- Methods -------------------- // /// Constructor - TriangleEPA(); + TriangleEPA() = default; /// Constructor TriangleEPA(uint v1, uint v2, uint v3); /// Destructor - ~TriangleEPA(); + ~TriangleEPA() = default; /// Deleted copy-constructor TriangleEPA(const TriangleEPA& triangle) = delete; diff --git a/src/collision/narrowphase/EPA/TrianglesStore.cpp b/src/collision/narrowphase/EPA/TrianglesStore.cpp index ebc214fb..93fb95a6 100644 --- a/src/collision/narrowphase/EPA/TrianglesStore.cpp +++ b/src/collision/narrowphase/EPA/TrianglesStore.cpp @@ -33,8 +33,3 @@ using namespace reactphysics3d; TrianglesStore::TrianglesStore() : mNbTriangles(0) { } - -// Destructor -TrianglesStore::~TrianglesStore() { - -} diff --git a/src/collision/narrowphase/EPA/TrianglesStore.h b/src/collision/narrowphase/EPA/TrianglesStore.h index 5cd7edee..d21ccd35 100644 --- a/src/collision/narrowphase/EPA/TrianglesStore.h +++ b/src/collision/narrowphase/EPA/TrianglesStore.h @@ -62,7 +62,7 @@ class TrianglesStore { TrianglesStore(); /// Destructor - ~TrianglesStore(); + ~TrianglesStore() = default; /// Deleted copy-constructor TrianglesStore(const TrianglesStore& triangleStore) = delete; diff --git a/src/collision/narrowphase/GJK/GJKAlgorithm.cpp b/src/collision/narrowphase/GJK/GJKAlgorithm.cpp index 49db5968..55468066 100644 --- a/src/collision/narrowphase/GJK/GJKAlgorithm.cpp +++ b/src/collision/narrowphase/GJK/GJKAlgorithm.cpp @@ -42,11 +42,6 @@ GJKAlgorithm::GJKAlgorithm() : NarrowPhaseAlgorithm() { } -// Destructor -GJKAlgorithm::~GJKAlgorithm() { - -} - // Compute a contact info if the two collision shapes collide. /// This method implements the Hybrid Technique for computing the penetration depth by /// running the GJK algorithm on original objects (without margin). If the shapes intersect diff --git a/src/collision/narrowphase/GJK/GJKAlgorithm.h b/src/collision/narrowphase/GJK/GJKAlgorithm.h index c89178bc..ced8d9e7 100644 --- a/src/collision/narrowphase/GJK/GJKAlgorithm.h +++ b/src/collision/narrowphase/GJK/GJKAlgorithm.h @@ -84,7 +84,7 @@ class GJKAlgorithm : public NarrowPhaseAlgorithm { GJKAlgorithm(); /// Destructor - ~GJKAlgorithm(); + ~GJKAlgorithm() = default; /// Deleted copy-constructor GJKAlgorithm(const GJKAlgorithm& algorithm) = delete; diff --git a/src/collision/narrowphase/NarrowPhaseAlgorithm.cpp b/src/collision/narrowphase/NarrowPhaseAlgorithm.cpp index 970905da..0fbbe5fe 100644 --- a/src/collision/narrowphase/NarrowPhaseAlgorithm.cpp +++ b/src/collision/narrowphase/NarrowPhaseAlgorithm.cpp @@ -35,11 +35,6 @@ NarrowPhaseAlgorithm::NarrowPhaseAlgorithm() } -// Destructor -NarrowPhaseAlgorithm::~NarrowPhaseAlgorithm() { - -} - // Initalize the algorithm void NarrowPhaseAlgorithm::init(CollisionDetection* collisionDetection, MemoryAllocator* memoryAllocator) { mCollisionDetection = collisionDetection; diff --git a/src/collision/narrowphase/NarrowPhaseAlgorithm.h b/src/collision/narrowphase/NarrowPhaseAlgorithm.h index b765dbf3..30b216f0 100644 --- a/src/collision/narrowphase/NarrowPhaseAlgorithm.h +++ b/src/collision/narrowphase/NarrowPhaseAlgorithm.h @@ -47,7 +47,7 @@ class NarrowPhaseCallback { public: - virtual ~NarrowPhaseCallback() {} + virtual ~NarrowPhaseCallback() = default; /// Called by a narrow-phase collision algorithm when a new contact has been found virtual void notifyContact(OverlappingPair* overlappingPair, @@ -84,7 +84,7 @@ class NarrowPhaseAlgorithm { NarrowPhaseAlgorithm(); /// Destructor - virtual ~NarrowPhaseAlgorithm(); + virtual ~NarrowPhaseAlgorithm() = default; /// Deleted copy-constructor NarrowPhaseAlgorithm(const NarrowPhaseAlgorithm& algorithm) = delete; diff --git a/src/collision/narrowphase/SphereVsSphereAlgorithm.cpp b/src/collision/narrowphase/SphereVsSphereAlgorithm.cpp index 89e2987e..9d2c4baa 100644 --- a/src/collision/narrowphase/SphereVsSphereAlgorithm.cpp +++ b/src/collision/narrowphase/SphereVsSphereAlgorithm.cpp @@ -28,17 +28,7 @@ #include "collision/shapes/SphereShape.h" // We want to use the ReactPhysics3D namespace -using namespace reactphysics3d; - -// Constructor -SphereVsSphereAlgorithm::SphereVsSphereAlgorithm() : NarrowPhaseAlgorithm() { - -} - -// Destructor -SphereVsSphereAlgorithm::~SphereVsSphereAlgorithm() { - -} +using namespace reactphysics3d; void SphereVsSphereAlgorithm::testCollision(const CollisionShapeInfo& shape1Info, const CollisionShapeInfo& shape2Info, diff --git a/src/collision/narrowphase/SphereVsSphereAlgorithm.h b/src/collision/narrowphase/SphereVsSphereAlgorithm.h index 9875d814..525c55d5 100644 --- a/src/collision/narrowphase/SphereVsSphereAlgorithm.h +++ b/src/collision/narrowphase/SphereVsSphereAlgorithm.h @@ -49,10 +49,10 @@ class SphereVsSphereAlgorithm : public NarrowPhaseAlgorithm { // -------------------- Methods -------------------- // /// Constructor - SphereVsSphereAlgorithm(); + SphereVsSphereAlgorithm() = default; /// Destructor - virtual ~SphereVsSphereAlgorithm() override; + virtual ~SphereVsSphereAlgorithm() override = default; /// Deleted copy-constructor SphereVsSphereAlgorithm(const SphereVsSphereAlgorithm& algorithm) = delete; diff --git a/src/collision/shapes/AABB.cpp b/src/collision/shapes/AABB.cpp index 0e18eebd..6c43aeb6 100644 --- a/src/collision/shapes/AABB.cpp +++ b/src/collision/shapes/AABB.cpp @@ -31,11 +31,6 @@ using namespace reactphysics3d; using namespace std; -// Constructor -AABB::AABB() { - -} - // Constructor AABB::AABB(const Vector3& minCoordinates, const Vector3& maxCoordinates) :mMinCoordinates(minCoordinates), mMaxCoordinates(maxCoordinates) { @@ -48,11 +43,6 @@ AABB::AABB(const AABB& aabb) } -// Destructor -AABB::~AABB() { - -} - // Merge the AABB in parameter with the current one void AABB::mergeWithAABB(const AABB& aabb) { mMinCoordinates.x = std::min(mMinCoordinates.x, aabb.mMinCoordinates.x); diff --git a/src/collision/shapes/AABB.h b/src/collision/shapes/AABB.h index 364dfc83..8683db55 100644 --- a/src/collision/shapes/AABB.h +++ b/src/collision/shapes/AABB.h @@ -56,7 +56,7 @@ class AABB { // -------------------- Methods -------------------- // /// Constructor - AABB(); + AABB() = default; /// Constructor AABB(const Vector3& minCoordinates, const Vector3& maxCoordinates); @@ -65,7 +65,7 @@ class AABB { AABB(const AABB& aabb); /// Destructor - ~AABB(); + ~AABB() = default; /// Return the center point Vector3 getCenter() const; diff --git a/src/collision/shapes/BoxShape.cpp b/src/collision/shapes/BoxShape.cpp index 764918c7..ce3197e3 100644 --- a/src/collision/shapes/BoxShape.cpp +++ b/src/collision/shapes/BoxShape.cpp @@ -44,11 +44,6 @@ BoxShape::BoxShape(const Vector3& extent, decimal margin) assert(extent.z > decimal(0.0) && extent.z > margin); } -// Destructor -BoxShape::~BoxShape() { - -} - // Return the local inertia tensor of the collision shape /** * @param[out] tensor The 3x3 inertia tensor matrix of the shape in local-space diff --git a/src/collision/shapes/BoxShape.h b/src/collision/shapes/BoxShape.h index 972012a8..0ba0942a 100644 --- a/src/collision/shapes/BoxShape.h +++ b/src/collision/shapes/BoxShape.h @@ -82,7 +82,7 @@ class BoxShape : public ConvexShape { BoxShape(const Vector3& extent, decimal margin = OBJECT_MARGIN); /// Destructor - virtual ~BoxShape() override; + virtual ~BoxShape() override = default; /// Deleted copy-constructor BoxShape(const BoxShape& shape) = delete; diff --git a/src/collision/shapes/CapsuleShape.cpp b/src/collision/shapes/CapsuleShape.cpp index a8b231f5..f9f442ce 100644 --- a/src/collision/shapes/CapsuleShape.cpp +++ b/src/collision/shapes/CapsuleShape.cpp @@ -42,11 +42,6 @@ CapsuleShape::CapsuleShape(decimal radius, decimal height) assert(height > decimal(0.0)); } -// Destructor -CapsuleShape::~CapsuleShape() { - -} - // Return the local inertia tensor of the capsule /** * @param[out] tensor The 3x3 inertia tensor matrix of the shape in local-space diff --git a/src/collision/shapes/CapsuleShape.h b/src/collision/shapes/CapsuleShape.h index fae76ce0..19122111 100644 --- a/src/collision/shapes/CapsuleShape.h +++ b/src/collision/shapes/CapsuleShape.h @@ -81,7 +81,7 @@ class CapsuleShape : public ConvexShape { CapsuleShape(decimal radius, decimal height); /// Destructor - virtual ~CapsuleShape() override; + virtual ~CapsuleShape() override = default; /// Deleted copy-constructor CapsuleShape(const CapsuleShape& shape) = delete; diff --git a/src/collision/shapes/CollisionShape.cpp b/src/collision/shapes/CollisionShape.cpp index b71c9467..301c97d2 100644 --- a/src/collision/shapes/CollisionShape.cpp +++ b/src/collision/shapes/CollisionShape.cpp @@ -36,11 +36,6 @@ CollisionShape::CollisionShape(CollisionShapeType type) : mType(type), mScaling( } -// Destructor -CollisionShape::~CollisionShape() { - -} - // Compute the world-space AABB of the collision shape given a transform /** * @param[out] aabb The axis-aligned bounding box (AABB) of the collision shape diff --git a/src/collision/shapes/CollisionShape.h b/src/collision/shapes/CollisionShape.h index 2c50dac9..cd261717 100644 --- a/src/collision/shapes/CollisionShape.h +++ b/src/collision/shapes/CollisionShape.h @@ -84,7 +84,7 @@ class CollisionShape { CollisionShape(CollisionShapeType type); /// Destructor - virtual ~CollisionShape(); + virtual ~CollisionShape() = default; /// Deleted copy-constructor CollisionShape(const CollisionShape& shape) = delete; diff --git a/src/collision/shapes/ConcaveMeshShape.cpp b/src/collision/shapes/ConcaveMeshShape.cpp index dfec3ba2..a0bd1094 100644 --- a/src/collision/shapes/ConcaveMeshShape.cpp +++ b/src/collision/shapes/ConcaveMeshShape.cpp @@ -38,11 +38,6 @@ ConcaveMeshShape::ConcaveMeshShape(TriangleMesh* triangleMesh) initBVHTree(); } -// Destructor -ConcaveMeshShape::~ConcaveMeshShape() { - -} - // Insert all the triangles into the dynamic AABB tree void ConcaveMeshShape::initBVHTree() { diff --git a/src/collision/shapes/ConcaveMeshShape.h b/src/collision/shapes/ConcaveMeshShape.h index 2af6ed9f..83e5103a 100644 --- a/src/collision/shapes/ConcaveMeshShape.h +++ b/src/collision/shapes/ConcaveMeshShape.h @@ -140,7 +140,7 @@ class ConcaveMeshShape : public ConcaveShape { ConcaveMeshShape(TriangleMesh* triangleMesh); /// Destructor - virtual ~ConcaveMeshShape(); + virtual ~ConcaveMeshShape() = default; /// Deleted copy-constructor ConcaveMeshShape(const ConcaveMeshShape& shape) = delete; diff --git a/src/collision/shapes/ConcaveShape.cpp b/src/collision/shapes/ConcaveShape.cpp index 017a277a..3f691468 100644 --- a/src/collision/shapes/ConcaveShape.cpp +++ b/src/collision/shapes/ConcaveShape.cpp @@ -36,8 +36,3 @@ ConcaveShape::ConcaveShape(CollisionShapeType type) mTriangleMargin(0), mRaycastTestType(TriangleRaycastSide::FRONT) { } - -// Destructor -ConcaveShape::~ConcaveShape() { - -} diff --git a/src/collision/shapes/ConcaveShape.h b/src/collision/shapes/ConcaveShape.h index 14bebf4d..92d20b33 100644 --- a/src/collision/shapes/ConcaveShape.h +++ b/src/collision/shapes/ConcaveShape.h @@ -43,7 +43,7 @@ class TriangleCallback { public: /// Destructor - virtual ~TriangleCallback() {} + virtual ~TriangleCallback() = default; /// Report a triangle virtual void testTriangle(const Vector3* trianglePoints)=0; @@ -84,7 +84,7 @@ class ConcaveShape : public CollisionShape { ConcaveShape(CollisionShapeType type); /// Destructor - virtual ~ConcaveShape() override; + virtual ~ConcaveShape() override = default; /// Deleted copy-constructor ConcaveShape(const ConcaveShape& shape) = delete; diff --git a/src/collision/shapes/ConeShape.cpp b/src/collision/shapes/ConeShape.cpp index fc166895..4a1ece33 100644 --- a/src/collision/shapes/ConeShape.cpp +++ b/src/collision/shapes/ConeShape.cpp @@ -46,11 +46,6 @@ ConeShape::ConeShape(decimal radius, decimal height, decimal margin) mSinTheta = mRadius / (sqrt(mRadius * mRadius + height * height)); } -// Destructor -ConeShape::~ConeShape() { - -} - // Return a local support point in a given direction without the object margin Vector3 ConeShape::getLocalSupportPointWithoutMargin(const Vector3& direction, void** cachedCollisionData) const { diff --git a/src/collision/shapes/ConeShape.h b/src/collision/shapes/ConeShape.h index e0ff722a..33d7c861 100644 --- a/src/collision/shapes/ConeShape.h +++ b/src/collision/shapes/ConeShape.h @@ -87,7 +87,7 @@ class ConeShape : public ConvexShape { ConeShape(decimal mRadius, decimal height, decimal margin = OBJECT_MARGIN); /// Destructor - virtual ~ConeShape() override; + virtual ~ConeShape() override = default; /// Deleted copy-constructor ConeShape(const ConeShape& shape) = delete; diff --git a/src/collision/shapes/ConvexMeshShape.cpp b/src/collision/shapes/ConvexMeshShape.cpp index aedab6d1..cc880a25 100644 --- a/src/collision/shapes/ConvexMeshShape.cpp +++ b/src/collision/shapes/ConvexMeshShape.cpp @@ -140,11 +140,6 @@ ConvexMeshShape::ConvexMeshShape(decimal margin) } -// Destructor -ConvexMeshShape::~ConvexMeshShape() { - -} - // Return a local support point in a given direction without the object margin. /// If the edges information is not used for collision detection, this method will go through /// the whole vertices list and pick up the vertex with the largest dot product in the support diff --git a/src/collision/shapes/ConvexMeshShape.h b/src/collision/shapes/ConvexMeshShape.h index 449762a5..cbc5c692 100644 --- a/src/collision/shapes/ConvexMeshShape.h +++ b/src/collision/shapes/ConvexMeshShape.h @@ -120,7 +120,7 @@ class ConvexMeshShape : public ConvexShape { ConvexMeshShape(decimal margin = OBJECT_MARGIN); /// Destructor - virtual ~ConvexMeshShape() override; + virtual ~ConvexMeshShape() override = default; /// Deleted copy-constructor ConvexMeshShape(const ConvexMeshShape& shape) = delete; diff --git a/src/collision/shapes/ConvexShape.cpp b/src/collision/shapes/ConvexShape.cpp index 2faa877f..f077cdcb 100644 --- a/src/collision/shapes/ConvexShape.cpp +++ b/src/collision/shapes/ConvexShape.cpp @@ -36,11 +36,6 @@ ConvexShape::ConvexShape(CollisionShapeType type, decimal margin) } -// Destructor -ConvexShape::~ConvexShape() { - -} - // Return a local support point in a given direction with the object margin Vector3 ConvexShape::getLocalSupportPointWithMargin(const Vector3& direction, void** cachedCollisionData) const { diff --git a/src/collision/shapes/ConvexShape.h b/src/collision/shapes/ConvexShape.h index f70a88e1..4b12cae4 100644 --- a/src/collision/shapes/ConvexShape.h +++ b/src/collision/shapes/ConvexShape.h @@ -56,9 +56,6 @@ class ConvexShape : public CollisionShape { virtual Vector3 getLocalSupportPointWithoutMargin(const Vector3& direction, void** cachedCollisionData) const=0; - /// Return true if a point is inside the collision shape - virtual bool testPointInside(const Vector3& worldPoint, ProxyShape* proxyShape) const=0; - public : // -------------------- Methods -------------------- // @@ -67,7 +64,7 @@ class ConvexShape : public CollisionShape { ConvexShape(CollisionShapeType type, decimal margin); /// Destructor - virtual ~ConvexShape() override; + virtual ~ConvexShape() override = default; /// Deleted copy-constructor ConvexShape(const ConvexShape& shape) = delete; diff --git a/src/collision/shapes/CylinderShape.cpp b/src/collision/shapes/CylinderShape.cpp index 5485bb37..8cb405f1 100644 --- a/src/collision/shapes/CylinderShape.cpp +++ b/src/collision/shapes/CylinderShape.cpp @@ -43,11 +43,6 @@ CylinderShape::CylinderShape(decimal radius, decimal height, decimal margin) assert(height > decimal(0.0)); } -// Destructor -CylinderShape::~CylinderShape() { - -} - // Return a local support point in a given direction without the object margin Vector3 CylinderShape::getLocalSupportPointWithoutMargin(const Vector3& direction, void** cachedCollisionData) const { diff --git a/src/collision/shapes/CylinderShape.h b/src/collision/shapes/CylinderShape.h index 4ac7d811..2718d2ff 100644 --- a/src/collision/shapes/CylinderShape.h +++ b/src/collision/shapes/CylinderShape.h @@ -84,7 +84,7 @@ class CylinderShape : public ConvexShape { CylinderShape(decimal radius, decimal height, decimal margin = OBJECT_MARGIN); /// Destructor - virtual ~CylinderShape() override; + virtual ~CylinderShape() override = default; /// Deleted copy-constructor CylinderShape(const CylinderShape& shape) = delete; diff --git a/src/collision/shapes/HeightFieldShape.cpp b/src/collision/shapes/HeightFieldShape.cpp index 720619e8..02ef852f 100644 --- a/src/collision/shapes/HeightFieldShape.cpp +++ b/src/collision/shapes/HeightFieldShape.cpp @@ -74,11 +74,6 @@ HeightFieldShape::HeightFieldShape(int nbGridColumns, int nbGridRows, decimal mi } } -// Destructor -HeightFieldShape::~HeightFieldShape() { - -} - // Return the local bounds of the shape in x, y and z directions. // This method is used to compute the AABB of the box /** diff --git a/src/collision/shapes/HeightFieldShape.h b/src/collision/shapes/HeightFieldShape.h index be6819e5..6f2b8459 100644 --- a/src/collision/shapes/HeightFieldShape.h +++ b/src/collision/shapes/HeightFieldShape.h @@ -159,7 +159,7 @@ class HeightFieldShape : public ConcaveShape { int upAxis = 1, decimal integerHeightScale = 1.0f); /// Destructor - virtual ~HeightFieldShape() override; + virtual ~HeightFieldShape() override = default; /// Deleted copy-constructor HeightFieldShape(const HeightFieldShape& shape) = delete; diff --git a/src/collision/shapes/SphereShape.cpp b/src/collision/shapes/SphereShape.cpp index 50c2e94d..73fe49aa 100644 --- a/src/collision/shapes/SphereShape.cpp +++ b/src/collision/shapes/SphereShape.cpp @@ -39,11 +39,6 @@ SphereShape::SphereShape(decimal radius) : ConvexShape(CollisionShapeType::SPHER assert(radius > decimal(0.0)); } -// Destructor -SphereShape::~SphereShape() { - -} - // Raycast method with feedback information bool SphereShape::raycast(const Ray& ray, RaycastInfo& raycastInfo, ProxyShape* proxyShape) const { diff --git a/src/collision/shapes/SphereShape.h b/src/collision/shapes/SphereShape.h index dc6a6cea..36b3a1f7 100644 --- a/src/collision/shapes/SphereShape.h +++ b/src/collision/shapes/SphereShape.h @@ -46,9 +46,6 @@ class SphereShape : public ConvexShape { protected : - // -------------------- Attributes -------------------- // - - // -------------------- Methods -------------------- // /// Return a local support point in a given direction without the object margin @@ -72,7 +69,7 @@ class SphereShape : public ConvexShape { SphereShape(decimal radius); /// Destructor - virtual ~SphereShape() override; + virtual ~SphereShape() override = default; /// Deleted copy-constructor SphereShape(const SphereShape& shape) = delete; diff --git a/src/collision/shapes/TriangleShape.cpp b/src/collision/shapes/TriangleShape.cpp index 065b7526..4767435b 100644 --- a/src/collision/shapes/TriangleShape.cpp +++ b/src/collision/shapes/TriangleShape.cpp @@ -47,11 +47,6 @@ TriangleShape::TriangleShape(const Vector3& point1, const Vector3& point2, const mRaycastTestType = TriangleRaycastSide::FRONT; } -// Destructor -TriangleShape::~TriangleShape() { - -} - // Raycast method with feedback information /// This method use the line vs triangle raycasting technique described in /// Real-time Collision Detection by Christer Ericson. diff --git a/src/collision/shapes/TriangleShape.h b/src/collision/shapes/TriangleShape.h index 699a42fc..5faae51b 100644 --- a/src/collision/shapes/TriangleShape.h +++ b/src/collision/shapes/TriangleShape.h @@ -87,7 +87,7 @@ class TriangleShape : public ConvexShape { decimal margin = OBJECT_MARGIN); /// Destructor - virtual ~TriangleShape() override; + virtual ~TriangleShape() override = default; /// Deleted copy-constructor TriangleShape(const TriangleShape& shape) = delete; diff --git a/src/constraint/BallAndSocketJoint.cpp b/src/constraint/BallAndSocketJoint.cpp index 448499de..497a45dc 100644 --- a/src/constraint/BallAndSocketJoint.cpp +++ b/src/constraint/BallAndSocketJoint.cpp @@ -41,11 +41,6 @@ BallAndSocketJoint::BallAndSocketJoint(const BallAndSocketJointInfo& jointInfo) mLocalAnchorPointBody2 = mBody2->getTransform().getInverse() * jointInfo.anchorPointWorldSpace; } -// Destructor -BallAndSocketJoint::~BallAndSocketJoint() { - -} - // Initialize before solving the constraint void BallAndSocketJoint::initBeforeSolve(const ConstraintSolverData& constraintSolverData) { diff --git a/src/constraint/BallAndSocketJoint.h b/src/constraint/BallAndSocketJoint.h index 4244823c..c8836a23 100644 --- a/src/constraint/BallAndSocketJoint.h +++ b/src/constraint/BallAndSocketJoint.h @@ -128,7 +128,7 @@ class BallAndSocketJoint : public Joint { BallAndSocketJoint(const BallAndSocketJointInfo& jointInfo); /// Destructor - virtual ~BallAndSocketJoint() override; + virtual ~BallAndSocketJoint() override = default; /// Deleted copy-constructor BallAndSocketJoint(const BallAndSocketJoint& constraint) = delete; diff --git a/src/constraint/ContactPoint.cpp b/src/constraint/ContactPoint.cpp index ccc7e960..3be8476a 100644 --- a/src/constraint/ContactPoint.cpp +++ b/src/constraint/ContactPoint.cpp @@ -51,8 +51,3 @@ ContactPoint::ContactPoint(const ContactPointInfo& contactInfo) assert(mPenetrationDepth > 0.0); } - -// Destructor -ContactPoint::~ContactPoint() { - -} diff --git a/src/constraint/ContactPoint.h b/src/constraint/ContactPoint.h index b7fef547..d2e8f189 100644 --- a/src/constraint/ContactPoint.h +++ b/src/constraint/ContactPoint.h @@ -151,7 +151,7 @@ class ContactPoint { ContactPoint(const ContactPointInfo& contactInfo); /// Destructor - ~ContactPoint(); + ~ContactPoint() = default; /// Deleted copy-constructor ContactPoint(const ContactPoint& contact) = delete; diff --git a/src/constraint/FixedJoint.cpp b/src/constraint/FixedJoint.cpp index 687043e8..9ed31f01 100644 --- a/src/constraint/FixedJoint.cpp +++ b/src/constraint/FixedJoint.cpp @@ -49,11 +49,6 @@ FixedJoint::FixedJoint(const FixedJointInfo& jointInfo) mInitOrientationDifferenceInv.inverse(); } -// Destructor -FixedJoint::~FixedJoint() { - -} - // Initialize before solving the constraint void FixedJoint::initBeforeSolve(const ConstraintSolverData& constraintSolverData) { diff --git a/src/constraint/FixedJoint.h b/src/constraint/FixedJoint.h index 54c9624c..e08b31cc 100644 --- a/src/constraint/FixedJoint.h +++ b/src/constraint/FixedJoint.h @@ -139,7 +139,7 @@ class FixedJoint : public Joint { FixedJoint(const FixedJointInfo& jointInfo); /// Destructor - virtual ~FixedJoint() override; + virtual ~FixedJoint() override = default; /// Deleted copy-constructor FixedJoint(const FixedJoint& constraint) = delete; diff --git a/src/constraint/HingeJoint.cpp b/src/constraint/HingeJoint.cpp index 021ee495..4b152caa 100644 --- a/src/constraint/HingeJoint.cpp +++ b/src/constraint/HingeJoint.cpp @@ -64,11 +64,6 @@ HingeJoint::HingeJoint(const HingeJointInfo& jointInfo) mInitOrientationDifferenceInv.inverse(); } -// Destructor -HingeJoint::~HingeJoint() { - -} - // Initialize before solving the constraint void HingeJoint::initBeforeSolve(const ConstraintSolverData& constraintSolverData) { diff --git a/src/constraint/HingeJoint.h b/src/constraint/HingeJoint.h index 21960697..c553755d 100644 --- a/src/constraint/HingeJoint.h +++ b/src/constraint/HingeJoint.h @@ -290,7 +290,7 @@ class HingeJoint : public Joint { HingeJoint(const HingeJointInfo& jointInfo); /// Destructor - virtual ~HingeJoint() override; + virtual ~HingeJoint() override = default; /// Deleted copy-constructor HingeJoint(const HingeJoint& constraint) = delete; diff --git a/src/constraint/Joint.cpp b/src/constraint/Joint.cpp index 5c6a98f7..2c0695ab 100644 --- a/src/constraint/Joint.cpp +++ b/src/constraint/Joint.cpp @@ -37,8 +37,3 @@ Joint::Joint(const JointInfo& jointInfo) assert(mBody1 != nullptr); assert(mBody2 != nullptr); } - -// Destructor -Joint::~Joint() { - -} diff --git a/src/constraint/Joint.h b/src/constraint/Joint.h index eb73f87f..ead08a53 100644 --- a/src/constraint/Joint.h +++ b/src/constraint/Joint.h @@ -106,7 +106,7 @@ struct JointInfo { } /// Destructor - virtual ~JointInfo() {} + virtual ~JointInfo() = default; }; @@ -172,7 +172,7 @@ class Joint { Joint(const JointInfo& jointInfo); /// Destructor - virtual ~Joint(); + virtual ~Joint() = default; /// Deleted copy-constructor Joint(const Joint& constraint) = delete; diff --git a/src/constraint/SliderJoint.cpp b/src/constraint/SliderJoint.cpp index 365a9ad4..efe7cbff 100644 --- a/src/constraint/SliderJoint.cpp +++ b/src/constraint/SliderJoint.cpp @@ -63,11 +63,6 @@ SliderJoint::SliderJoint(const SliderJointInfo& jointInfo) mSliderAxisBody1.normalize(); } -// Destructor -SliderJoint::~SliderJoint() { - -} - // Initialize before solving the constraint void SliderJoint::initBeforeSolve(const ConstraintSolverData& constraintSolverData) { diff --git a/src/constraint/SliderJoint.h b/src/constraint/SliderJoint.h index 859cbe28..e01a9ab4 100644 --- a/src/constraint/SliderJoint.h +++ b/src/constraint/SliderJoint.h @@ -288,7 +288,7 @@ class SliderJoint : public Joint { SliderJoint(const SliderJointInfo& jointInfo); /// Destructor - virtual ~SliderJoint() override; + virtual ~SliderJoint() override = default; /// Deleted copy-constructor SliderJoint(const SliderJoint& constraint) = delete; diff --git a/src/engine/ConstraintSolver.cpp b/src/engine/ConstraintSolver.cpp index f52056e7..547aea6e 100644 --- a/src/engine/ConstraintSolver.cpp +++ b/src/engine/ConstraintSolver.cpp @@ -36,11 +36,6 @@ ConstraintSolver::ConstraintSolver(const std::map& mapBodyToVe } -// Destructor -ConstraintSolver::~ConstraintSolver() { - -} - // Initialize the constraint solver for a given island void ConstraintSolver::initializeForIsland(decimal dt, Island* island) { diff --git a/src/engine/ConstraintSolver.h b/src/engine/ConstraintSolver.h index dd76c4b8..ea16a844 100644 --- a/src/engine/ConstraintSolver.h +++ b/src/engine/ConstraintSolver.h @@ -173,7 +173,7 @@ class ConstraintSolver { ConstraintSolver(const std::map& mapBodyToVelocityIndex); /// Destructor - ~ConstraintSolver(); + ~ConstraintSolver() = default; /// Initialize the constraint solver for a given island void initializeForIsland(decimal dt, Island* island); diff --git a/src/engine/ContactSolver.cpp b/src/engine/ContactSolver.cpp index faf58825..a11cc2e9 100644 --- a/src/engine/ContactSolver.cpp +++ b/src/engine/ContactSolver.cpp @@ -48,11 +48,6 @@ ContactSolver::ContactSolver(const std::map& mapBodyToVelocity } -// Destructor -ContactSolver::~ContactSolver() { - -} - // Initialize the constraint solver for a given island void ContactSolver::initializeForIsland(decimal dt, Island* island) { diff --git a/src/engine/ContactSolver.h b/src/engine/ContactSolver.h index 203d140e..5b944c2f 100644 --- a/src/engine/ContactSolver.h +++ b/src/engine/ContactSolver.h @@ -413,7 +413,7 @@ class ContactSolver { ContactSolver(const std::map& mapBodyToVelocityIndex); /// Destructor - virtual ~ContactSolver(); + ~ContactSolver() = default; /// Initialize the constraint solver for a given island void initializeForIsland(decimal dt, Island* island); diff --git a/src/engine/EventListener.h b/src/engine/EventListener.h index a2e9d868..562e8ac7 100644 --- a/src/engine/EventListener.h +++ b/src/engine/EventListener.h @@ -44,10 +44,10 @@ class EventListener { public : /// Constructor - EventListener() {} + EventListener() = default; /// Destructor - virtual ~EventListener() {} + virtual ~EventListener() = default; /// Called when a new contact point is found between two bodies that were separated before /** diff --git a/src/engine/Material.cpp b/src/engine/Material.cpp index 4dc99647..f0484c96 100644 --- a/src/engine/Material.cpp +++ b/src/engine/Material.cpp @@ -42,8 +42,3 @@ Material::Material(const Material& material) mRollingResistance(material.mRollingResistance), mBounciness(material.mBounciness) { } - -// Destructor -Material::~Material() { - -} diff --git a/src/engine/Material.h b/src/engine/Material.h index c820cb93..ca5fd532 100644 --- a/src/engine/Material.h +++ b/src/engine/Material.h @@ -64,7 +64,7 @@ class Material { Material(const Material& material); /// Destructor - ~Material(); + ~Material() = default; /// Return the bounciness decimal getBounciness() const; diff --git a/src/engine/OverlappingPair.cpp b/src/engine/OverlappingPair.cpp index fa45817e..979ecc52 100644 --- a/src/engine/OverlappingPair.cpp +++ b/src/engine/OverlappingPair.cpp @@ -35,9 +35,4 @@ OverlappingPair::OverlappingPair(ProxyShape* shape1, ProxyShape* shape2, : mContactManifoldSet(shape1, shape2, memoryAllocator, nbMaxContactManifolds), mCachedSeparatingAxis(1.0, 1.0, 1.0) { -} - -// Destructor -OverlappingPair::~OverlappingPair() { - -} +} diff --git a/src/engine/OverlappingPair.h b/src/engine/OverlappingPair.h index e40814ca..7995b0d2 100644 --- a/src/engine/OverlappingPair.h +++ b/src/engine/OverlappingPair.h @@ -66,7 +66,7 @@ class OverlappingPair { int nbMaxContactManifolds, MemoryAllocator& memoryAllocator); /// Destructor - ~OverlappingPair(); + ~OverlappingPair() = default; /// Deleted copy-constructor OverlappingPair(const OverlappingPair& pair) = delete; diff --git a/src/engine/Timer.cpp b/src/engine/Timer.cpp index e9a14d21..7d50dd79 100644 --- a/src/engine/Timer.cpp +++ b/src/engine/Timer.cpp @@ -34,11 +34,6 @@ Timer::Timer(double timeStep) : mTimeStep(timeStep), mIsRunning(false) { assert(timeStep > 0.0); } -// Destructor -Timer::~Timer() { - -} - // Return the current time of the system in seconds long double Timer::getCurrentSystemTime() { diff --git a/src/engine/Timer.h b/src/engine/Timer.h index 9c59d033..83fc0b0a 100644 --- a/src/engine/Timer.h +++ b/src/engine/Timer.h @@ -79,7 +79,7 @@ class Timer { Timer(double timeStep); /// Destructor - ~Timer(); + ~Timer() = default; /// Deleted copy-constructor Timer(const Timer& timer) = delete; diff --git a/src/mathematics/Matrix2x2.cpp b/src/mathematics/Matrix2x2.cpp index 30fdc1a8..c501c1db 100644 --- a/src/mathematics/Matrix2x2.cpp +++ b/src/mathematics/Matrix2x2.cpp @@ -47,11 +47,6 @@ Matrix2x2::Matrix2x2(decimal a1, decimal a2, decimal b1, decimal b2) { setAllValues(a1, a2, b1, b2); } -// Destructor -Matrix2x2::~Matrix2x2() { - -} - // Copy-constructor Matrix2x2::Matrix2x2(const Matrix2x2& matrix) { setAllValues(matrix.mRows[0][0], matrix.mRows[0][1], diff --git a/src/mathematics/Matrix2x2.h b/src/mathematics/Matrix2x2.h index 9e9a6e4d..ee31b07a 100644 --- a/src/mathematics/Matrix2x2.h +++ b/src/mathematics/Matrix2x2.h @@ -60,7 +60,7 @@ class Matrix2x2 { Matrix2x2(decimal a1, decimal a2, decimal b1, decimal b2); /// Destructor - ~Matrix2x2(); + ~Matrix2x2() = default; /// Copy-constructor Matrix2x2(const Matrix2x2& matrix); diff --git a/src/mathematics/Matrix3x3.cpp b/src/mathematics/Matrix3x3.cpp index 3cd03509..a5491ed4 100644 --- a/src/mathematics/Matrix3x3.cpp +++ b/src/mathematics/Matrix3x3.cpp @@ -49,11 +49,6 @@ Matrix3x3::Matrix3x3(decimal a1, decimal a2, decimal a3, setAllValues(a1, a2, a3, b1, b2, b3, c1, c2, c3); } -// Destructor -Matrix3x3::~Matrix3x3() { - -} - // Copy-constructor Matrix3x3::Matrix3x3(const Matrix3x3& matrix) { setAllValues(matrix.mRows[0][0], matrix.mRows[0][1], matrix.mRows[0][2], diff --git a/src/mathematics/Matrix3x3.h b/src/mathematics/Matrix3x3.h index 50d9dbd0..dfa23085 100644 --- a/src/mathematics/Matrix3x3.h +++ b/src/mathematics/Matrix3x3.h @@ -63,7 +63,7 @@ class Matrix3x3 { decimal c1, decimal c2, decimal c3); /// Destructor - ~Matrix3x3(); + ~Matrix3x3() = default; /// Copy-constructor Matrix3x3(const Matrix3x3& matrix); diff --git a/src/mathematics/Quaternion.cpp b/src/mathematics/Quaternion.cpp index 3236a1b7..0b2587f5 100644 --- a/src/mathematics/Quaternion.cpp +++ b/src/mathematics/Quaternion.cpp @@ -128,11 +128,6 @@ Quaternion::Quaternion(const Matrix3x3& matrix) { } } -// Destructor -Quaternion::~Quaternion() { - -} - // Compute the rotation angle (in radians) and the rotation axis /// This method is used to get the rotation angle (in radian) and the unit /// rotation axis of an orientation quaternion. diff --git a/src/mathematics/Quaternion.h b/src/mathematics/Quaternion.h index c1bb584d..360cf229 100644 --- a/src/mathematics/Quaternion.h +++ b/src/mathematics/Quaternion.h @@ -82,7 +82,7 @@ struct Quaternion { Quaternion(const Matrix3x3& matrix); /// Destructor - ~Quaternion(); + ~Quaternion() = default; /// Set all the values void setAllValues(decimal newX, decimal newY, decimal newZ, decimal newW); diff --git a/src/mathematics/Ray.h b/src/mathematics/Ray.h index 10f182b0..938e8960 100644 --- a/src/mathematics/Ray.h +++ b/src/mathematics/Ray.h @@ -67,9 +67,7 @@ struct Ray { } /// Destructor - ~Ray() { - - } + ~Ray() = default; /// Overloaded assignment operator Ray& operator=(const Ray& ray) { diff --git a/src/mathematics/Transform.cpp b/src/mathematics/Transform.cpp index 4a77d84c..4bc91253 100644 --- a/src/mathematics/Transform.cpp +++ b/src/mathematics/Transform.cpp @@ -51,8 +51,3 @@ Transform::Transform(const Transform& transform) : mPosition(transform.mPosition), mOrientation(transform.mOrientation) { } - -// Destructor -Transform::~Transform() { - -} diff --git a/src/mathematics/Transform.h b/src/mathematics/Transform.h index 35d1862c..a93734cd 100644 --- a/src/mathematics/Transform.h +++ b/src/mathematics/Transform.h @@ -65,7 +65,7 @@ class Transform { Transform(const Vector3& position, const Quaternion& orientation); /// Destructor - ~Transform(); + ~Transform() = default; /// Copy-constructor Transform(const Transform& transform); diff --git a/src/mathematics/Vector2.cpp b/src/mathematics/Vector2.cpp index 55926bfd..2f225636 100644 --- a/src/mathematics/Vector2.cpp +++ b/src/mathematics/Vector2.cpp @@ -45,11 +45,6 @@ Vector2::Vector2(const Vector2& vector) : x(vector.x), y(vector.y) { } -// Destructor -Vector2::~Vector2() { - -} - // Return the corresponding unit vector Vector2 Vector2::getUnit() const { decimal lengthVector = length(); diff --git a/src/mathematics/Vector2.h b/src/mathematics/Vector2.h index 6e30363b..4b0e32f1 100644 --- a/src/mathematics/Vector2.h +++ b/src/mathematics/Vector2.h @@ -64,7 +64,7 @@ struct Vector2 { Vector2(const Vector2& vector); /// Destructor - ~Vector2(); + ~Vector2() = default; /// Set all the values of the vector void setAllValues(decimal newX, decimal newY); diff --git a/src/mathematics/Vector3.cpp b/src/mathematics/Vector3.cpp index f356705a..ed29a37f 100644 --- a/src/mathematics/Vector3.cpp +++ b/src/mathematics/Vector3.cpp @@ -46,11 +46,6 @@ Vector3::Vector3(const Vector3& vector) : x(vector.x), y(vector.y), z(vector.z) } -// Destructor -Vector3::~Vector3() { - -} - // Return the corresponding unit vector Vector3 Vector3::getUnit() const { decimal lengthVector = length(); diff --git a/src/mathematics/Vector3.h b/src/mathematics/Vector3.h index 0936f4ef..4f30391d 100644 --- a/src/mathematics/Vector3.h +++ b/src/mathematics/Vector3.h @@ -67,7 +67,7 @@ struct Vector3 { Vector3(const Vector3& vector); /// Destructor - ~Vector3(); + ~Vector3() = default; /// Set all the values of the vector void setAllValues(decimal newX, decimal newY, decimal newZ);