public ColliderShape CreateShape()
        {
            if (Shape == null)
            {
                return(null);
            }

            if (Shape.Shape == null)
            {
                Shape.Shape = PhysicsColliderShape.Compose(Shape.Descriptions);
            }

            return(this.Shape.Shape);
        }
        public ColliderShape CreateShape(Simulation simulation, ContentManager content)
        {
            if (Shape == null)
            {
                return(null);
            }

            if (Shape.Shape == null)
            {
                Shape.Shape = PhysicsColliderShape.Compose(simulation, content, Shape.Descriptions);
            }

            return(Shape.Shape);
        }
Пример #3
0
        public ColliderShape CreateShape(IServiceRegistry services)
        {
            if (Shape == null)
            {
                return(null);
            }

            if (Shape.Shape == null)
            {
                Shape.Shape = PhysicsColliderShape.Compose(Shape.Descriptions, services);
                if (Shape.Shape != null)
                {
                    Shape.Shape.Description = this;
                }
            }

            return(this.Shape.Shape);
        }
Пример #4
0
        public void ComposeShape()
        {
            if (Simulation == null || Simulation.PhysicsProcessor == null)
            {
                return;
            }

            ColliderShapeChanged = false;

            if (ColliderShapes.Count == 1) //single shape case
            {
                if (ColliderShapes[0] == null)
                {
                    return;
                }

                var content = Simulation.PhysicsProcessor.Services.GetService <ContentManager>();

                colliderShape = PhysicsColliderShape.CreateShape(Simulation, content, ColliderShapes[0]);
            }
        }