Ejemplo n.º 1
0
 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);
 }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 public Velocity getVelocity()
 {
     float x = (float) Math.Cos(degrees);
       float y = (float) Math.Sin(degrees);
       Velocity v = new Velocity(x, y);
       return v;
 }
Ejemplo n.º 4
0
 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;
 }
Ejemplo n.º 5
0
 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);
       }
 }
Ejemplo n.º 6
0
 public void setVelocity(Velocity v)
 {
     this.displayable.setVelocity(v);
 }
Ejemplo n.º 7
0
 public Velocity(Velocity v)
 {
     x = v.x;
       y = v.y;
       z = v.z;
 }
Ejemplo n.º 8
0
 public void setVelocity(Velocity v)
 {
     velocity = new Velocity(v);
 }
Ejemplo n.º 9
0
 public MModel(Point p, Dimension d)
 {
     position = new Point(p);
       dimensions = new Dimension(d);
       velocity = new Velocity(0,0,0);
 }
Ejemplo n.º 10
0
 public MModel(Point p)
 {
     position = new Point(p);
       velocity = new Velocity(0,0,0);
 }