Пример #1
0
 public void Remove(PhysicsColliderNode physicsColliderNode)
 {
     if (physicsColliderNode.IsActive)
     {
         B2World.DestroyBody(physicsColliderNode.B2Body);
     }
     physicsCollider.Remove(physicsColliderNode);
 }
Пример #2
0
        public bool GetIsCollided(PhysicsColliderNode shape1, PhysicsColliderNode shape2, out List <Vector2F> points)
        {
            points = new List <Vector2F>();

            Body shape1B2Body = null, shape2B2Body = null;

            shape1B2Body = shape1.B2Body;
            shape2B2Body = shape2.B2Body;

            foreach (var item in collisionController.CollisionShapes)
            {
                if ((item.BodyA == shape1B2Body && item.BodyB == shape2B2Body) || (item.BodyB == shape1B2Body && item.BodyA == shape2B2Body))
                {
                    points = item.Points;
                    return(true);
                }
            }
            return(false);
        }
Пример #3
0
 public void Add(PhysicsColliderNode physicsColliderNode)
 {
     physicsCollider.Add(physicsColliderNode);
 }