Skip to content

Commit

Permalink
bugfix: snapshot isn't applied when adding a body to a space
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Jun 20, 2024
1 parent db8e2c9 commit e8fc85f
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -688,6 +688,23 @@ public void setPhysicsRotationDp(Quatd orientation) {
// *************************************************************************
// PhysicsBody methods

/**
* Alter the {@code addedToSpace} field. Internal use only.
*
* @param physicsSpace (alias created if not null)
*/
@Override
public void setAddedToSpaceInternal(PhysicsSpace physicsSpace) {
super.setAddedToSpaceInternal(physicsSpace);

if (physicsSpace == null) {
this.bodyInterface = null;
} else {
this.bodyInterface = physicsSpace.getBodyInterface();
snapshot.applyTo(this);
}
}

/**
* Return the body's mass.
*
Expand Down

0 comments on commit e8fc85f

Please sign in to comment.