Pyrogenesis
trunk
|
Implementation of ICmpPathfinder. More...
#include <CCmpPathfinder_Common.h>
Public Member Functions | |
virtual int | GetComponentTypeId () const |
virtual void | Init (const CParamNode ¶mNode) |
virtual void | Deinit () |
template<typename S > | |
void | SerializeCommon (S &serialize) |
virtual void | Serialize (ISerializer &serialize) |
virtual void | Deserialize (const CParamNode ¶mNode, IDeserializer &deserialize) |
virtual void | HandleMessage (const CMessage &msg, bool global) |
virtual pass_class_t | GetPassabilityClass (const std::string &name) const |
Get the tag for a given passability class name. More... | |
virtual void | GetPassabilityClasses (std::map< std::string, pass_class_t > &passClasses) const |
Get the list of all known passability classes. More... | |
virtual void | GetPassabilityClasses (std::map< std::string, pass_class_t > &nonPathfindingPassClasses, std::map< std::string, pass_class_t > &pathfindingPassClasses) const |
Get the list of passability classes, separating pathfinding classes and others. More... | |
const PathfinderPassability * | GetPassabilityFromMask (pass_class_t passClass) const |
virtual entity_pos_t | GetClearance (pass_class_t passClass) const |
virtual entity_pos_t | GetMaximumClearance () const |
Get the larger clearance in all passability classes. More... | |
virtual const Grid< NavcellData > & | GetPassabilityGrid () |
virtual const GridUpdateInformation & | GetDirtinessData () const |
Passes the lazily-stored dirtiness data collected from the obstruction manager during the previous grid update. More... | |
virtual Grid< u16 > | ComputeShoreGrid (bool expandOnWater=false) |
Get a grid representing the distance to the shore of the terrain tile. More... | |
virtual void | ComputePath (entity_pos_t x0, entity_pos_t z0, const PathGoal &goal, pass_class_t passClass, WaypointPath &ret) |
Compute a tile-based path from the given point to the goal, and return the set of waypoints. More... | |
virtual u32 | ComputePathAsync (entity_pos_t x0, entity_pos_t z0, const PathGoal &goal, pass_class_t passClass, entity_id_t notify) |
Asynchronous version of ComputePath. More... | |
virtual void | ComputeShortPath (const IObstructionTestFilter &filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t clearance, entity_pos_t range, const PathGoal &goal, pass_class_t passClass, WaypointPath &ret) |
Compute a precise path from the given point to the goal, and return the set of waypoints. More... | |
virtual u32 | ComputeShortPathAsync (entity_pos_t x0, entity_pos_t z0, entity_pos_t clearance, entity_pos_t range, const PathGoal &goal, pass_class_t passClass, bool avoidMovingUnits, entity_id_t controller, entity_id_t notify) |
Asynchronous version of ComputeShortPath (using ControlGroupObstructionFilter). More... | |
virtual void | SetDebugPath (entity_pos_t x0, entity_pos_t z0, const PathGoal &goal, pass_class_t passClass) |
If the debug overlay is enabled, render the path that will computed by ComputePath. More... | |
virtual void | SetDebugOverlay (bool enabled) |
Toggle the storage and rendering of debug info. More... | |
virtual void | SetHierDebugOverlay (bool enabled) |
Toggle the storage and rendering of debug info for the hierarchical pathfinder. More... | |
virtual void | GetDebugData (u32 &steps, double &time, Grid< u8 > &grid) const |
Returns some stats about the last ComputePath. More... | |
virtual void | SetAtlasOverlay (bool enable, pass_class_t passClass=0) |
Sets up the pathfinder passability overlay in Atlas. More... | |
virtual bool | CheckMovement (const IObstructionTestFilter &filter, entity_pos_t x0, entity_pos_t z0, entity_pos_t x1, entity_pos_t z1, entity_pos_t r, pass_class_t passClass) const |
Check whether the given movement line is valid and doesn't hit any obstructions or impassable terrain. More... | |
virtual ICmpObstruction::EFoundationCheck | CheckUnitPlacement (const IObstructionTestFilter &filter, entity_pos_t x, entity_pos_t z, entity_pos_t r, pass_class_t passClass, bool onlyCenterPoint) const |
Check whether a unit placed here is valid and doesn't hit any obstructions or impassable terrain. More... | |
virtual ICmpObstruction::EFoundationCheck | CheckBuildingPlacement (const IObstructionTestFilter &filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, entity_id_t id, pass_class_t passClass) const |
Check whether a building placed here is valid and doesn't hit any obstructions or impassable terrain. More... | |
virtual ICmpObstruction::EFoundationCheck | CheckBuildingPlacement (const IObstructionTestFilter &filter, entity_pos_t x, entity_pos_t z, entity_pos_t a, entity_pos_t w, entity_pos_t h, entity_id_t id, pass_class_t passClass, bool onlyCenterPoint) const |
Check whether a building placed here is valid and doesn't hit any obstructions or impassable terrain. More... | |
virtual void | FinishAsyncRequests () |
Finish computing asynchronous path requests and send the CMessagePathResult messages. More... | |
void | ProcessLongRequests (const std::vector< AsyncLongPathRequest > &longRequests) |
void | ProcessShortRequests (const std::vector< AsyncShortPathRequest > &shortRequests) |
virtual void | ProcessSameTurnMoves () |
Process moves during the same turn they were created in to improve responsiveness. More... | |
virtual void | UpdateGrid () |
Regenerates the grid based on the current obstruction list, if necessary. More... | |
void | MinimalTerrainUpdate () |
Updates the terrain-only grid without updating the dirtiness informations. More... | |
void | TerrainUpdateHelper (bool expandPassability=true) |
Regenerates the terrain-only grid. More... | |
void | RenderSubmit (SceneCollector &collector) |
Public Member Functions inherited from IComponent | |
virtual | ~IComponent () |
CEntityHandle | GetEntityHandle () const |
void | SetEntityHandle (CEntityHandle ent) |
entity_id_t | GetEntityId () const |
CEntityHandle | GetSystemEntity () const |
const CSimContext & | GetSimContext () const |
void | SetSimContext (const CSimContext &context) |
virtual bool | NewJSObject (ScriptInterface &scriptInterface, JS::MutableHandleObject out) const |
Returns false by default, indicating that a scripted wrapper of this IComponent is not supported. More... | |
virtual JS::Value | GetJSInstance () const |
Static Public Member Functions | |
static void | ClassInit (CComponentManager &componentManager) |
static IComponent * | Allocate (ScriptInterface &, JS::HandleValue) |
static void | Deallocate (IComponent *cmp) |
static std::string | GetSchema () |
Static Public Member Functions inherited from IComponent | |
static std::string | GetSchema () |
static u8 | GetSerializationVersion () |
Public Attributes | |
std::map< std::string, pass_class_t > | m_PassClassMasks |
std::vector< PathfinderPassability > | m_PassClasses |
std::vector< AsyncLongPathRequest > | m_AsyncLongPathRequests |
std::vector< AsyncShortPathRequest > | m_AsyncShortPathRequests |
u32 | m_NextAsyncTicket |
u16 | m_SameTurnMovesCount |
u16 | m_MapSize |
Grid< NavcellData > * | m_Grid |
Grid< NavcellData > * | m_TerrainOnlyGrid |
GridUpdateInformation | m_ObstructionsDirty |
bool | m_TerrainDirty |
bool | m_PreserveUpdateInformations |
LongPathfinder | m_LongPathfinder |
u16 | m_MaxSameTurnMoves |
std::vector< Edge > | edgesUnaligned |
std::vector< EdgeAA > | edgesLeft |
std::vector< EdgeAA > | edgesRight |
std::vector< EdgeAA > | edgesBottom |
std::vector< EdgeAA > | edgesTop |
std::vector< Vertex > | vertexes |
std::vector< Edge > | edges |
std::vector< Square > | edgeSquares |
bool | m_DebugOverlay |
std::vector< SOverlayLine > | m_DebugOverlayShortPathLines |
AtlasOverlay * | m_AtlasOverlay |
Implementation of ICmpPathfinder.
|
inlinestatic |
|
virtual |
Check whether a building placed here is valid and doesn't hit any obstructions or impassable terrain.
Implements ICmpPathfinder.
|
virtual |
Check whether a building placed here is valid and doesn't hit any obstructions or impassable terrain.
when onlyCenterPoint = true, only check the center tile of the building
Implements ICmpPathfinder.
|
virtual |
Check whether the given movement line is valid and doesn't hit any obstructions or impassable terrain.
Returns true if the movement is okay.
Implements ICmpPathfinder.
|
virtual |
Check whether a unit placed here is valid and doesn't hit any obstructions or impassable terrain.
When onlyCenterPoint = true, only check the center tile of the unit
Implements ICmpPathfinder.
|
inlinestatic |
|
inlinevirtual |
Compute a tile-based path from the given point to the goal, and return the set of waypoints.
The waypoints correspond to the centers of horizontally/vertically adjacent tiles along the path.
Implements ICmpPathfinder.
|
virtual |
Asynchronous version of ComputePath.
The result will be sent as CMessagePathResult to 'notify'. Returns a unique non-zero number, which will match the 'ticket' in the result, so callers can recognise each individual request they make.
Implements ICmpPathfinder.
Get a grid representing the distance to the shore of the terrain tile.
Implements ICmpPathfinder.
|
virtual |
Compute a precise path from the given point to the goal, and return the set of waypoints.
The path is based on the full set of obstructions that pass the filter, such that a unit of clearance 'clearance' will be able to follow the path with no collisions. The path is restricted to a box of radius 'range' from the starting point.
Implements ICmpPathfinder.
|
virtual |
Asynchronous version of ComputeShortPath (using ControlGroupObstructionFilter).
The result will be sent as CMessagePathResult to 'notify'. Returns a unique non-zero number, which will match the 'ticket' in the result, so callers can recognise each individual request they make.
Implements ICmpPathfinder.
|
inlinestatic |
|
virtual |
Implements IComponent.
|
virtual |
Implements IComponent.
|
virtual |
Finish computing asynchronous path requests and send the CMessagePathResult messages.
Implements ICmpPathfinder.
|
inlinevirtual |
Implements ICmpPathfinder.
|
inlinevirtual |
Implements IComponent.
|
inlinevirtual |
Returns some stats about the last ComputePath.
Implements ICmpPathfinder.
|
virtual |
Passes the lazily-stored dirtiness data collected from the obstruction manager during the previous grid update.
Implements ICmpPathfinder.
|
inlinevirtual |
Get the larger clearance in all passability classes.
Implements ICmpPathfinder.
|
virtual |
Get the tag for a given passability class name.
Logs an error and returns something acceptable if the name is unrecognised.
Implements ICmpPathfinder.
|
virtual |
Get the list of all known passability classes.
Implements ICmpPathfinder.
|
virtual |
Get the list of passability classes, separating pathfinding classes and others.
Implements ICmpPathfinder.
const PathfinderPassability * CCmpPathfinder::GetPassabilityFromMask | ( | pass_class_t | passClass | ) | const |
|
virtual |
Implements ICmpPathfinder.
|
inlinestatic |
|
virtual |
Reimplemented from IComponent.
|
virtual |
Implements IComponent.
void CCmpPathfinder::MinimalTerrainUpdate | ( | ) |
Updates the terrain-only grid without updating the dirtiness informations.
Useful for fast passability updates in Atlas.
void CCmpPathfinder::ProcessLongRequests | ( | const std::vector< AsyncLongPathRequest > & | longRequests | ) |
|
virtual |
Process moves during the same turn they were created in to improve responsiveness.
Implements ICmpPathfinder.
void CCmpPathfinder::ProcessShortRequests | ( | const std::vector< AsyncShortPathRequest > & | shortRequests | ) |
void CCmpPathfinder::RenderSubmit | ( | SceneCollector & | collector | ) |
|
virtual |
Implements IComponent.
void CCmpPathfinder::SerializeCommon | ( | S & | serialize | ) |
|
virtual |
Sets up the pathfinder passability overlay in Atlas.
Implements ICmpPathfinder.
|
inlinevirtual |
Toggle the storage and rendering of debug info.
Implements ICmpPathfinder.
|
inlinevirtual |
If the debug overlay is enabled, render the path that will computed by ComputePath.
Implements ICmpPathfinder.
|
inlinevirtual |
Toggle the storage and rendering of debug info for the hierarchical pathfinder.
Implements ICmpPathfinder.
void CCmpPathfinder::TerrainUpdateHelper | ( | bool | expandPassability = true | ) |
Regenerates the terrain-only grid.
Atlas doesn't need to have passability cells expanded.
|
virtual |
Regenerates the grid based on the current obstruction list, if necessary.
Implements ICmpPathfinder.
std::vector<Edge> CCmpPathfinder::edges |
std::vector<EdgeAA> CCmpPathfinder::edgesBottom |
std::vector<EdgeAA> CCmpPathfinder::edgesLeft |
std::vector<Square> CCmpPathfinder::edgeSquares |
std::vector<EdgeAA> CCmpPathfinder::edgesRight |
std::vector<EdgeAA> CCmpPathfinder::edgesTop |
std::vector<Edge> CCmpPathfinder::edgesUnaligned |
std::vector<AsyncLongPathRequest> CCmpPathfinder::m_AsyncLongPathRequests |
std::vector<AsyncShortPathRequest> CCmpPathfinder::m_AsyncShortPathRequests |
AtlasOverlay* CCmpPathfinder::m_AtlasOverlay |
bool CCmpPathfinder::m_DebugOverlay |
std::vector<SOverlayLine> CCmpPathfinder::m_DebugOverlayShortPathLines |
Grid<NavcellData>* CCmpPathfinder::m_Grid |
LongPathfinder CCmpPathfinder::m_LongPathfinder |
u16 CCmpPathfinder::m_MapSize |
u16 CCmpPathfinder::m_MaxSameTurnMoves |
u32 CCmpPathfinder::m_NextAsyncTicket |
GridUpdateInformation CCmpPathfinder::m_ObstructionsDirty |
std::vector<PathfinderPassability> CCmpPathfinder::m_PassClasses |
std::map<std::string, pass_class_t> CCmpPathfinder::m_PassClassMasks |
bool CCmpPathfinder::m_PreserveUpdateInformations |
u16 CCmpPathfinder::m_SameTurnMovesCount |
bool CCmpPathfinder::m_TerrainDirty |
Grid<NavcellData>* CCmpPathfinder::m_TerrainOnlyGrid |
std::vector<Vertex> CCmpPathfinder::vertexes |