From 53acd891dcc036e8bcda152473c129d2c7d18c3a Mon Sep 17 00:00:00 2001 From: jingqi Date: Fri, 6 Aug 2021 12:13:11 +0800 Subject: [PATCH] Fix typo --- src/body/RigidBody.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/body/RigidBody.cpp b/src/body/RigidBody.cpp index 290788c9..41031491 100644 --- a/src/body/RigidBody.cpp +++ b/src/body/RigidBody.cpp @@ -330,7 +330,7 @@ void RigidBody::setLocalCenterOfMass(const Vector3& centerOfMass) { mWorld.mRigidBodyComponents.setCenterOfMassWorld(mEntity, mWorld.mTransformComponents.getTransform(mEntity) * centerOfMass); // Update the linear velocity of the center of mass - Vector3 linearVelocity = mWorld.mRigidBodyComponents.getAngularVelocity(mEntity); + Vector3 linearVelocity = mWorld.mRigidBodyComponents.getLinearVelocity(mEntity); const Vector3& angularVelocity = mWorld.mRigidBodyComponents.getAngularVelocity(mEntity); const Vector3& centerOfMassWorld = mWorld.mRigidBodyComponents.getCenterOfMassWorld(mEntity); linearVelocity += angularVelocity.cross(centerOfMassWorld - oldCenterOfMass); @@ -367,7 +367,7 @@ void RigidBody::updateLocalCenterOfMassFromColliders() { mWorld.mRigidBodyComponents.setCenterOfMassWorld(mEntity, centerOfMassWorld); // Update the linear velocity of the center of mass - Vector3 linearVelocity = mWorld.mRigidBodyComponents.getAngularVelocity(mEntity); + Vector3 linearVelocity = mWorld.mRigidBodyComponents.getLinearVelocity(mEntity); const Vector3& angularVelocity = mWorld.mRigidBodyComponents.getAngularVelocity(mEntity); linearVelocity += angularVelocity.cross(centerOfMassWorld - oldCenterOfMassWorld); mWorld.mRigidBodyComponents.setLinearVelocity(mEntity, linearVelocity); @@ -553,7 +553,7 @@ void RigidBody::updateMassPropertiesFromColliders() { if (type == BodyType::DYNAMIC) { // Update the linear velocity of the center of mass - Vector3 linearVelocity = mWorld.mRigidBodyComponents.getAngularVelocity(mEntity); + Vector3 linearVelocity = mWorld.mRigidBodyComponents.getLinearVelocity(mEntity); const Vector3& angularVelocity = mWorld.mRigidBodyComponents.getAngularVelocity(mEntity); linearVelocity += angularVelocity.cross(centerOfMassWorld - oldCenterOfMassWorld); mWorld.mRigidBodyComponents.setLinearVelocity(mEntity, linearVelocity);