Skip to content

Commit

Permalink
Override mass properties for Area3D when using Jolt Physics
Browse files Browse the repository at this point in the history
(cherry picked from commit f380b00)
  • Loading branch information
mihe authored and Spartan322 committed Feb 4, 2025
1 parent 6b9e175 commit eaf61f8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions modules/jolt_physics/objects/jolt_area_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ void JoltArea3D::_add_to_space() {
jolt_settings->mMotionType = _get_motion_type();
jolt_settings->mIsSensor = true;
jolt_settings->mUseManifoldReduction = false;
jolt_settings->mOverrideMassProperties = JPH::EOverrideMassProperties::MassAndInertiaProvided;
jolt_settings->mMassPropertiesOverride.mMass = 1.0f;
jolt_settings->mMassPropertiesOverride.mInertia = JPH::Mat44::sIdentity();

if (JoltProjectSettings::areas_detect_static_bodies()) {
jolt_settings->mCollideKinematicVsNonDynamic = true;
Expand Down

0 comments on commit eaf61f8

Please sign in to comment.