Menge
Modular Pedestrian Simulation Framework for Research and Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
Menge::Agents::NavMeshSpatialQuery Class Reference

A spatial query structure based on a navigation mesh. More...

#include <SpatialQueryNavMesh.h>

Inheritance diagram for Menge::Agents::NavMeshSpatialQuery:
Menge::Agents::SpatialQuery Menge::Element

Public Member Functions

 NavMeshSpatialQuery ()
 Constructor.
 
virtual void setAgents (const std::vector< BaseAgent * > &agents)
 Define the set of agents on which kd-tree will query.
 
virtual void updateAgents ()
 Allows the spatial query structure to update its knowledge of the agent positions. More...
 
virtual void agentQuery (ProximityQuery *query) const
 gets agents within a range, and passes them to the supplied filter More...
 
virtual void agentQuery (ProximityQuery *query, float &rangeSq) const
 performs an agent based proximity query More...
 
virtual void processObstacles ()
 Do the necessary pre-computation to support obstacle definitions.
 
virtual void obstacleQuery (ProximityQuery *query) const
 performs an obstacle based proximity query More...
 
virtual void obstacleQuery (ProximityQuery *query, float rangeSq) const
 performs an obstacle based proximity query More...
 
virtual bool queryVisibility (const Vector2 &q1, const Vector2 &q2, float radius) const
 Queries the visibility between two points within a specified radius. NOT CURRENTLY IMPLEMENTED! More...
 
void setNavMeshLocalizer (const NavMeshLocalizerPtr &nml)
 Sets the navigation mesh localizer pointer. More...
 
virtual BFSM::TaskgetTask ()
 Returns a pointer to the nav mesh localizer task. More...
 
- Public Member Functions inherited from Menge::Agents::SpatialQuery
 SpatialQuery ()
 Constructor.
 
virtual void addObstacle (Obstacle *obs)
 adds an obstacle to the internal list of the spatial query
 
const std::vector< Obstacle * > getObstacles ()
 returns the collected obstacles of the spatial query for use in visualization More...
 
virtual void setNeighborVisibleTest (bool state)
 Sets the spatial query to include visibility in finding agent neighbors. More...
 
void setTestVisibility (bool status)
 Sets the test visibility status of the neighbor functions. More...
 
bool getTestVisibility () const
 Reports the test visibility property of the spatial query instance. More...
 
- Public Member Functions inherited from Menge::Element
void destroy ()
 This supplants the destructor. More...
 
virtual SceneGraph::GLNodegetSGNode ()
 Returns an optional visualization element associated with the element. More...
 

Protected Attributes

std::vector< BaseAgent * > _agents
 A vector of pointers to all the agents in the simulation.
 
NavMeshLocalizerPtr _localizer
 The localizer tied to the given navigation mesh.
 
- Protected Attributes inherited from Menge::Agents::SpatialQuery
bool _testVisibility
 Dictates if visibility queries should be used (true) for neighbor queries or not (false).
 
std::vector< Obstacle * > _obstacles
 an internal central list of obstacles
 

Additional Inherited Members

- Protected Member Functions inherited from Menge::Agents::SpatialQuery
virtual ~SpatialQuery ()
 Virtual destructor.
 

Detailed Description

A spatial query structure based on a navigation mesh.

Member Function Documentation

void Menge::Agents::NavMeshSpatialQuery::agentQuery ( ProximityQuery query) const
virtual

gets agents within a range, and passes them to the supplied filter

Parameters
querya pointer to the proximity query to be performed

Implements Menge::Agents::SpatialQuery.

void Menge::Agents::NavMeshSpatialQuery::agentQuery ( ProximityQuery query,
float &  rangeSq 
) const
virtual

performs an agent based proximity query

Parameters
querya pointer to the proximity query to be performed
rangeSqthe range to search (extracted and mutable)
BFSM::Task * Menge::Agents::NavMeshSpatialQuery::getTask ( )
virtual

Returns a pointer to the nav mesh localizer task.

Returns
A pointer to the nav mesh localizer task. It is the responsibility of the caller to free the memory of the provided task by calling its destroy method.

Reimplemented from Menge::Element.

void Menge::Agents::NavMeshSpatialQuery::obstacleQuery ( ProximityQuery query) const
virtual

performs an obstacle based proximity query

Parameters
querya pointer to the proximity query to be performed

Implements Menge::Agents::SpatialQuery.

void Menge::Agents::NavMeshSpatialQuery::obstacleQuery ( ProximityQuery query,
float  rangeSq 
) const
virtual

performs an obstacle based proximity query

Parameters
querya pointer to the proximity query to be performed
rangeSqthe range to search (extracted and mutable)
bool Menge::Agents::NavMeshSpatialQuery::queryVisibility ( const Vector2 q1,
const Vector2 q2,
float  radius 
) const
virtual

Queries the visibility between two points within a specified radius. NOT CURRENTLY IMPLEMENTED!

Parameters
q1The first point between which visibility is to be tested.
q2The second point between which visibility is to be tested.
radiusThe radius within which visibility is to be tested.
Returns
True if q1 and q2 are mutually visible within the radius; false otherwise.

Implements Menge::Agents::SpatialQuery.

void Menge::Agents::NavMeshSpatialQuery::setNavMeshLocalizer ( const NavMeshLocalizerPtr nml)
inline

Sets the navigation mesh localizer pointer.

Parameters
nmlThe managed pointer to the navigation mesh localizer.
virtual void Menge::Agents::NavMeshSpatialQuery::updateAgents ( )
inlinevirtual

Allows the spatial query structure to update its knowledge of the agent positions.

This happens by the NavMeshLocalizer as an FSM task.

Implements Menge::Agents::SpatialQuery.


The documentation for this class was generated from the following files: