From 85b1e36914cdafaa694120a86ded70e27c17a58c Mon Sep 17 00:00:00 2001 From: "chappuis.daniel" Date: Tue, 10 Feb 2009 16:05:23 +0000 Subject: [PATCH] git-svn-id: https://reactphysics3d.googlecode.com/svn/trunk@84 92aac97c-a6ce-11dd-a772-7fcde58d38e6 --- sources/reactphysics3d/body/BodyState.cpp | 5 +++++ sources/reactphysics3d/body/BodyState.h | 3 +++ sources/reactphysics3d/body/RigidBody.h | 8 ++++---- 3 files changed, 12 insertions(+), 4 deletions(-) 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; }