Exemple #1
0
 @Override
 public Vector2 mul(ImmutableVector<Vector2> b) {
   Vector2 sum = b.clone();
   x *= sum.x;
   y *= sum.y;
   return this;
 }
Exemple #2
0
 // interface methods
 @Override
 public Vector2 add(ImmutableVector<Vector2> b) {
   Vector2 sum = b.clone();
   x += sum.x;
   y += sum.y;
   return this;
 }
Exemple #3
0
 @Override
 public Vector2 max(ImmutableVector<Vector2> b) {
   Vector2 sum = b.clone();
   x = Math.max(x, sum.x);
   y = Math.max(y, sum.y);
   return this;
 }
Exemple #4
0
 @Override
 public Vector2 div(ImmutableVector<Vector2> b) {
   Vector2 sum = b.clone();
   x /= sum.x;
   y /= sum.y;
   return this;
 }
Exemple #5
0
 public Vector2(ImmutableVector v) {
   float[] c = v.getCoords();
   if (c.length > 0) {
     x = c[0];
   }
   if (c.length > 1) {
     y = c[1];
   }
 }
Exemple #6
0
 @Override
 public float dot(ImmutableVector<Vector2> b) {
   Vector2 sum = b.clone();
   return x * sum.x + y * sum.y;
 }