multiverse.server.pathing
Class PathObject

java.lang.Object
  extended by multiverse.server.pathing.PathObject
All Implemented Interfaces:
Serializable, Cloneable

public class PathObject
extends Object
implements Serializable, Cloneable

used in pathing code works with java bean xml serialization

See Also:
Serialized Form

Field Summary
(package private)  List<PathArc> arcs
           
(package private)  PathPolygon boundingPolygon
           
(package private)  int firstTerrainIndex
           
protected static float insideDistance
           
protected static Logger log
           
protected static boolean logAll
           
(package private)  String modelName
           
(package private)  Map<Integer,List<PathArc>> polygonArcs
           
(package private)  Map<Integer,PathPolygon> polygonMap
           
(package private)  List<PathPolygon> polygons
           
(package private)  List<PathArc> portals
           
private static long serialVersionUID
           
(package private)  LinkedList<PathPolygon> terrainPolygonAtCorner
           
(package private)  String type
           
 
Constructor Summary
PathObject()
           
PathObject(String description, float avatarWidth, List<MVVector> boundaryCorners, List<List<MVVector>> obstacleCorners)
          Generate the pathing metadata for avatars of the given width moving inside the boundary around the obstacles.
PathObject(String modelName, String type, int firstTerrainIndex, PathPolygon boundingPolygon, List<PathPolygon> polygons, List<PathArc> portals, List<PathArc> arcs)
           
 
Method Summary
private  void addToArcMap(Map<Integer,List<PathArc>> polygonArcs, PathArc arc, int polyIndex)
           
protected static List<PathPolygon> aggregateTriangles(List<PathPolygon> triangles)
          Aggregate triangles into convex polygons.
 Object clone()
           
 PathIntersection closestIntersection(MVVector loc1, MVVector loc2)
           
protected  void createPolygonMap()
           
protected static List<PathArc> discoverArcs(List<PathPolygon> polygons)
          A quadruple loop over the polygon edges, looking for common ones to find arcs between polygons.
 int findCVPolygonAtLocation(MVVector loc)
           
 int findTerrainPolygonAtLocation(MVVector loc)
           
protected  void findTerrainPolygonsAtCorners()
           
 List<PathArc> getArcs()
           
 PathPolygon getBoundingPolygon()
           
 MVVector getCenter()
           
 int getClosestCornerToPoint(MVVector loc)
           
 PathPolygon getCVPolygon(int polyIndex)
           
 int getFirstTerrainIndex()
           
 String getModelName()
           
 PathPolygon getPolygon(int polyIndex)
           
 List<PathArc> getPolygonArcs(int polyIndex)
           
 List<PathPolygon> getPolygons()
           
 List<PathArc> getPortals()
           
 int getRadius()
           
 PathPolygon getTerrainPolygon(int polyIndex)
           
 PathPolygon getTerrainPolygonAtCorner(int cornerNumber)
           
 String getType()
           
 boolean isTerrainPolygon(int polyIndex)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

modelName

String modelName

type

String type

firstTerrainIndex

int firstTerrainIndex

boundingPolygon

PathPolygon boundingPolygon

polygons

List<PathPolygon> polygons

portals

List<PathArc> portals

arcs

List<PathArc> arcs

polygonArcs

Map<Integer,List<PathArc>> polygonArcs

polygonMap

Map<Integer,PathPolygon> polygonMap

terrainPolygonAtCorner

LinkedList<PathPolygon> terrainPolygonAtCorner

insideDistance

protected static float insideDistance

log

protected static final Logger log

logAll

protected static boolean logAll

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values
Constructor Detail

PathObject

public PathObject()

PathObject

public PathObject(String modelName,
                  String type,
                  int firstTerrainIndex,
                  PathPolygon boundingPolygon,
                  List<PathPolygon> polygons,
                  List<PathArc> portals,
                  List<PathArc> arcs)

PathObject

public PathObject(String description,
                  float avatarWidth,
                  List<MVVector> boundaryCorners,
                  List<List<MVVector>> obstacleCorners)
Generate the pathing metadata for avatars of the given width moving inside the boundary around the obstacles.

Method Detail

aggregateTriangles

protected static List<PathPolygon> aggregateTriangles(List<PathPolygon> triangles)
Aggregate triangles into convex polygons.


discoverArcs

protected static List<PathArc> discoverArcs(List<PathPolygon> polygons)
A quadruple loop over the polygon edges, looking for common ones to find arcs between polygons.


findTerrainPolygonsAtCorners

protected void findTerrainPolygonsAtCorners()

getCVPolygon

public PathPolygon getCVPolygon(int polyIndex)

getTerrainPolygon

public PathPolygon getTerrainPolygon(int polyIndex)

isTerrainPolygon

public boolean isTerrainPolygon(int polyIndex)

getTerrainPolygonAtCorner

public PathPolygon getTerrainPolygonAtCorner(int cornerNumber)

getClosestCornerToPoint

public int getClosestCornerToPoint(MVVector loc)

getPolygon

public PathPolygon getPolygon(int polyIndex)

createPolygonMap

protected void createPolygonMap()

findCVPolygonAtLocation

public int findCVPolygonAtLocation(MVVector loc)

findTerrainPolygonAtLocation

public int findTerrainPolygonAtLocation(MVVector loc)

closestIntersection

public PathIntersection closestIntersection(MVVector loc1,
                                            MVVector loc2)

getPolygonArcs

public List<PathArc> getPolygonArcs(int polyIndex)

addToArcMap

private void addToArcMap(Map<Integer,List<PathArc>> polygonArcs,
                         PathArc arc,
                         int polyIndex)

toString

public String toString()
Overrides:
toString in class Object

clone

public Object clone()
Overrides:
clone in class Object

getModelName

public String getModelName()

getType

public String getType()

getFirstTerrainIndex

public int getFirstTerrainIndex()

getCenter

public MVVector getCenter()

getRadius

public int getRadius()

getBoundingPolygon

public PathPolygon getBoundingPolygon()

getPolygons

public List<PathPolygon> getPolygons()

getPortals

public List<PathArc> getPortals()

getArcs

public List<PathArc> getArcs()