Class CameraRot

java.lang.Object
  extended by CameraRot

public class CameraRot
extends java.lang.Object

This is a class that contains methods to create transform matrices that can transform our camera to (0,0,0), its direction to (0,0,-1) and its up direction to (0,1,0)


Constructor Summary
CameraRot()
           
 
Method Summary
static void calculateMatrices(Camera c, Vector4 desiredDir)
           
static void createMatrices(Camera c)
          This is a static method that creates the transformation matrices used to transform the objects in 3D space.
static void createMatrices(Camera c, Vector4 desiredDir)
           
static Matrix4 getInvRotMatrix()
          This method returns the inverse rotation matrix rotating the camera direction and up direction to its initial direction.
static Matrix4 getInvTlMatrix()
          This method returns the translation matrix that translates to original position.
static Matrix4 getRotMatrix()
          This method returns the rotation matrix, rotating the camera direction to (0,0,-1) and up direction to (0,1,0)
static Matrix4 getTlMatrix()
          This method returns the translation matrix that translates to (0,0,0).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CameraRot

public CameraRot()
Method Detail

createMatrices

public static void createMatrices(Camera c)
This is a static method that creates the transformation matrices used to transform the objects in 3D space.

Parameters:
c - the Camera

createMatrices

public static void createMatrices(Camera c,
                                  Vector4 desiredDir)

calculateMatrices

public static void calculateMatrices(Camera c,
                                     Vector4 desiredDir)

getRotMatrix

public static Matrix4 getRotMatrix()
This method returns the rotation matrix, rotating the camera direction to (0,0,-1) and up direction to (0,1,0)

Returns:
A rotation matrix

getInvRotMatrix

public static Matrix4 getInvRotMatrix()
This method returns the inverse rotation matrix rotating the camera direction and up direction to its initial direction.

Returns:
A rotation matrix

getTlMatrix

public static Matrix4 getTlMatrix()
This method returns the translation matrix that translates to (0,0,0).

Returns:
A translation matrix

getInvTlMatrix

public static Matrix4 getInvTlMatrix()
This method returns the translation matrix that translates to original position.

Returns:
A translation matrix