Skip to content

Commit

Permalink
PhysicsRigidBody: avoid 2 unnecessary null checks
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jun 20, 2024
1 parent 1722921 commit e5f7bf3
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -465,9 +465,7 @@ public void rebuildRigidBody() {
if (removedFrom != null) {
removedFrom.addCollisionObject(this);
}
if (snapshot != null) {
snapshot.applyTo(this);
}
snapshot.applyTo(this);
// TODO kinematic flag, gravity, physics joints
}

Expand Down Expand Up @@ -507,9 +505,7 @@ public void reposition(Vec3d location, Quaternion orientation) {
if (removedFrom != null) {
removedFrom.addCollisionObject(this);
}
if (snapshot != null) {
snapshot.applyTo(this);
}
snapshot.applyTo(this);
// TODO kinematic flag, gravity, physics joints
}

Expand Down

0 comments on commit e5f7bf3

Please sign in to comment.