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

java.lang.Objectcz.cuni.amis.pogamut.ut2004.agent.navigation.navmesh.NavMesh
public class NavMesh
Class storing NavMesh data structures.
Controlled from NavMeshModule.
| Constructor Summary | |
|---|---|
NavMesh(IWorldView worldView,
Logger log)
|
|
| Method Summary | |
|---|---|
protected void |
clear()
|
IPathFuture<ILocated> |
computePath(ILocated from,
ILocated to)
Computes and returns a path between two points anywhere on the map. |
protected void |
eliminateUnreachablePolygons()
Some polygons cannot be reached we find them with the help of navigation graph Definition: 1. |
NavMeshBSPNode |
getBiggestLeafInTree()
|
double |
getDistanceFromEdge(Location location,
javax.vecmath.Vector2d vector)
Returns distance of the location from the navmesh's edge in the given direction. |
double |
getDistanceFromEdge(Location location,
javax.vecmath.Vector2d vector,
double rayLength)
A simple implementation of NavMesh's 2D raycasting. |
ArrayList |
getNeighbourIdsToPolygon(int i)
Gets an array of polygon ids by an polygon id |
int |
getNumberOfPolygonsInBiggestLeaf()
Debug method: helps to describe BSP tree by telling the number of polygons in the biggest leaf (this should not bee too big. 5 is a good number.) |
List<OffMeshPoint> |
getOffMeshPoinsOnPolygon(int pId)
Returns a List of offmeshpoints that are located on target polygon |
ArrayList<OffMeshPoint> |
getOffMeshPoints()
|
List<ILocated> |
getPath(ILocated from,
ILocated to)
Computes and returns a path between two points anywhere on the map. |
int[] |
getPolygon(int i)
Gets a polygon by its order |
int |
getPolygonIdByLocation(Location location)
Gets the id of a polygon that contains this location |
int |
getPolygonIdByPoint3D(math.geom3d.Point3D point3D)
|
List<INavMeshAtom> |
getPolygonPath(INavMeshAtom fromAtom,
INavMeshAtom toAtom)
Gets a List of polygons on which the path should go. |
List<INavMeshAtom> |
getPolygonPath(Location from,
Location to)
Calls the method with the same name but polygons as arguments and returns result |
ArrayList |
getPolygonsByVertex(int i)
Gets a list of polygons containing this vertex |
ArrayList<int[]> |
getPolys()
|
double[] |
getVertex(int i)
Gets a vertex by its order |
ArrayList<double[]> |
getVerts()
|
boolean |
isLoaded()
|
protected boolean |
load(GameInfo info)
|
protected void |
loadNavMeshFromCoreFile(File processedNavMeshFile)
|
protected void |
loadSourceFile(File pureMeshFile)
|
int |
polyCount()
Returns the number of polygons in navmesh |
protected void |
resetBSPTree()
Gets a new BSPTree for this mesh |
protected void |
resetOffMeshConnections()
Creates off-mesh connections between polygons that does not share an edge, but there is a connection from one to the other in navigation graph. |
protected void |
resetSafeVerts()
Resets the array of boolean values saying whether a vertex is at the edge of navmesh |
protected void |
resetVertsToPolys()
Builds the resetVertsToPolys mapping array |
protected void |
saveNavMeshCore(String mapName)
|
void |
setBiggestLeafInTree(NavMeshBSPNode node)
Debug method: sets the biggest leaf so it can be easily found. |
int |
vertCount()
Returns the number of vertices in navmesh |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NavMesh(IWorldView worldView,
Logger log)
| Method Detail |
|---|
public boolean isLoaded()
protected void clear()
protected boolean load(GameInfo info)
protected void loadNavMeshFromCoreFile(File processedNavMeshFile)
throws FileNotFoundException,
IOException,
ClassNotFoundException
FileNotFoundException
IOException
ClassNotFoundException
protected void loadSourceFile(File pureMeshFile)
throws NumberFormatException,
IOException
NumberFormatException
IOExceptionprotected void resetVertsToPolys()
protected void resetSafeVerts()
protected void resetBSPTree()
protected void eliminateUnreachablePolygons()
protected void resetOffMeshConnections()
protected void saveNavMeshCore(String mapName)
public int polyCount()
public int vertCount()
public int[] getPolygon(int i)
public double[] getVertex(int i)
public ArrayList getPolygonsByVertex(int i)
public ArrayList getNeighbourIdsToPolygon(int i)
public List<OffMeshPoint> getOffMeshPoinsOnPolygon(int pId)
pId -
public int getNumberOfPolygonsInBiggestLeaf()
public void setBiggestLeafInTree(NavMeshBSPNode node)
public int getPolygonIdByPoint3D(math.geom3d.Point3D point3D)
point3D -
public int getPolygonIdByLocation(Location location)
location -
public List<INavMeshAtom> getPolygonPath(INavMeshAtom fromAtom,
INavMeshAtom toAtom)
from - to -
public List<INavMeshAtom> getPolygonPath(Location from,
Location to)
from - to -
public List<ILocated> getPath(ILocated from,
ILocated to)
from - to -
public IPathFuture<ILocated> computePath(ILocated from,
ILocated to)
computePath in interface IPathPlanner<ILocated>from - to -
public double getDistanceFromEdge(Location location,
javax.vecmath.Vector2d vector,
double rayLength)
location - vector -
public double getDistanceFromEdge(Location location,
javax.vecmath.Vector2d vector)
location - vector -
public ArrayList<OffMeshPoint> getOffMeshPoints()
public NavMeshBSPNode getBiggestLeafInTree()
public ArrayList<int[]> getPolys()
public ArrayList<double[]> getVerts()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||