//Target Rings in Center public class Target{ public Vector2D Pos; public Vector2D Vel; public Vector2D Force; //primarily a buffer for force being applied this frame public float max_vel; public float min_vel; public float r; public float Mass; public float Elasticity; public boolean killMe; Target() { Pos = new Vector2D(); Vel = new Vector2D(); Force = new Vector2D(); max_vel = 150.0f; min_vel = 50.0f; r = 1.0f; Mass = 1.0f; Elasticity = 1.0f; killMe = false; } public void SetPosition(float x, float y, float delta_t) //be sure to run this function whenever changing paddle position { //Uses a simple Verlet scheme to determine the velocity of the paddle from two positions Vector2D dPos = new Vector2D(x-Pos.x, y-Pos.y); Pos.Set(x,y); if (delta_t != 0.0f) Vel.Set(dPos.Times(1/delta_t)); else Vel.Set(0,0); //We're basically undefined over an empty time period anyhow } //returns a copy of the Position vector public Vector2D GetPosition() { return new Vector2D(Pos); } //Returns a copy of the current Velocity Vector public Vector2D GetVelocity() { return new Vector2D(Vel); } }