Merge pull request #2528 from aws-lumberyard-dev/ibtehajn/rigid_body_axis_locking

Implement axis locking options for rigid bodies

Signed-off-by: moraaar <moraaar@amazon.com>
This commit is contained in:
moraaar
2021-07-29 12:07:50 +01:00
committed by GitHub
5 changed files with 107 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;