Пример #1
0
 public Boolean isInside(Liquid l)
 {
     if (location.X > l.x && location.X < l.x + l.w && location.Y > l.y && location.Y < l.y + l.h)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Пример #2
0
        public void drag(Liquid l)
        {
            float speed         = velocity.Length();
            float dragMagnitude = l.c * speed * speed;

            Vector2 drag = new Vector2(velocity.X, velocity.Y);

            drag = Vector2.Multiply(drag, -1f);
            drag.Normalize();

            drag = Vector2.Multiply(drag, dragMagnitude);

            applyForce(drag);
        }
Пример #3
0
        public void drag(Liquid l)
        {
            float speed = velocity.Length();
            float dragMagnitude = l.c * speed * speed;

            Vector2 drag = new Vector2(velocity.X, velocity.Y);
            drag = Vector2.Multiply(drag, -1f);
            drag.Normalize();

            drag = Vector2.Multiply(drag, dragMagnitude);

            applyForce(drag);
        }
Пример #4
0
 public Boolean isInside(Liquid l)
 {
     if (location.X > l.x && location.X < l.x + l.w && location.Y > l.y && location.Y < l.y + l.h)
     {
         return true;
     }
     else
     {
         return false;
     }
 }