removeShape method

void removeShape(
  1. Shape shape
)

I will delete the shape from the rigid body. If you delete a shape, please call the setupMass method to step up to the start of the next. shape shape to delete

Implementation

void removeShape(Shape shape){
  Shape remove = shape;
  if(remove.parent != this)return;
  Shape? prev = remove.prev;
  Shape? next = remove.next;
  if(prev != null) prev.next = next;
  if(next != null) next.prev = prev;
  if(shapes == remove)shapes = next;
  remove.prev = null;
  remove.next = null;
  remove.parent = null;
  if(parent != null)parent!.removeShape(remove);
  numShapes--;
}