com.threerings.tudey.util
Class TudeySceneMetrics

java.lang.Object
  extended by com.threerings.tudey.util.TudeySceneMetrics

public class TudeySceneMetrics
extends Object

Contains static methods relating to the Tudey coordinate system.


Field Summary
static Quaternion[] TILE_ROTATIONS
          Tile rotations corresponding to each direction.
 
Constructor Summary
TudeySceneMetrics()
           
 
Method Summary
static CameraConfig getDefaultCameraConfig()
          Returns a reference to the default camera config.
static Rect getDefaultLocalInterest()
          Returns the default local interest region (as derived from the camera parameters).
static Rect getLocalInterest(CameraConfig config, float aspect)
          Returns the local area of interest corresponding to the given camera parameters.
static int getTileElevation(float z)
          Returns the (closest) tile elevation corresponding to the given world space z coordinate.
static int getTileHeight(int width, int height, int rotation)
          Returns the height of a tile with the specified dimensions under the supplied rotation.
static void getTileRegion(int width, int height, int x, int y, int rotation, Rectangle result)
          Finds the region covered by a tile with the specified dimensions at the supplied coordinates with the given rotation.
static void getTileTransform(int width, int height, int x, int y, int elevation, int rotation, Transform3D result)
          Gets the transform of a tile with the specified dimensions at the supplied coordinates with the given rotation.
static int getTileWidth(int width, int height, int rotation)
          Returns the width of a tile with the specified dimensions under the supplied rotation.
static float getTileZ(int elevation)
          Returns the world space z coordinate corresponding to the given tile elevation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TILE_ROTATIONS

public static final Quaternion[] TILE_ROTATIONS
Tile rotations corresponding to each direction.

Constructor Detail

TudeySceneMetrics

public TudeySceneMetrics()
Method Detail

getTileTransform

public static void getTileTransform(int width,
                                    int height,
                                    int x,
                                    int y,
                                    int elevation,
                                    int rotation,
                                    Transform3D result)
Gets the transform of a tile with the specified dimensions at the supplied coordinates with the given rotation.

Parameters:
width - the untransformed width of the tile.
height - the untransformed height of the tile.

getTileRegion

public static void getTileRegion(int width,
                                 int height,
                                 int x,
                                 int y,
                                 int rotation,
                                 Rectangle result)
Finds the region covered by a tile with the specified dimensions at the supplied coordinates with the given rotation.


getTileWidth

public static int getTileWidth(int width,
                               int height,
                               int rotation)
Returns the width of a tile with the specified dimensions under the supplied rotation.


getTileHeight

public static int getTileHeight(int width,
                                int height,
                                int rotation)
Returns the height of a tile with the specified dimensions under the supplied rotation.


getTileZ

public static float getTileZ(int elevation)
Returns the world space z coordinate corresponding to the given tile elevation.


getTileElevation

public static int getTileElevation(float z)
Returns the (closest) tile elevation corresponding to the given world space z coordinate.


getDefaultCameraConfig

public static CameraConfig getDefaultCameraConfig()
Returns a reference to the default camera config.


getDefaultLocalInterest

public static Rect getDefaultLocalInterest()
Returns the default local interest region (as derived from the camera parameters).


getLocalInterest

public static Rect getLocalInterest(CameraConfig config,
                                    float aspect)
Returns the local area of interest corresponding to the given camera parameters.



Copyright © 2011. All Rights Reserved.