com.jmex.effects
Class ProjectedTextureUtil

java.lang.Object
  extended by com.jmex.effects.ProjectedTextureUtil

public class ProjectedTextureUtil
extends java.lang.Object

ProjectedTextureUtil

Author:
Rikard Herlitz (MrCoder), Joshua Ellen (basixs) [1-16-2009] - Abstracted, removed direct calls to openGL

Constructor Summary
ProjectedTextureUtil()
           
 
Method Summary
static void matrixFrustum(float frustumLeft, float frustumRight, float frustumBottom, float frustumTop, float frustumNear, float frustumFar, Matrix4f result)
          Populates a Matrix4f with the proper frustum transformations from the Projection matrix.
static void matrixLookAt(Vector3f location, Vector3f at, Vector3f up, Matrix4f result)
          Populates a Matrix4f with the proper look at transformations from the ModelView matrix.
static void matrixPerspective(float fovY, float aspect, float near, float far, Matrix4f result)
          Populates a Matrix4f with the proper frustum transformations from the ModelView matrix.
static void matrixProjection(float fovY, float aspect, float near, float far, Matrix4f result)
          Populates a Matrix4f with the proper frustum transformations from the Projection matrix.
static void updateProjectedTexture(Texture texture, float fov, float aspect, float near, float far, Vector3f pos, Vector3f aim, Vector3f up)
          Updated texture matrix on the provided texture
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ProjectedTextureUtil

public ProjectedTextureUtil()
Method Detail

updateProjectedTexture

public static void updateProjectedTexture(Texture texture,
                                          float fov,
                                          float aspect,
                                          float near,
                                          float far,
                                          Vector3f pos,
                                          Vector3f aim,
                                          Vector3f up)
Updated texture matrix on the provided texture

Parameters:
texture - Texture to update texturematrix on
fov - Projector field of view, in angles
aspect - Projector frustum aspect ratio
near - Projector frustum near plane
far - Projector frustum far plane
pos - Projector position
aim - Projector look at position

matrixLookAt

public static void matrixLookAt(Vector3f location,
                                Vector3f at,
                                Vector3f up,
                                Matrix4f result)
Populates a Matrix4f with the proper look at transformations from the ModelView matrix.

Parameters:
location - the 'Where' in result matrix
at - the 'At' in the result matrix
up - the world up
result - the altered Matrix4f

matrixPerspective

public static void matrixPerspective(float fovY,
                                     float aspect,
                                     float near,
                                     float far,
                                     Matrix4f result)
Populates a Matrix4f with the proper frustum transformations from the ModelView matrix.

Parameters:
fovY - the Field of View
aspect - the aspect ratio
near - the near plane of the frustum
far - the far frame of the frustum
result - the altered Matrix4f

matrixProjection

public static void matrixProjection(float fovY,
                                    float aspect,
                                    float near,
                                    float far,
                                    Matrix4f result)
Populates a Matrix4f with the proper frustum transformations from the Projection matrix.

Parameters:
fovY - the Field of View
aspect - the aspect ratio
near - the near plane of the frustum
far - the far frame of the frustum
result - the altered Matrix4f

matrixFrustum

public static void matrixFrustum(float frustumLeft,
                                 float frustumRight,
                                 float frustumBottom,
                                 float frustumTop,
                                 float frustumNear,
                                 float frustumFar,
                                 Matrix4f result)
Populates a Matrix4f with the proper frustum transformations from the Projection matrix.

Parameters:
frustumLeft - the left plane of the frustum
frustumRight - the right plane of the frustum
frustumBottom - the bottom plane of the frustum
frustumTop - the top plane of the frustum
frustumNear - the near plane of the frustum
frustumFar - the far plane of the frustum
result - the altered Matrix4f