From ce420fe7efa6326d02cc3c21e2ba95bb03309501 Mon Sep 17 00:00:00 2001 From: jfaz <56184947+jfaz1@users.noreply.github.com> Date: Wed, 1 Jan 2025 10:36:39 -0400 Subject: [PATCH] Add mAllowedDOFs to Character settings (#1433) --- Jolt/Physics/Character/Character.cpp | 2 +- Jolt/Physics/Character/Character.h | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Jolt/Physics/Character/Character.cpp b/Jolt/Physics/Character/Character.cpp index 14b231287..e2783d0ed 100644 --- a/Jolt/Physics/Character/Character.cpp +++ b/Jolt/Physics/Character/Character.cpp @@ -34,7 +34,7 @@ Character::Character(const CharacterSettings *inSettings, RVec3Arg inPosition, Q { // Construct rigid body BodyCreationSettings settings(mShape, inPosition, inRotation, EMotionType::Dynamic, mLayer); - settings.mAllowedDOFs = EAllowedDOFs::TranslationX | EAllowedDOFs::TranslationY | EAllowedDOFs::TranslationZ; + settings.mAllowedDOFs = inSettings->mAllowedDOFs; settings.mEnhancedInternalEdgeRemoval = inSettings->mEnhancedInternalEdgeRemoval; settings.mOverrideMassProperties = EOverrideMassProperties::MassAndInertiaProvided; settings.mMassPropertiesOverride.mMass = inSettings->mMass; diff --git a/Jolt/Physics/Character/Character.h b/Jolt/Physics/Character/Character.h index cbf5d88dd..0f37f33b7 100644 --- a/Jolt/Physics/Character/Character.h +++ b/Jolt/Physics/Character/Character.h @@ -8,6 +8,7 @@ #include #include #include +#include JPH_NAMESPACE_BEGIN @@ -28,6 +29,9 @@ class JPH_EXPORT CharacterSettings : public CharacterBaseSettings /// Value to multiply gravity with for this character float mGravityFactor = 1.0f; + + /// Allowed degrees of freedom for this character + EAllowedDOFs mAllowedDOFs = EAllowedDOFs::TranslationX | EAllowedDOFs::TranslationY | EAllowedDOFs::TranslationZ; }; /// Runtime character object.