cz.cuni.amis.pogamut.ut2004.agent.navigation.navmesh
Class NavMeshModule

Package class diagram package NavMeshModule
java.lang.Object
  extended by cz.cuni.amis.pogamut.ut2004.agent.navigation.navmesh.NavMeshModule

public class NavMeshModule
extends Object

Main class of Navigation Mesh module.

It expects .navmesh files to be present within ./navmesh directory (at project root). NavMesh files can be obtained from: svn://artemis.ms.mff.cuni.cz/pogamut/trunk/project/Addons/UT2004NavMeshTools/04-NavMeshes

.navmesh file contains pure navmesh for the map. When loaded it gets combined with current navigation graph (extracting off-mesh links that leads between various polygons) and this structure is then stored within ./navmesh as %MAP-NAME%.processed file.

Currently there is no way to regenerate the navmesh during runtime (i.e. if you would like to manipulate with navigation graph / off-mesh links during runtime, its impossible, you will have to copy-paste the implementation of this class and hack it manually), but there is at least a wayy to regenerate .processed file by setting setReloadNavMesh(boolean) to true during IUT2004BotController.mapInfoObtained(). E.g., you might first use NavigationGraphBuilder via UT2004BotModuleController.getNavBuilder() or tweak the map via UT2004MapTweaks, resp. UT2004BotModuleController.getMapTweaks(), then setReloadNavMesh(boolean) set to TRUE in order to regenerate the off-mesh links.

Author:
Jakub Gemrot aka Jimmy, Jakub Tomek

Constructor Summary
NavMeshModule(IUT2004ServerProvider serverProvider, IWorldView worldView, IAgentLogger logger)
           
 
Method Summary
 NavMesh getNavMesh()
          Always non-null, always returns NavMesh.
 NavMeshDraw getNavMeshDraw()
           
 boolean isInitialized()
          Tells whether NavMesh has been initialized and getNavMesh() is usable.
 void setFwMap(FloydWarshallMap fwMap)
           
 void setReloadNavMesh(boolean value)
          Whether NavMeshModule should ignored ".processed" navmesh and reload it from ".navmesh".
 boolean shouldReloadNavMesh()
          Whether NavMeshModule should ignored ".processed" navmesh and reload it from ".navmesh".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NavMeshModule

public NavMeshModule(IUT2004ServerProvider serverProvider,
                     IWorldView worldView,
                     IAgentLogger logger)
Method Detail

isInitialized

public boolean isInitialized()
Tells whether NavMesh has been initialized and getNavMesh() is usable.

Returns:

shouldReloadNavMesh

public boolean shouldReloadNavMesh()
Whether NavMeshModule should ignored ".processed" navmesh and reload it from ".navmesh".

Note that reloading can happen only during load(GameInfo) that means you have to set this flag before GameInfo came from GB2004, i.e., during IUT2004BotController.prepareBot(cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot).

Returns:

setReloadNavMesh

public void setReloadNavMesh(boolean value)
Whether NavMeshModule should ignored ".processed" navmesh and reload it from ".navmesh".

Note that reloading can happen only during load(GameInfo) that means you have to set this flag before GameInfo came from GB2004, i.e., during IUT2004BotController.prepareBot(cz.cuni.amis.pogamut.ut2004.bot.impl.UT2004Bot).


getNavMesh

public NavMesh getNavMesh()
Always non-null, always returns NavMesh. However, you should check isInitialized() whether the NavMesh is usable.

Returns:

getNavMeshDraw

public NavMeshDraw getNavMeshDraw()

setFwMap

public void setFwMap(FloydWarshallMap fwMap)


Copyright © 2015 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.