Exemplo n.º 1
0
  public static Number3D getAxisVector(Axis axis) {
    Number3D axisVector = new Number3D();

    switch (axis) {
      case X:
        axisVector.setAll(1, 0, 0);
        break;
      case Y:
        axisVector.setAll(0, 1, 0);
        break;
      case Z:
        axisVector.setAll(0, 0, 1);
        break;
    }

    return axisVector;
  }
Exemplo n.º 2
0
  public void rotateZ(float angle) {
    float cosRY = FloatMath.cos(angle);
    float sinRY = FloatMath.sin(angle);

    _temp.setAll(this.x, this.y, this.z);

    this.x = (_temp.x * cosRY) - (_temp.y * sinRY);
    this.y = (_temp.x * sinRY) + (_temp.y * cosRY);
  }