public class StageSceneUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
OBJECT_ORIENTATION
Value to pass to
locationForObject(TileManager, ObjectInfo, int) and
locationForObject(TileManager, int, int, int, int)for orientation to indicate it
should use the object's orientation. |
| Constructor and Description |
|---|
StageSceneUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
coordsToLocation(int cx,
int cy,
Point loc)
Converts Cartesian coordinates back to full coordinates.
|
static StageLocation |
findStandingSpot(Rectangle foot,
int dist,
com.threerings.media.util.AStarPathUtil.TraversalPred pred,
Object traverser,
Point nearto,
int orient)
Locates a spot to stand near the supplied rectangular footprint.
|
static List<SceneLocation> |
getClusterLocs(Cluster cluster)
Computes a list of the valid locations in this cluster.
|
static com.threerings.miso.data.ObjectInfo[] |
getIntersectedObjects(com.threerings.media.tile.TileManager tmgr,
StageSceneModel model,
Rectangle rect)
Returns an array of the objects intersected by the supplied tile
coordinate rectangle.
|
static com.threerings.miso.util.MisoSceneMetrics |
getMetrics()
Returns the scene metrics we use to do our calculations.
|
static Rectangle |
getObjectFootprint(com.threerings.media.tile.TileManager tilemgr,
int tileId,
int ox,
int oy)
Returns the footprint, in absolute tile coordinates, for the
specified object with origin as specified.
|
static boolean |
getObjectFootprint(com.threerings.media.tile.TileManager tilemgr,
int tileId,
int ox,
int oy,
Rectangle foot)
Fills in the footprint, in absolute tile coordinates, for the
specified object with origin as specified.
|
static boolean |
isPassable(com.threerings.media.tile.TileManager tilemgr,
int tileId)
Looks up the base tile set for the specified fully qualified tile
identifier and returns true if the associated tile is passable.
|
static StageLocation |
locationForObject(com.threerings.media.tile.TileManager tilemgr,
int tileId,
int tx,
int ty)
Does the necessary jiggery pokery to figure out where the specified object's associated
location is.
|
static StageLocation |
locationForObject(com.threerings.media.tile.TileManager tilemgr,
int tileId,
int tx,
int ty,
int orient)
Does the necessary jiggery pokery to figure out where the specified object's associated
location is.
|
static StageLocation |
locationForObject(com.threerings.media.tile.TileManager tilemgr,
com.threerings.miso.data.ObjectInfo info)
Does the necessary jiggery pokery to figure out where the specified object's associated
location is.
|
static StageLocation |
locationForObject(com.threerings.media.tile.TileManager tilemgr,
com.threerings.miso.data.ObjectInfo info,
int orient)
Does the necessary jiggery pokery to figure out where the specified object's associated
location is.
|
static void |
locationToCoords(int lx,
int ly,
Point coords)
Converts full coordinates to Cartesian coordinates.
|
public static final int OBJECT_ORIENTATION
locationForObject(TileManager, ObjectInfo, int) and
locationForObject(TileManager, int, int, int, int)for orientation to indicate it
should use the object's orientation.public static com.threerings.miso.util.MisoSceneMetrics getMetrics()
public static StageLocation locationForObject(com.threerings.media.tile.TileManager tilemgr, com.threerings.miso.data.ObjectInfo info)
public static StageLocation locationForObject(com.threerings.media.tile.TileManager tilemgr, com.threerings.miso.data.ObjectInfo info, int orient)
orient - - the orientation to use in the returned location, or
OBJECT_ORIENTATION if the object's orientation should be usedpublic static StageLocation locationForObject(com.threerings.media.tile.TileManager tilemgr, int tileId, int tx, int ty)
tilemgr - a tile manager that can be used to look up the tile information.tileId - the fully qualified tile id of the object tile.tx - the object's x tile coordinate.ty - the object's y tile coordinate.public static StageLocation locationForObject(com.threerings.media.tile.TileManager tilemgr, int tileId, int tx, int ty, int orient)
tilemgr - a tile manager that can be used to look up the tile information.tileId - the fully qualified tile id of the object tile.tx - the object's x tile coordinate.ty - the object's y tile coordinate.orient - - the orientation to use in the returned location, or
OBJECT_ORIENTATION if the tile's orientation should be usedpublic static void locationToCoords(int lx,
int ly,
Point coords)
public static void coordsToLocation(int cx,
int cy,
Point loc)
public static Rectangle getObjectFootprint(com.threerings.media.tile.TileManager tilemgr, int tileId, int ox, int oy)
public static boolean getObjectFootprint(com.threerings.media.tile.TileManager tilemgr,
int tileId,
int ox,
int oy,
Rectangle foot)
public static boolean isPassable(com.threerings.media.tile.TileManager tilemgr,
int tileId)
public static List<SceneLocation> getClusterLocs(Cluster cluster)
public static StageLocation findStandingSpot(Rectangle foot, int dist, com.threerings.media.util.AStarPathUtil.TraversalPred pred, Object traverser, Point nearto, int orient)
dist.foot - the tile coordinate footprint around which we are
attempting to stand.dist - the maximum number of tiles away from the footprint to
search before giving up.pred - a predicate that will be used to determine whether a
particular spot can be stood upon (we're hijacking the meaning of
"traverse" in this case, but the interface is otherwise so nice).traverser - the object that will be passed to the traversal
predicate.nearto - a point (in tile coordinates) which will be used to
select from among the valid standing spots, the one nearest to the
supplied point will be returned.orient - if not DirectionCodes.NONE this orientation
will be used to override the "natural" orientation of the spot
which is facing toward the footprint.public static com.threerings.miso.data.ObjectInfo[] getIntersectedObjects(com.threerings.media.tile.TileManager tmgr,
StageSceneModel model,
Rectangle rect)
Copyright © 2015. All rights reserved.