com.threerings.opengl.util
Class Compass

java.lang.Object
  extended by com.threerings.opengl.util.SimpleRenderable
      extended by com.threerings.opengl.util.SimpleOverlay
          extended by com.threerings.opengl.util.Compass
All Implemented Interfaces:
Compositable, Enqueueable

public class Compass
extends SimpleOverlay

A compass that displays the coordinate system axes.


Field Summary
protected  Vector3f _vector
          Temporary vector used to determine where the axes lie.
protected  Text _x
          The axis labels.
protected  Text _y
          The axis labels.
protected  Text _z
          The axis labels.
 
Fields inherited from class com.threerings.opengl.util.SimpleRenderable
_batch, _ctx, _priority, _queue
 
Constructor Summary
Compass(GlContext ctx)
          Creates a new compass.
 
Method Summary
protected  void draw()
          Draws the geometry in immediate mode.
protected  void drawAxis(Renderer renderer, Text label, float x, float y)
          Draws one of the compass axes.
 
Methods inherited from class com.threerings.opengl.util.SimpleOverlay
composite, createStates
 
Methods inherited from class com.threerings.opengl.util.SimpleRenderable
createBatch, enqueue, getStates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_x

protected Text _x
The axis labels.


_y

protected Text _y
The axis labels.


_z

protected Text _z
The axis labels.


_vector

protected Vector3f _vector
Temporary vector used to determine where the axes lie.

Constructor Detail

Compass

public Compass(GlContext ctx)
Creates a new compass.

Method Detail

draw

protected void draw()
Description copied from class: SimpleRenderable
Draws the geometry in immediate mode.

Overrides:
draw in class SimpleRenderable

drawAxis

protected void drawAxis(Renderer renderer,
                        Text label,
                        float x,
                        float y)
Draws one of the compass axes.

Parameters:
x - the x component of the rotated axis.
y - the y component of the rotated axis.