gestalt.util
Class JoglUtil

java.lang.Object
  extended by gestalt.util.JoglUtil

public class JoglUtil
extends java.lang.Object


Constructor Summary
JoglUtil()
           
 
Method Summary
static int _getTextureUnitID(int theTextureUnitToken)
           
static void applyOrigin(GL gl, int theOrigin)
          apply origin offset to current opengl matrix stack.
static TransformMatrix4f applyTransform(AbstractShape theShape, Vector3f theResultPosition)
          applies the transforms stored in 'transform', 'rotation' and 'scale' as defined in transform mode.
static void applyTransform(GL gl, int theTransformMode, TransformMatrix4f theTransform, Vector3f theRotation, Vector3f theScale)
          applies the transforms stored in 'transform', 'rotation' and 'scale' as defined in transform mode.
static TransformMatrix4f applyTransform(int theTransformMode, TransformMatrix4f theTransform, Vector3f theRotation, Vector3f theScale, Vector3f theResultPosition)
          applies the transforms stored in 'transform', 'rotation' and 'scale' as defined in transform mode.
static boolean checkFrameBufferStatus(GL gl)
          check frame buffer object status.
static void circle(GL gl, float theRadius)
          draws a circle from line segments in opengl.
static void circle(GL gl, Vector3f thePosition, float theRadius)
          draws a circle from line segments in opengl.
static JoglMultiTexPlane createTextureView(TexturePlugin theTexture, Vector3f thePosition, Vector3f theScale)
          creates a plane that displays a texture on arbitrary texture unit, defined in the texture object.
static void draw(GL gl, Vertex3f theVertex)
           
static Plane enableTrails(BasicRenderer theRenderer)
          tries to turn on trail for current context.
static JoglMesh getCubeMesh()
           
static GL getGL(GLContext theRenderContext)
           
static GLU getGLU(GLContext theRenderContext)
           
static int getTextureUnitID(int theTextureUnitToken)
          transforms opengl texture-id-token to numeric value.
static void gluPerspective(GL gl, float theFOVY, float theAspect, float theZNearPlane, float theZFarPlane, Vector2f theFrustumOffset)
           
static int mapGestaltPrimitiveToOpenGLPrimitive(int theGestaltPrimitive)
           
static int mapOpenGLPrimitiveToGestaltPrimitive(int theOpenGLPrimitive)
           
static void printExtensions(GL gl)
          print availabe opengl extensions.
static boolean printGLError(GL gl, GLU glu, java.lang.String theLocation)
           
static boolean printGLError(GL gl, GLU glu, java.lang.String theLocation, boolean thePrintFlag)
          print opengl error.
static boolean printGLError(GL gl, java.lang.String theLocation)
           
static boolean testExtensionAvailability(GL gl, java.lang.String theExtension)
          test availability of an opengl extension.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JoglUtil

public JoglUtil()
Method Detail

mapOpenGLPrimitiveToGestaltPrimitive

public static int mapOpenGLPrimitiveToGestaltPrimitive(int theOpenGLPrimitive)

mapGestaltPrimitiveToOpenGLPrimitive

public static int mapGestaltPrimitiveToOpenGLPrimitive(int theGestaltPrimitive)

createTextureView

public static JoglMultiTexPlane createTextureView(TexturePlugin theTexture,
                                                  Vector3f thePosition,
                                                  Vector3f theScale)
creates a plane that displays a texture on arbitrary texture unit, defined in the texture object.

Parameters:
theTexture - TexturePlugin
thePosition - Vector3f
theScale - Vector3f
Returns:
JoglMultiTexPlane

enableTrails

public static Plane enableTrails(BasicRenderer theRenderer)
tries to turn on trail for current context.

Parameters:
theRenderer - BasicRenderer
Returns:
Plane

_getTextureUnitID

public static int _getTextureUnitID(int theTextureUnitToken)

getTextureUnitID

