Planeshift
|
A network of Waypoint and psPath objects. More...
#include <pspathnetwork.h>
Classes | |
class | RouteFilter |
Template class for implementing waypoint filtering when calculating routes. More... | |
Public Member Functions | |
size_t | AddWaypointToGroup (csString group, Waypoint *wp) |
Add a new waypoint to the given group. | |
psPath * | CreatePath (iDataConnection *db, const csString &name, Waypoint *wp1, Waypoint *wp2, const csString &flags) |
Create a new path/connection/link between two waypoints. | |
psPath * | CreatePath (iDataConnection *db, psPath *path) |
Create a new path/connection/link between two waypoints from an external created path object. | |
psPath * | CreatePath (psPath *path) |
Create a new path/connection/link between two waypoints from an external created path object. | |
Waypoint * | CreateWaypoint (iDataConnection *db, csString &name, csVector3 &pos, csString §orName, float radius, csString &flags) |
Create a new waypoint and insert in db. | |
Waypoint * | CreateWaypoint (csString &name, csVector3 &pos, csString §orName, float radius, csString &flags) |
Create a new waypoint. | |
bool | Delete (psPath *path) |
Delete the given path from the db. | |
Edge * | FindEdge (const Waypoint *wp1, const Waypoint *wp2) |
Find a given edge from starting waypoint wp1 to end waypoint wp2. | |
csList< Edge * > | FindEdgeRoute (Waypoint *start, Waypoint *end, const RouteFilter *routeFilter) |
Find the shortest route between waypoint start and stop. | |
psPath * | FindNearestPath (const csVector3 &v, iSector *sector, float range, float *found_range=NULL, int *index=NULL, float *fraction=NULL) |
Find the path nearest to a point in the world. | |
psPathPoint * | FindNearestPoint (const psPath *path, const csVector3 &v, const iSector *sector, float range) |
Find the path nearest to a point in the world. | |
psPath * | FindNearestPoint (const csVector3 &v, iSector *sector, float range, float *found_range=NULL, int *index=NULL) |
Find the point nearest to a point in the world. | |
Waypoint * | FindNearestWaypoint (int group, const csVector3 &v, iSector *sector, float range, float *found_range=NULL) |
Find waypoint nearest to a point in the world in the given group. | |
Waypoint * | FindNearestWaypoint (const csVector3 &v, iSector *sector, float range, float *found_range=NULL) |
Find waypoint nearest to a point in the world. | |
psPath * | FindPath (const char *name) |
Find the named path. | |
psPath * | FindPath (int id) |
Find the path. | |
psPathPoint * | FindPathPoint (int id) |
Find path point by id. | |
psPathPoint * | FindPoint (const psPath *path, const csVector3 &pos, iSector *sector, float range, int &index) |
Find the point nearest to the path. | |
size_t | FindPointsInSector (iSector *sector, csList< psPathPoint * > &list) |
Get a list of points in a sector. | |
Waypoint * | FindRandomWaypoint (int group, const csVector3 &v, iSector *sector, float range, float *found_range=NULL) |
Find random waypoint within a given range to a point in the world. | |
Waypoint * | FindRandomWaypoint (const csVector3 &v, iSector *sector, float range, float *found_range=NULL) |
Find random waypoint within a given range to a point in the world. | |
Waypoint * | FindWaypoint (int id) |
Find waypoint by id. | |
Waypoint * | FindWaypoint (const char *name, WaypointAlias **alias=NULL) |
Find waypoint by name. | |
Waypoint * | FindWaypoint (const csVector3 &v, iSector *sector) |
Find waypoint at a given point in the world. | |
int | FindWaypointGroup (const char *groupName) |
Find the index for the given group name, return -1 if no group is found. | |
csList< Waypoint * > | FindWaypointRoute (Waypoint *start, Waypoint *end, const RouteFilter *routeFilter) |
Find the shortest route between waypoint start and stop. | |
size_t | FindWaypointsInSector (iSector *sector, csList< Waypoint * > &list) |
Get a list of waypoints in a sector. | |
int | GetNextWaypointCheck () |
Get next unique number for waypoint checking. | |
void | ListPaths (const char *pattern) |
List all paths matching pattern to console. | |
void | ListWaypoints (const char *pattern) |
List all waypoints matching pattern to console. | |
bool | Load (iEngine *engine, iDataConnection *db, psWorld *world) |
Load all waypoins and paths from db. | |
Public Attributes | |
csWeakRef< iDataConnection > | db |
csWeakRef< iEngine > | engine |
csPDelArray< psPath > | paths |
csArray< csString > | waypointGroupNames |
csArray< csList< Waypoint * > > | waypointGroups |
csPDelArray< Waypoint > | waypoints |
psWorld * | world |
A network of Waypoint and psPath objects.
Definition at line 42 of file pspathnetwork.h.
size_t psPathNetwork::AddWaypointToGroup | ( | csString | group, |
Waypoint * | wp | ||
) |
Add a new waypoint to the given group.
psPath* psPathNetwork::CreatePath | ( | iDataConnection * | db, |
const csString & | name, | ||
Waypoint * | wp1, | ||
Waypoint * | wp2, | ||
const csString & | flags | ||
) |
Create a new path/connection/link between two waypoints.
Create a new path/connection/link between two waypoints from an external created path object.
Create a new path/connection/link between two waypoints from an external created path object.
Waypoint* psPathNetwork::CreateWaypoint | ( | iDataConnection * | db, |
csString & | name, | ||
csVector3 & | pos, | ||
csString & | sectorName, | ||
float | radius, | ||
csString & | flags | ||
) |
Create a new waypoint and insert in db.
Waypoint* psPathNetwork::CreateWaypoint | ( | csString & | name, |
csVector3 & | pos, | ||
csString & | sectorName, | ||
float | radius, | ||
csString & | flags | ||
) |
Create a new waypoint.
bool psPathNetwork::Delete | ( | psPath * | path | ) |
Delete the given path from the db.
Find a given edge from starting waypoint wp1 to end waypoint wp2.
csList<Edge*> psPathNetwork::FindEdgeRoute | ( | Waypoint * | start, |
Waypoint * | end, | ||
const RouteFilter * | routeFilter | ||
) |
Find the shortest route between waypoint start and stop.
psPath* psPathNetwork::FindNearestPath | ( | const csVector3 & | v, |
iSector * | sector, | ||
float | range, | ||
float * | found_range = NULL , |
||
int * | index = NULL , |
||
float * | fraction = NULL |
||
) |
Find the path nearest to a point in the world.
v | The position to start searching from. | |
sector | The sector to search in. | |
range | Find only paths within range from given position, -1 if range dosn't matter | |
[out] | found_range | The range the path was found at. |
[out] | index | Return the index of the path found. |
[out] | fraction | Return the fraction of the path where the positions is closesed. |
psPathPoint* psPathNetwork::FindNearestPoint | ( | const psPath * | path, |
const csVector3 & | v, | ||
const iSector * | sector, | ||
float | range | ||
) |
Find the path nearest to a point in the world.
path | The path containging the point to search for. |
v | The position to start searching from. |
sector | The sector to search in. |
range | Find only points within range from given position, -1 if range dosn't matter |
psPath* psPathNetwork::FindNearestPoint | ( | const csVector3 & | v, |
iSector * | sector, | ||
float | range, | ||
float * | found_range = NULL , |
||
int * | index = NULL |
||
) |
Find the point nearest to a point in the world.
v | The position to start searching from. | |
sector | The sector to search in. | |
range | Find only points within range from given position, -1 if range dosn't matter | |
[out] | found_range | The range the point was found at. |
[out] | index | Return the index of the point found. |
Waypoint* psPathNetwork::FindNearestWaypoint | ( | int | group, |
const csVector3 & | v, | ||
iSector * | sector, | ||
float | range, | ||
float * | found_range = NULL |
||
) |
Find waypoint nearest to a point in the world in the given group.
group | The group to search in. | |
v | The position to start searching from. | |
sector | The sector to search in. | |
range | Find only waypoints within range from waypoint, -1 if range dosn't matter | |
[out] | found_range | The range the waypoint was found at. |
Waypoint* psPathNetwork::FindNearestWaypoint | ( | const csVector3 & | v, |
iSector * | sector, | ||
float | range, | ||
float * | found_range = NULL |
||
) |
Find waypoint nearest to a point in the world.
v | The position to start searching from. | |
sector | The sector to search in. | |
range | Find only waypoints within range from waypoint, -1 if range dosn't matter | |
[out] | found_range | The range the waypoint was found at. |
psPath* psPathNetwork::FindPath | ( | const char * | name | ) |
Find the named path.
psPathPoint* psPathNetwork::FindPathPoint | ( | int | id | ) |
Find path point by id.
psPathPoint* psPathNetwork::FindPoint | ( | const psPath * | path, |
const csVector3 & | pos, | ||
iSector * | sector, | ||
float | range, | ||
int & | index | ||
) |
Find the point nearest to the path.
path | The path containging the point to search for. | |
pos | The position to start searching from. | |
sector | The sector to search in. | |
range | Find only points within range from given position, -1 if range dosn't matter | |
[out] | index | Return the index of the path point at the start of this segment. |
size_t psPathNetwork::FindPointsInSector | ( | iSector * | sector, |
csList< psPathPoint * > & | list | ||
) |
Get a list of points in a sector.
Waypoint* psPathNetwork::FindRandomWaypoint | ( | int | group, |
const csVector3 & | v, | ||
iSector * | sector, | ||
float | range, | ||
float * | found_range = NULL |
||
) |
Find random waypoint within a given range to a point in the world.
group | The group to search in. | |
v | The position to start searching from. | |
sector | The sector to search in. | |
range | Find only waypoints within range from waypoint, -1 if range dosn't matter | |
[out] | found_range | The range the waypoint was found at. |
Waypoint* psPathNetwork::FindRandomWaypoint | ( | const csVector3 & | v, |
iSector * | sector, | ||
float | range, | ||
float * | found_range = NULL |
||
) |
Find random waypoint within a given range to a point in the world.
v | The position to start searching from. | |
sector | The sector to search in. | |
range | Find only waypoints within range from waypoint, -1 if range dosn't matter | |
[out] | found_range | The range the waypoint was found at. |
Waypoint* psPathNetwork::FindWaypoint | ( | const char * | name, |
WaypointAlias ** | alias = NULL |
||
) |
Find waypoint by name.
name | The name of the waypoint to find |
alias | If not null pointer wil be set if the name is of one of the aliases for the WP found. |
Waypoint* psPathNetwork::FindWaypoint | ( | const csVector3 & | v, |
iSector * | sector | ||
) |
Find waypoint at a given point in the world.
Return the first waypoint where the position is within the radius of the waypoint.
int psPathNetwork::FindWaypointGroup | ( | const char * | groupName | ) |
Find the index for the given group name, return -1 if no group is found.
csList<Waypoint*> psPathNetwork::FindWaypointRoute | ( | Waypoint * | start, |
Waypoint * | end, | ||
const RouteFilter * | routeFilter | ||
) |
Find the shortest route between waypoint start and stop.
size_t psPathNetwork::FindWaypointsInSector | ( | iSector * | sector, |
csList< Waypoint * > & | list | ||
) |
Get a list of waypoints in a sector.
int psPathNetwork::GetNextWaypointCheck | ( | ) |
Get next unique number for waypoint checking.
void psPathNetwork::ListPaths | ( | const char * | pattern | ) |
List all paths matching pattern to console.
void psPathNetwork::ListWaypoints | ( | const char * | pattern | ) |
List all waypoints matching pattern to console.
bool psPathNetwork::Load | ( | iEngine * | engine, |
iDataConnection * | db, | ||
psWorld * | world | ||
) |
Load all waypoins and paths from db.
csWeakRef<iDataConnection> psPathNetwork::db |
Definition at line 66 of file pspathnetwork.h.
csWeakRef<iEngine> psPathNetwork::engine |
Definition at line 65 of file pspathnetwork.h.
csPDelArray<psPath> psPathNetwork::paths |
Definition at line 60 of file pspathnetwork.h.
csArray<csString> psPathNetwork::waypointGroupNames |
Definition at line 62 of file pspathnetwork.h.
csArray< csList<Waypoint*> > psPathNetwork::waypointGroups |
Definition at line 63 of file pspathnetwork.h.
csPDelArray<Waypoint> psPathNetwork::waypoints |
Definition at line 59 of file pspathnetwork.h.
Definition at line 67 of file pspathnetwork.h.