Skip to content

Commit

Permalink
bugfix #51
Browse files Browse the repository at this point in the history
  • Loading branch information
saharan committed Oct 14, 2022
1 parent 297090f commit d9bd6f6
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/oimo/dynamics/rigidbody/RigidBody.hx
Original file line number Diff line number Diff line change
Expand Up @@ -997,15 +997,15 @@ class RigidBody {
* Removes the shape from the rigid body.
*/
public function removeShape(shape:Shape):Void {
// first, remove the shape from the linked list so that it will be ignored
M.list_remove(_shapeList, _shapeListLast, _prev, _next, shape);
_numShapes--;
shape._rigidBody = null;

// then remove the shape from the world
// first remove the shape from the world
if (_world != null) {
_world._removeShape(shape);
}

// then, remove the shape from the linked list so that it will be ignored
M.list_remove(_shapeList, _shapeListLast, _prev, _next, shape);
_numShapes--;
shape._rigidBody = null;

_shapeModified();
}
Expand Down

0 comments on commit d9bd6f6

Please sign in to comment.