Пример #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);
 }
Пример #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;
 }
Пример #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;
 }
Пример #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;
 }
Пример #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);
       }
 }
Пример #6
0
 public void setVelocity(Velocity v)
 {
     this.displayable.setVelocity(v);
 }
Пример #7
0
 public Velocity(Velocity v)
 {
     x = v.x;
       y = v.y;
       z = v.z;
 }
Пример #8
0
 public void setVelocity(Velocity v)
 {
     velocity = new Velocity(v);
 }
Пример #9
0
 public MModel(Point p, Dimension d)
 {
     position = new Point(p);
       dimensions = new Dimension(d);
       velocity = new Velocity(0,0,0);
 }
Пример #10
0
 public MModel(Point p)
 {
     position = new Point(p);
       velocity = new Velocity(0,0,0);
 }