Skip to content

Commit

Permalink
Add mAllowedDOFs to Character settings (#1433)
Browse files Browse the repository at this point in the history
  • Loading branch information
jfaz1 authored Jan 1, 2025
1 parent 3ede71e commit ce420fe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Jolt/Physics/Character/Character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 4 additions & 0 deletions Jolt/Physics/Character/Character.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include <Jolt/Physics/Collision/ObjectLayer.h>
#include <Jolt/Physics/Collision/TransformedShape.h>
#include <Jolt/Physics/EActivation.h>
#include <Jolt/Physics/Body/AllowedDOFs.h>

JPH_NAMESPACE_BEGIN

Expand All @@ -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.
Expand Down

0 comments on commit ce420fe

Please sign in to comment.