Package com.flansmod.common.vector

Examples of com.flansmod.common.vector.Matrix4f.rotate()


         
          Matrix4f mat = new Matrix4f();
          mat.m00 = currentWheelPos.x;
          mat.m10 = currentWheelPos.y;
          mat.m20 = currentWheelPos.z;
          mat.rotate(dAngle * type.wheelSpringStrength, rotateAround);
         
          axes.rotateGlobal(-dAngle * type.wheelSpringStrength, rotateAround);
                   
          Vector3f newWheelPos = new Vector3f(mat.m00, mat.m10, mat.m20);
          newWheelPos.normalise().scale(newLength);
View Full Code Here


    Matrix4f mat = new Matrix4f();
    mat.m00 = in.x;
    mat.m10 = in.y;
    mat.m20 = in.z;
    //Do the rotations used to obtain this basis in reverse
    mat.rotate(-rotationYaw * 3.14159265F / 180F, new Vector3f(0F, 1F, 0F));
    mat.rotate(-rotationPitch * 3.14159265F / 180F, new Vector3f(0F, 0F, 1F));
    mat.rotate(-rotationRoll * 3.14159265F / 180F, new Vector3f(1F, 0F, 0F));
    return new Vector3f(mat.m00, mat.m10, mat.m20);
  }
 
View Full Code Here

    mat.m00 = in.x;
    mat.m10 = in.y;
    mat.m20 = in.z;
    //Do the rotations used to obtain this basis in reverse
    mat.rotate(-rotationYaw * 3.14159265F / 180F, new Vector3f(0F, 1F, 0F));
    mat.rotate(-rotationPitch * 3.14159265F / 180F, new Vector3f(0F, 0F, 1F));
    mat.rotate(-rotationRoll * 3.14159265F / 180F, new Vector3f(1F, 0F, 0F));
    return new Vector3f(mat.m00, mat.m10, mat.m20);
  }
 
  //Find a local vector in terms of the global axes.
View Full Code Here

    mat.m10 = in.y;
    mat.m20 = in.z;
    //Do the rotations used to obtain this basis in reverse
    mat.rotate(-rotationYaw * 3.14159265F / 180F, new Vector3f(0F, 1F, 0F));
    mat.rotate(-rotationPitch * 3.14159265F / 180F, new Vector3f(0F, 0F, 1F));
    mat.rotate(-rotationRoll * 3.14159265F / 180F, new Vector3f(1F, 0F, 0F));
    return new Vector3f(mat.m00, mat.m10, mat.m20);
  }
 
  //Find a local vector in terms of the global axes.
  public Vector3f findLocalVectorGlobally(Vector3f in)
View Full Code Here

    Matrix4f mat = new Matrix4f();
    mat.m00 = in.x;
    mat.m10 = in.y;
    mat.m20 = in.z;
    //Do the rotations used to obtain this basis
    mat.rotate(rotationRoll * 3.14159265F / 180F, new Vector3f(1F, 0F, 0F));
    mat.rotate(rotationPitch * 3.14159265F / 180F, new Vector3f(0F, 0F, 1F));
    mat.rotate(rotationYaw * 3.14159265F / 180F, new Vector3f(0F, 1F, 0F));
    return new Vector3f(mat.m00, mat.m10, mat.m20);
  }

View Full Code Here

    mat.m00 = in.x;
    mat.m10 = in.y;
    mat.m20 = in.z;
    //Do the rotations used to obtain this basis
    mat.rotate(rotationRoll * 3.14159265F / 180F, new Vector3f(1F, 0F, 0F));
    mat.rotate(rotationPitch * 3.14159265F / 180F, new Vector3f(0F, 0F, 1F));
    mat.rotate(rotationYaw * 3.14159265F / 180F, new Vector3f(0F, 1F, 0F));
    return new Vector3f(mat.m00, mat.m10, mat.m20);
  }

  private void convertAnglesToMatrix()
View Full Code Here

    mat.m10 = in.y;
    mat.m20 = in.z;
    //Do the rotations used to obtain this basis
    mat.rotate(rotationRoll * 3.14159265F / 180F, new Vector3f(1F, 0F, 0F));
    mat.rotate(rotationPitch * 3.14159265F / 180F, new Vector3f(0F, 0F, 1F));
    mat.rotate(rotationYaw * 3.14159265F / 180F, new Vector3f(0F, 1F, 0F));
    return new Vector3f(mat.m00, mat.m10, mat.m20);
  }

  private void convertAnglesToMatrix()
  {
View Full Code Here

  {
    //Take the input matrix
    Matrix4f mat = new Matrix4f();
    mat.load(in.getMatrix());
    //Perform the rotations to convert from this local set of axes to the global axes
    mat.rotate(rotationRoll * 3.14159265F / 180F, new Vector3f(1F, 0F, 0F));
    mat.rotate(rotationPitch * 3.14159265F / 180F, new Vector3f(0F, 0F, 1F));
    mat.rotate(rotationYaw * 3.14159265F / 180F, new Vector3f(0F, 1F, 0F));
    //Return the globalised matrix
    return new RotatedAxes(mat);
  }
View Full Code Here

    //Take the input matrix
    Matrix4f mat = new Matrix4f();
    mat.load(in.getMatrix());
    //Perform the rotations to convert from this local set of axes to the global axes
    mat.rotate(rotationRoll * 3.14159265F / 180F, new Vector3f(1F, 0F, 0F));
    mat.rotate(rotationPitch * 3.14159265F / 180F, new Vector3f(0F, 0F, 1F));
    mat.rotate(rotationYaw * 3.14159265F / 180F, new Vector3f(0F, 1F, 0F));
    //Return the globalised matrix
    return new RotatedAxes(mat);
  }
 
View Full Code Here

    Matrix4f mat = new Matrix4f();
    mat.load(in.getMatrix());
    //Perform the rotations to convert from this local set of axes to the global axes
    mat.rotate(rotationRoll * 3.14159265F / 180F, new Vector3f(1F, 0F, 0F));
    mat.rotate(rotationPitch * 3.14159265F / 180F, new Vector3f(0F, 0F, 1F));
    mat.rotate(rotationYaw * 3.14159265F / 180F, new Vector3f(0F, 1F, 0F));
    //Return the globalised matrix
    return new RotatedAxes(mat);
  }
 
  @Override
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.