Пример #1
0
 /**
  * Generates a view matrix for a first person camera looking towards positive-Z by default <br>
  * (Rotations in order Y-X-Z)
  *
  * @param eye position of the camera
  * @param pitch rotation around X
  * @param yaw rotation around Y
  * @param roll rotation around Z
  * @return a view matrix representing the camera transformations
  */
 public static Matrix FPViewLH(Vector eye, double pitch, double yaw, double roll) {
   return Matrix.translate(Vector.mul(eye, -1)).mul(Matrix.rotationYXZ(-yaw, pitch, roll));
 }
Пример #2
0
 public static Matrix rotationYXZ(double yaw, double pitch, double roll) {
   return Matrix.rotationY(yaw).mul(Matrix.rotationX(pitch).mul(Matrix.rotationZ(roll)));
 }
Пример #3
0
 /**
  * Generates a view matrix for a first person camera looking towards positive-Z by default <br>
  * (Rotations in order Y-X-Z)
  *
  * @param eye position of the camera
  * @param rotation rotation of the camera
  * @return a view matrix representing the camera transformations
  */
 public static Matrix FPViewLH(Vector eye, Vector rotation) {
   Vector rot = new Vector(rotation);
   rot.Y = -rot.Y;
   return Matrix.translate(Vector.mul(eye, -1)).mul(Matrix.rotationZYX(rot));
 }
Пример #4
0
 public Matrix mul(Matrix other) {
   this.setData(Matrix.mul(this, other));
   return this;
 }
Пример #5
0
 public static Matrix rotationXYZ(Vector rotation) {
   return Matrix.rotationXYZ(rotation.X, rotation.Y, rotation.Z);
 }
Пример #6
0
 public static Matrix rotationZYX(Vector rotation) {
   return Matrix.rotationZYX(rotation.Z, rotation.Y, rotation.X);
 }
Пример #7
0
 public static Matrix rotationZXY(Vector rotation) {
   return Matrix.rotationZXY(rotation.Z, rotation.X, rotation.Y);
 }