Implement axis locking options for rigid bodies

Linear and angular motion of rigid bodies can now be restricted along
specific world-space axes.

Signed-off-by: Ibtehaj Nadeem <81370835+ibtehajn@users.noreply.github.com>
This commit is contained in:
ibtehajn
2021-07-28 13:22:24 +01:00
committed by Ibtehaj Nadeem
parent d38f17131e
commit fd07f907bc
5 changed files with 105 additions and 0 deletions
@@ -123,6 +123,12 @@ namespace AzPhysics
->Field("Kinematic", &RigidBodyConfiguration::m_kinematic)
->Field("CCD Enabled", &RigidBodyConfiguration::m_ccdEnabled)
->Field("Compute Mass", &RigidBodyConfiguration::m_computeMass)
->Field("Lock Linear X", &RigidBodyConfiguration::m_lockLinearX)
->Field("Lock Linear Y", &RigidBodyConfiguration::m_lockLinearY)
->Field("Lock Linear Z", &RigidBodyConfiguration::m_lockLinearZ)
->Field("Lock Angular X", &RigidBodyConfiguration::m_lockAngularX)
->Field("Lock Angular Y", &RigidBodyConfiguration::m_lockAngularY)
->Field("Lock Angular Z", &RigidBodyConfiguration::m_lockAngularZ)
->Field("Mass", &RigidBodyConfiguration::m_mass)
->Field("Compute COM", &RigidBodyConfiguration::m_computeCenterOfMass)
->Field("Centre of mass offset", &RigidBodyConfiguration::m_centerOfMassOffset)
@@ -62,6 +62,16 @@ namespace AzPhysics
bool m_computeInertiaTensor = true;
bool m_computeMass = true;
//! Flags to restrict motion along specific world-space axes.
bool m_lockLinearX = false;
bool m_lockLinearY = false;
bool m_lockLinearZ = false;
//! Flags to restrict rotation around specific world-space axes.
bool m_lockAngularX = false;
bool m_lockAngularY = false;
bool m_lockAngularZ = false;
//! If set, non-simulated shapes will also be included in the mass properties calculation.
bool m_includeAllShapesInMassCalculation = false;