public void Execute(MeshingStage meshingStage) { if (Shape != null && Shape.DecRef() == 0) { if (Shape.Type == ShapeType.PrimitiveBox || Shape.Type == ShapeType.PrimitiveSphere || Shape.Type == ShapeType.Null) { //primitive shapes are not cached Shape.Dispose(); } else { meshingStage.UncacheShape(Shape.Hash, Shape, Shape.Type); } } }
private void CheckAndDispose(PhysicsShape item, bool dynamic) { //we want to dispose this object, but ONLY if no one else has a reference to it //that includes the opposite inactive list if (item.HasRefs) { return; } //we can dispose if (this.OnShapeNeedsFreeing != null) { this.OnShapeNeedsFreeing(item); } else { //this will happen during shutdown, where we dont want to defer the deletes to the physics thread //since it is stopped item.Dispose(); } }
public void Execute(PhysxScene scene) { Shape.Dispose(); }