

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object org.jdesktop.wonderland.client.cell.utils.CellPlacementUtils
public class CellPlacementUtils
A set of utility routines to aid the initial placement of Cells in the world based upon the hints given to it.
Constructor Summary  

CellPlacementUtils()

Method Summary  

static float 
getBoundsHeight(com.jme.bounding.BoundingVolume bounds)
Returns the vertical component of the bounds, assuming the +y axis is up. 
static com.jme.math.Vector3f 
getCellOrigin(ServerSessionManager session,
com.jme.bounding.BoundingVolume bounds,
CellTransform viewTransform)
Returns a vector that represents the origin of a Cell placed optimally, given the bounding volume of the Cell and the "view" Cell Tranform. 
static com.jme.math.Quaternion 
getCellRotation(CellTransform viewTransform)
Returns the rotation of a Cell so that is faces the viewer. 
static CellTransform 
getCellTransform(ServerSessionManager session,
com.jme.bounding.BoundingVolume bounds,
CellTransform viewTransform)
Returns a Cell transform so that it is optimally placed given the bounding volume of the Cell and the transform of the viewer. 
static float 
getDistance(com.jme.bounding.BoundingVolume bounds,
float fieldOfView,
float minDistance,
float maxDistance)
Returns the distance away to play a Cell so that its horizontal bounds are entirely inview. 
static com.jme.math.Vector3f 
getLookDirection(com.jme.math.Quaternion rotation,
com.jme.math.Vector3f v)
Returns the "look direction" given a rotation. 
static float 
getVectorToCollidable(org.jdesktop.mtgame.JMECollisionSystem collision,
com.jme.math.Vector3f position,
com.jme.math.Vector3f lookAt)
Returns the distance from the avatar to the closest collidable object, given a "look at" vector of the avatar and its current position. 
static float 
getVectorToGround(org.jdesktop.mtgame.JMECollisionSystem collision,
com.jme.math.Vector3f position)
Returns the distance to the ground from the given position vector. 
static CellTransform 
transform(CellTransform transform,
CellTransform fromReferenceSystem,
CellTransform toReferenceSystem)
A utility routine to convert the given transform from world coordinates to another reference system. 
Methods inherited from class java.lang.Object 

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Constructor Detail 

public CellPlacementUtils()
Method Detail 

public static CellTransform getCellTransform(ServerSessionManager session, com.jme.bounding.BoundingVolume bounds, CellTransform viewTransform)
session
 The server sessionbounds
 The bounding volume of the CellviewTransform
 The transform of the view Cellpublic static com.jme.math.Vector3f getCellOrigin(ServerSessionManager session, com.jme.bounding.BoundingVolume bounds, CellTransform viewTransform)
session
 The server sessionbounds
 The bounding volume of the CellviewTransform
 The transform of the view Cellpublic static com.jme.math.Quaternion getCellRotation(CellTransform viewTransform)
viewTransform
 The transform of the viewer
public static float getDistance(com.jme.bounding.BoundingVolume bounds, float fieldOfView, float minDistance, float maxDistance)
This method assumes the Cell is rotated so that, with respect to the viewer, the +x axis is to the right, the +y axis is up, and the +z axis is towards the viewer.
This distance returned is at least 'minDistance' away from the viewer and at most 'maxDistance' away from the viewer. If the value for the minimum distance is 1, there is no minimum distance. If the maximum distance is 1, there is no maximum distance. Note that the maximum distance takes precendence over the minimum distance: that is, the Cell may be placed closer than the minimum distance if it exceeds the maximum distance.
bounds
 The bounding volume of the CellfieldOfView
 The fieldofview of the viewer (in degrees)minDistance
 The minimum distance away from the viewer that the
front face of the Cell may be, or 1 for no minimum distancemaxDistance
 The maximum distance away from the viewer that the
front face of the Cell may be, or 1 for no maximim distance
public static float getBoundsHeight(com.jme.bounding.BoundingVolume bounds)
bounds
 The bounding volume
public static com.jme.math.Vector3f getLookDirection(com.jme.math.Quaternion rotation, com.jme.math.Vector3f v)
rotation
 The Quaternion rotationv
 If nonnull, place the lookdirection in this vector
public static float getVectorToGround(org.jdesktop.mtgame.JMECollisionSystem collision, com.jme.math.Vector3f position)
collision
 The collision system to do pickingposition
 The world translation of the position from which the
vector to the ground will be computed.
public static float getVectorToCollidable(org.jdesktop.mtgame.JMECollisionSystem collision, com.jme.math.Vector3f position, com.jme.math.Vector3f lookAt)
This method is used, for example, to find the closest "wall" to the avatar.
collision
 The collision system to do pickingposition
 The position of the avatarlookAt
 The direction the avatar is looking at
public static CellTransform transform(CellTransform transform, CellTransform fromReferenceSystem, CellTransform toReferenceSystem)


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 