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); } }
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); }
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; } }