Skip to content

Commit

Permalink
bugfix: NPE in PhysicsRigidBody.isDynamic()
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jun 18, 2024
1 parent 8f46560 commit ada8405
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,15 @@ final public boolean hasAssignedNativeObject() {
* @return true if in dynamic mode, otherwise false (static/kinematic mode)
*/
public boolean isDynamic() {
boolean result = (joltBody.getMotionProperties() != null);
boolean result;
if (joltBody == null) {
result = (mass != massForStatic);
} else if (joltBody.getMotionProperties() == null) {
result = false;
} else {
result = true;
}

return result;
}

Expand Down

0 comments on commit ada8405

Please sign in to comment.