diff --git a/sources/reactphysics3d/body/BodyState.cpp b/sources/reactphysics3d/body/BodyState.cpp index 5ec28a1e..37cf6de8 100644 --- a/sources/reactphysics3d/body/BodyState.cpp +++ b/sources/reactphysics3d/body/BodyState.cpp @@ -63,3 +63,8 @@ void BodyState::recalculate() { // Compute the spin quaternion spin = Quaternion(0, angularVelocity.getX(), angularVelocity.getY(), angularVelocity.getZ()) * orientation * 0.5; } + +// Overloaded operator for the multiplication with a number +BodyState BodyState::operator*(double number) const { + // TODO : Implement this method +} diff --git a/sources/reactphysics3d/body/BodyState.h b/sources/reactphysics3d/body/BodyState.h index cb907a85..f45fba69 100644 --- a/sources/reactphysics3d/body/BodyState.h +++ b/sources/reactphysics3d/body/BodyState.h @@ -68,6 +68,9 @@ class BodyState { void setInertiaTensorInverse(const Matrix3x3& inertiaTensorInverse); // Set the inverse of the inertia tensor void recalculate(); // Recalculate the secondary values of the BodyState + + // Overloaded operators + BodyState operator*(double number) const; // Overloaded operator for the multiplication with a number }; // --- Inlines functions --- // diff --git a/sources/reactphysics3d/body/RigidBody.h b/sources/reactphysics3d/body/RigidBody.h index 426d1c4f..2c917097 100644 --- a/sources/reactphysics3d/body/RigidBody.h +++ b/sources/reactphysics3d/body/RigidBody.h @@ -60,22 +60,22 @@ class RigidBody : public Body { // --- Inline functions --- // // Return the inertia tensor of the body -Matrix3x3 RigidBody::getInertiaTensor() const { +inline Matrix3x3 RigidBody::getInertiaTensor() const { return inertiaTensor; } // Set the inertia tensor of the body -void RigidBody::setInertiaTensor(const Matrix3x3& inertiaTensor) { +inline void RigidBody::setInertiaTensor(const Matrix3x3& inertiaTensor) { this->inertiaTensor = inertiaTensor; } // Return the current state of the body -BodyState RigidBody::getCurrentBodyState() const { +inline BodyState RigidBody::getCurrentBodyState() const { return currentBodyState; } // Return the previous state of the body -BodyState RigidBody::getPreviousBodyState() const { +inline BodyState RigidBody::getPreviousBodyState() const { return previousBodyState; }