com.threerings.tudey.tools
Class EditorGrid

java.lang.Object
  extended by com.threerings.opengl.util.SimpleRenderable
      extended by com.threerings.opengl.util.SimpleTransformable
          extended by com.threerings.opengl.util.Grid
              extended by com.threerings.tudey.tools.EditorGrid
All Implemented Interfaces:
Compositable, Enqueueable, Tickable

public class EditorGrid
extends Grid
implements Tickable

A special grid that follows the camera around (while staying aligned to the tile grid).


Field Summary
protected  int _elevation
          The elevation of the grid in tile units.
protected  Vector3f _isect
          A working vector for intersection testing.
protected  Plane _plane
          The grid plane.
protected  Ray3D _target
          A working ray for intersection testing.
protected static int LINE_COUNT
          The number of grid lines in each direction (must be odd so that the center is a line intersection).
 
Fields inherited from class com.threerings.opengl.util.SimpleTransformable
_transform
 
Fields inherited from class com.threerings.opengl.util.SimpleRenderable
_batch, _ctx, _priority, _queue
 
Constructor Summary
EditorGrid(SceneEditor editor)
          Creates a new grid.
 
Method Summary
 int getElevation()
          Returns the elevation of the tile grid.
 Plane getPlane()
          Returns a reference to the grid plane.
 float getZ()
          Returns the z coordinate of the tile grid.
 void setElevation(int elevation)
          Sets the elevation of the grid in tile units.
 void tick(float elapsed)
          Updates the state of this object based on the elapsed time in seconds.
 
Methods inherited from class com.threerings.opengl.util.Grid
createStates, getColor
 
Methods inherited from class com.threerings.opengl.util.SimpleTransformable
enqueue, getCenter, getTransform
 
Methods inherited from class com.threerings.opengl.util.SimpleRenderable
composite, createBatch, draw, getStates
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_elevation

protected int _elevation
The elevation of the grid in tile units.


_plane

protected Plane _plane
The grid plane.


_target

protected Ray3D _target
A working ray for intersection testing.


_isect

protected Vector3f _isect
A working vector for intersection testing.


LINE_COUNT

protected static final int LINE_COUNT
The number of grid lines in each direction (must be odd so that the center is a line intersection).

See Also:
Constant Field Values
Constructor Detail

EditorGrid

public EditorGrid(SceneEditor editor)
Creates a new grid.

Method Detail

setElevation

public void setElevation(int elevation)
Sets the elevation of the grid in tile units.


getElevation

public int getElevation()
Returns the elevation of the tile grid.


getZ

public float getZ()
Returns the z coordinate of the tile grid.


getPlane

public Plane getPlane()
Returns a reference to the grid plane.


tick

public void tick(float elapsed)
Description copied from interface: Tickable
Updates the state of this object based on the elapsed time in seconds.

Specified by:
tick in interface Tickable