public static final int getTextureUnitID(int theTextureUnitToken)
transforms opengl texture-id-token to numeric value. example: GL_TEXTURE0 becomes 0, GL_TEXTURE1 becomes 1 ...

Parameters:
theTextureUnitToken - int
Returns:
int

applyOrigin

public static final void applyOrigin(GL gl,
                                     int theOrigin)
apply origin offset to current opengl matrix stack.

Parameters:
gl - GL
theOrigin - int

applyTransform

public static final void applyTransform(GL gl,
                                        int theTransformMode,
                                        TransformMatrix4f theTransform,
                                        Vector3f theRotation,
                                        Vector3f theScale)
applies the transforms stored in 'transform', 'rotation' and 'scale' as defined in transform mode.

Parameters:
gl - GL
_myTransformMode - int
transform - TransformMatrix4f
rotation - Vector3f
scale - Vector3f

applyTransform

public static final TransformMatrix4f applyTransform(AbstractShape theShape,
                                                     Vector3f theResultPosition)
applies the transforms stored in 'transform', 'rotation' and 'scale' as defined in transform mode.

Parameters:
theShape - AbstractShape
theResultPosition - Vector3f
Returns:
TransformMatrix4f

applyTransform

public static final TransformMatrix4f applyTransform(int theTransformMode,
                                                     TransformMatrix4f theTransform,
                                                     Vector3f theRotation,
                                                     Vector3f theScale,
                                                     Vector3f theResultPosition)
applies the transforms stored in 'transform', 'rotation' and 'scale' as defined in transform mode.

Parameters:
theTransformMode - int
theTransform - TransformMatrix4f
theRotation - Vector3f
theScale - Vector3f
theResultPosition - Vector3f
Returns:
TransformMatrix4f

circle

public static final void circle(GL gl,
                                Vector3f thePosition,
                                float theRadius)
draws a circle from line segments in opengl.

Parameters:
gl - GL
thePosition - Vector3f
theRadius - float

circle

public static final void circle(GL gl,
                                float theRadius)
draws a circle from line segments in opengl.

Parameters:
gl - GL
theRadius - float

draw

public static final void draw(GL gl,
                              Vertex3f theVertex)
Parameters:
gl - GL
theVertex - Vertex3f

gluPerspective

public static final void gluPerspective(GL gl,
                                        float theFOVY,
                                        float theAspect,
                                        float theZNearPlane,
                                        float theZFarPlane,
                                        Vector2f theFrustumOffset)
Parameters:
gl - GL
theFOVY - float
theAspect - float
theZNearPlane - float
theZFarPlane - float
theFrustumOffset - Vector2f

checkFrameBufferStatus

public static final boolean checkFrameBufferStatus(GL gl)
check frame buffer object status.

Parameters:
gl - GL
Returns:
boolean

printGLError

public static final boolean printGLError(GL gl,
                                         java.lang.String theLocation)

printGLError

public static final boolean printGLError(GL gl,
                                         GLU glu,
                                         java.lang.String theLocation)

printGLError

public static final boolean printGLError(GL gl,
                                         GLU glu,
                                         java.lang.String theLocation,
                                         boolean thePrintFlag)
print opengl error.

Parameters:
gl - GL
glu - GLU
theLocation - String
thePrintFlag - boolean
Returns:
boolean

printExtensions

public static final void printExtensions(GL gl)
print availabe opengl extensions.

Parameters:
gl - GL

testExtensionAvailability

public static final boolean testExtensionAvailability(GL gl,
                                                      java.lang.String theExtension)
test availability of an opengl extension.

Parameters:
gl - GL
theExtension - String
Returns:
boolean

getGL

public static final GL getGL(GLContext theRenderContext)

getGLU

public static final GLU getGLU(GLContext theRenderContext)

getCubeMesh

public static JoglMesh getCubeMesh()


processing library gestalt_p5 by Patrick Kochlik + Dennis Paul. (c) 2009