public void moveTo(Point p, float speed) { float x = p.x - position.x; float y = p.y - position.y; velocity = new Velocity(x/speed, y/speed); target = new Point(p); }
public Velocity getVelocity(float distance) { float x = (float)Math.Sin(toRadians(degrees))*distance; float y = (float)Math.Cos(toRadians(degrees))*distance; Velocity v = new Velocity(x, -y); return v; }
public Velocity getVelocity() { float x = (float) Math.Cos(degrees); float y = (float) Math.Sin(degrees); Velocity v = new Velocity(x, y); return v; }
public Velocity getVelocity(float distance, float angleZ) { float x = (float)Math.Sin(toRadians(degrees))*distance; float y = (float)Math.Cos(toRadians(degrees))*distance; float z = (float)Math.Sin(toRadians(angleZ)) * distance; Velocity v = new Velocity(x, y, z); return v; }
public MModel(MModel m) { position = new Point(m.position); dimensions = new Dimension(m.dimensions); velocity = new Velocity(m.velocity); if (target != null) { target = new Point(m.target); } }
public void setVelocity(Velocity v) { this.displayable.setVelocity(v); }
public Velocity(Velocity v) { x = v.x; y = v.y; z = v.z; }
public void setVelocity(Velocity v) { velocity = new Velocity(v); }
public MModel(Point p, Dimension d) { position = new Point(p); dimensions = new Dimension(d); velocity = new Velocity(0,0,0); }
public MModel(Point p) { position = new Point(p); velocity = new Velocity(0,0,0); }