Ejemplo n.º 1
0
 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);
         }
     }
 }
Ejemplo n.º 2
0
        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();
            }
        }
Ejemplo n.º 3
0
 public void Execute(PhysxScene scene)
 {
     Shape.Dispose();
 }
Ejemplo n.º 4
0
        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();
            }
        }