org.dronus.gl.GLUtil Class Reference

List of all members.

Static Public Member Functions

static void debugLighting ()
static void renderToScreen (float bw, float bh)
static void renderQuad (float x1, float y1, float x2, float y2, float tw, float th)
static void renderQuad (float x1, float y1, float x2, float y2)
static void renderFrame (float x1, float y1, float x2, float y2)
static void init ()
static Matrix4f getTransform (Matrix4f xform)
static Vector4f getPosition ()
static void initFrustum (float fieldOfView, double near, double far)
static int genTexture ()
static boolean inFrustum (float radius)
static void billboardCylinder ()
static void alignDirection (Vector3f dir)
static void drawLine (Vector3f p1, Vector3f p2)
static void debugDoubleSphere (float r1, float r2)

Static Public Attributes

static float aspect = 4/3f
static float fov = .5f
static boolean showExtents = false
static Color backgroundcolor = new Color(25,25,25)
static Color extentcolor = new Color(255,80,80,25)

Static Package Attributes

static float detail = 1000
static int rendered = 0
static int culled = 0
static Matrix4f invTrans = new Matrix4f()

Detailed Description

some mixed utility for convenient LWJGL use..

-some primitives -frustrum initalization and culling code with detail management -extends GLBufferUtil for even more simplicity

Author:
Paul

Definition at line 30 of file GLUtil.java.


Member Function Documentation

static void org.dronus.gl.GLUtil.debugLighting (  )  [static]

set up some lighting that make things visible und simultaneuos states in absolute clarity that this is DEBUGGING work.

Definition at line 55 of file GLUtil.java.

static void org.dronus.gl.GLUtil.renderToScreen ( float  bw,
float  bh 
) [static]

set up all needed state to render an "as is" fullscreen texture. does flat transform and disable lighting

borders that stay untouched can be defined.

Parameters:
bw fractional border with, 0.0 means borderless.
bh fractional border height
See also:
renderScreenQuad

Definition at line 76 of file GLUtil.java.

References org.dronus.gl.GLUtil.aspect.

static void org.dronus.gl.GLUtil.renderQuad ( float  x1,
float  y1,
float  x2,
float  y2,
float  tw,
float  th 
) [static]

render a quad with current shadig state and custom texture coord range.

Definition at line 99 of file GLUtil.java.

static void org.dronus.gl.GLUtil.renderQuad ( float  x1,
float  y1,
float  x2,
float  y2 
) [static]

render a quad with current shadig state.

Definition at line 119 of file GLUtil.java.

static void org.dronus.gl.GLUtil.renderFrame ( float  x1,
float  y1,
float  x2,
float  y2 
) [static]

render a frame with current shadig state.

Definition at line 139 of file GLUtil.java.

static void org.dronus.gl.GLUtil.init (  )  [static]

Definition at line 151 of file GLUtil.java.

static Matrix4f org.dronus.gl.GLUtil.getTransform ( Matrix4f  xform  )  [static]

gets the object to world space transform

Definition at line 189 of file GLUtil.java.

static Vector4f org.dronus.gl.GLUtil.getPosition (  )  [static]

reads the position of the current transforms origin relative to the viewer. very useful for level of detail/visibility operations.

Returns:
the position to origin

Definition at line 203 of file GLUtil.java.

static void org.dronus.gl.GLUtil.initFrustum ( float  fieldOfView,
double  near,
double  far 
) [static]

Definition at line 213 of file GLUtil.java.

References org.dronus.gl.GLUtil.aspect, org.dronus.gl.GLUtil.culled, org.dronus.gl.GLUtil.fov, and org.dronus.gl.GLUtil.rendered.

static int org.dronus.gl.GLUtil.genTexture (  )  [static]

Definition at line 225 of file GLUtil.java.

static boolean org.dronus.gl.GLUtil.inFrustum ( float  radius  )  [static]

some simple frustum culling helper. *

Parameters:
radius the radius of some sphere
Returns:
if the sphere intersects the view frustum

Definition at line 239 of file GLUtil.java.

References org.dronus.gl.GLUtil.aspect, org.dronus.gl.GLUtil.culled, org.dronus.gl.GLUtil.detail, org.dronus.gl.GLUtil.fov, and org.dronus.gl.GLUtil.rendered.

static void org.dronus.gl.GLUtil.billboardCylinder (  )  [static]

a cylindrical billboarding. aligns an objects z axis towards the viewer by rotation around y axis.

Definition at line 257 of file GLUtil.java.

References org.dronus.gl.GLUtil.invTrans.

static void org.dronus.gl.GLUtil.alignDirection ( Vector3f  dir  )  [static]

align a panel along a given direction eg. for labeling lines with paralel texts. doesn't really work currently.

Parameters:
dir direction to align with

Definition at line 286 of file GLUtil.java.

static void org.dronus.gl.GLUtil.drawLine ( Vector3f  p1,
Vector3f  p2 
) [static]

Definition at line 292 of file GLUtil.java.

static void org.dronus.gl.GLUtil.debugDoubleSphere ( float  r1,
float  r2 
) [static]

render two concentric spheres. useful to show object extends for debugging.

Definition at line 301 of file GLUtil.java.

References org.dronus.gl.GLUtil.extentcolor.


Member Data Documentation

float org.dronus.gl.GLUtil.aspect = 4/3f [static]

Definition at line 32 of file GLUtil.java.

Referenced by org.dronus.gl.GLUtil.inFrustum(), org.dronus.gl.GLUtil.initFrustum(), and org.dronus.gl.GLUtil.renderToScreen().

float org.dronus.gl.GLUtil.fov = .5f [static]

Definition at line 32 of file GLUtil.java.

Referenced by org.dronus.gl.GLUtil.inFrustum(), and org.dronus.gl.GLUtil.initFrustum().

float org.dronus.gl.GLUtil.detail = 1000 [static, package]

detail factor, in approximate normalised screen units. that means only objects extending over 1/detail of the field of view in linear scale will be visible.

this is only useful for very slow machines as we usually won't cull away even 1px objects and so never cull anything.

Definition at line 43 of file GLUtil.java.

Referenced by org.dronus.gl.GLUtil.inFrustum().

boolean org.dronus.gl.GLUtil.showExtents = false [static]

Definition at line 46 of file GLUtil.java.

Color org.dronus.gl.GLUtil.backgroundcolor = new Color(25,25,25) [static]

Definition at line 48 of file GLUtil.java.

Color org.dronus.gl.GLUtil.extentcolor = new Color(255,80,80,25) [static]

Definition at line 49 of file GLUtil.java.

Referenced by org.dronus.gl.GLUtil.debugDoubleSphere().

int org.dronus.gl.GLUtil.rendered = 0 [static, package]

Definition at line 232 of file GLUtil.java.

Referenced by org.dronus.gl.GLUtil.inFrustum(), and org.dronus.gl.GLUtil.initFrustum().

int org.dronus.gl.GLUtil.culled = 0 [static, package]

Definition at line 232 of file GLUtil.java.

Referenced by org.dronus.gl.GLUtil.inFrustum(), and org.dronus.gl.GLUtil.initFrustum().

Matrix4f org.dronus.gl.GLUtil.invTrans = new Matrix4f() [static, package]

Definition at line 252 of file GLUtil.java.

Referenced by org.dronus.gl.GLUtil.billboardCylinder().


The documentation for this class was generated from the following file:
Generated on Tue Apr 7 17:57:36 2009 for visclient by  doxygen 1.5.1