Planeshift
Public Member Functions | Public Attributes

Waypoint Class Reference

A waypoint is a specified circle on the map with a name, location, and a list of waypoints it is connected to. More...

#include <waypoint.h>

List of all members.

Public Member Functions

WaypointAliasAddAlias (int id, csString aliasName, float rotationAngle)
 Add a new alias to this waypoint.
void AddLink (psPath *path, Waypoint *wp, psPath::Direction direction, float distance)
bool Adjust (iDataConnection *db, csVector3 &pos, csString sector)
void Adjust (csVector3 &pos, csString sector)
void Adjust (csVector3 &pos, iSector *sector)
bool CheckWithin (iEngine *engine, const csVector3 &pos, const iSector *sector)
int Create (iDataConnection *db)
WaypointAliasCreateAlias (iDataConnection *db, csString alias, float rotationAngle)
const WaypointAliasFindAlias (const csString &aliasName) const
 Locate the WaypointAlias struct for a alias by alias name.
WaypointAliasFindAlias (const csString &aliasName)
 Locate the WaypointAlias struct for a alias by alias name.
csString GetAliases ()
 Get a string with aliases for this waypoint.
uint32_t GetEffectID (iEffectIDAllocator *allocator)
 Return the effect ID for this waypoint or assign a new ID.
csString GetFlags () const
const char * GetGroup ()
 Get the group name of this waypoint.
int GetID () const
 Get the id of this waypoint.
const char * GetName () const
 Get the name of this waypoint.
const csVector3 & GetPosition () const
float GetRadius () const
EdgeGetRandomEdge (const psPathNetwork::RouteFilter *routeFilter)
iSector * GetSector (iEngine *engine) const
iSector * GetSector (iEngine *engine)
 Get the sector from the location.
bool Import (iDocumentNode *node, iEngine *engine, iDataConnection *db)
bool Load (iDocumentNode *node, iEngine *engine)
bool Load (iResultRow &row, iEngine *engine)
bool operator< (Waypoint &other) const
bool operator== (Waypoint &other) const
void RecalculateEdges (psWorld *world, iEngine *engine)
bool RemoveAlias (iDataConnection *db, csString alias)
void RemoveAlias (csString aliasName)
 Remove a alias from this waypoint.
void RemoveLink (psPath *path)
void Rename (const char *name)
 Rename the waypoint.
bool Rename (iDataConnection *db, const char *name)
 Rename the waypoint and update the db.
bool SetFlag (iDataConnection *db, const csString &flagstr, bool enable)
 Enable/Disable the listed flags.
bool SetFlag (const csString &flagstr, bool enable)
 Enable/Disable the listed flags.
void SetFlags (const csString &flagStr)
 Set all flags based on the string.
void SetID (int id)
bool SetRadius (iDataConnection *db, float radius)
bool SetRadius (float radius)
bool SetRotationAngle (const csString &aliasName, float rotationAngle)
 Set the rotation angle for an alias.
 Waypoint (csString &name, csVector3 &pos, csString &sectorName, float radius, csString &flags)
 Waypoint (const char *name)
 Waypoint ()

Public Attributes

csPDelArray< WaypointAliasaliases
 Hold aliases for this waypoint.
bool allowReturn
 This prevents the link back to the prior waypoint < from being chosen, if true.
bool city
 True if this waypoint is in a city.
float distance
 Data used in the dijkstra's algorithm to find waypoint path.
csArray< floatdists
 Distances of each link.
csPDelArray< Edgeedges
 Edges for each link.
uint32_t effectID
 When displayed in a client this is the effect id.
bool excluded
 Predecessor WP to track shortest way back to start.
bool ground
 True if this waypoint is ground.
csString group
 Hold group name for this waypoint if any.
bool indoor
 True if this waypoint is indoor.
csArray< Waypoint * > links
 Links to other waypoinst connected with paths from this node.
Location loc
 Id and position.
bool path
 True if this waypoint is a path.
csArray< psPath * > paths
 Path object for each of the links.
Waypointpi
 Hold current shortest distance to the start WP.
bool priv
 True if this waypoint is private.
bool pub
 True if this waypoint is public.
bool road
 True if this waypoint is a road/street.
bool underground
 True if this waypoint is underground.
bool underwater
 True if this waypoint is underwater.

Detailed Description

A waypoint is a specified circle on the map with a name, location, and a list of waypoints it is connected to.

With this class, a network of nodes can be created which will allow for pathfinding and path wandering by NPCs.

Definition at line 81 of file waypoint.h.


Constructor & Destructor Documentation

Waypoint::Waypoint ( )
Waypoint::Waypoint ( const char *  name)
Waypoint::Waypoint ( csString &  name,
csVector3 &  pos,
csString &  sectorName,
float  radius,
csString &  flags 
)

Member Function Documentation

WaypointAlias* Waypoint::AddAlias ( int  id,
csString  aliasName,
float  rotationAngle 
)

Add a new alias to this waypoint.

void Waypoint::AddLink ( psPath path,
Waypoint wp,
psPath::Direction  direction,
float  distance 
)
bool Waypoint::Adjust ( iDataConnection *  db,
csVector3 &  pos,
csString  sector 
)
void Waypoint::Adjust ( csVector3 &  pos,
csString  sector 
)
void Waypoint::Adjust ( csVector3 &  pos,
iSector *  sector 
)
bool Waypoint::CheckWithin ( iEngine *  engine,
const csVector3 &  pos,
const iSector *  sector 
)
int Waypoint::Create ( iDataConnection *  db)
WaypointAlias* Waypoint::CreateAlias ( iDataConnection *  db,
csString  alias,
float  rotationAngle 
)
const WaypointAlias* Waypoint::FindAlias ( const csString &  aliasName) const

Locate the WaypointAlias struct for a alias by alias name.

WaypointAlias* Waypoint::FindAlias ( const csString &  aliasName)

Locate the WaypointAlias struct for a alias by alias name.

csString Waypoint::GetAliases ( )

Get a string with aliases for this waypoint.

uint32_t Waypoint::GetEffectID ( iEffectIDAllocator allocator)

Return the effect ID for this waypoint or assign a new ID.

Parameters:
allocator
csString Waypoint::GetFlags ( ) const
const char* Waypoint::GetGroup ( ) [inline]

Get the group name of this waypoint.

Definition at line 146 of file waypoint.h.

int Waypoint::GetID ( ) const [inline]

Get the id of this waypoint.

Definition at line 134 of file waypoint.h.

const char* Waypoint::GetName ( ) const [inline]

Get the name of this waypoint.

Definition at line 138 of file waypoint.h.

const csVector3& Waypoint::GetPosition ( ) const [inline]

Definition at line 176 of file waypoint.h.

float Waypoint::GetRadius ( ) const [inline]

Definition at line 171 of file waypoint.h.

Edge* Waypoint::GetRandomEdge ( const psPathNetwork::RouteFilter routeFilter)
iSector* Waypoint::GetSector ( iEngine *  engine) [inline]

Get the sector from the location.

Definition at line 166 of file waypoint.h.

iSector* Waypoint::GetSector ( iEngine *  engine) const [inline]

Definition at line 167 of file waypoint.h.

bool Waypoint::Import ( iDocumentNode *  node,
iEngine *  engine,
iDataConnection *  db 
)
bool Waypoint::Load ( iDocumentNode *  node,
iEngine *  engine 
)
bool Waypoint::Load ( iResultRow &  row,
iEngine *  engine 
)
bool Waypoint::operator< ( Waypoint other) const [inline]

Definition at line 114 of file waypoint.h.

bool Waypoint::operator== ( Waypoint other) const [inline]

Definition at line 112 of file waypoint.h.

void Waypoint::RecalculateEdges ( psWorld world,
iEngine *  engine 
)
bool Waypoint::RemoveAlias ( iDataConnection *  db,
csString  alias 
)
void Waypoint::RemoveAlias ( csString  aliasName)

Remove a alias from this waypoint.

void Waypoint::RemoveLink ( psPath path)
bool Waypoint::Rename ( iDataConnection *  db,
const char *  name 
)

Rename the waypoint and update the db.

void Waypoint::Rename ( const char *  name)

Rename the waypoint.

bool Waypoint::SetFlag ( iDataConnection *  db,
const csString &  flagstr,
bool  enable 
)

Enable/Disable the listed flags.

Will search the flagstr input to find the flag to enable or disable.

Parameters:
dbNeed a pointer to the db to update flags
flagstrThe flag to modify.
enableSet to true to enable the flag.
Returns:
True if flags where set.
bool Waypoint::SetFlag ( const csString &  flagstr,
bool  enable 
)

Enable/Disable the listed flags.

Will search the flagstr input to find the flag to enable or disable.

Parameters:
flagstrThe flag to modify.
enableSet to true to enable the flag.
Returns:
True if flags where set.
void Waypoint::SetFlags ( const csString &  flagStr)

Set all flags based on the string.

void Waypoint::SetID ( int  id)
bool Waypoint::SetRadius ( float  radius)
bool Waypoint::SetRadius ( iDataConnection *  db,
float  radius 
)
bool Waypoint::SetRotationAngle ( const csString &  aliasName,
float  rotationAngle 
)

Set the rotation angle for an alias.


Member Data Documentation

Hold aliases for this waypoint.

Definition at line 86 of file waypoint.h.

This prevents the link back to the prior waypoint < from being chosen, if true.

Definition at line 93 of file waypoint.h.

True if this waypoint is in a city.

Definition at line 99 of file waypoint.h.

Data used in the dijkstra's algorithm to find waypoint path.

Definition at line 219 of file waypoint.h.

Distances of each link.

Definition at line 89 of file waypoint.h.

csPDelArray<Edge> Waypoint::edges

Edges for each link.

Definition at line 90 of file waypoint.h.

When displayed in a client this is the effect id.

Definition at line 105 of file waypoint.h.

Predecessor WP to track shortest way back to start.

Definition at line 221 of file waypoint.h.

True if this waypoint is ground.

Definition at line 103 of file waypoint.h.

csString Waypoint::group

Hold group name for this waypoint if any.

Definition at line 85 of file waypoint.h.

True if this waypoint is indoor.

Definition at line 100 of file waypoint.h.

Links to other waypoinst connected with paths from this node.

Definition at line 88 of file waypoint.h.

Id and position.

Definition at line 84 of file waypoint.h.

True if this waypoint is a path.

Definition at line 101 of file waypoint.h.

Path object for each of the links.

Definition at line 91 of file waypoint.h.

Hold current shortest distance to the start WP.

Definition at line 220 of file waypoint.h.

True if this waypoint is private.

Definition at line 97 of file waypoint.h.

True if this waypoint is public.

Definition at line 98 of file waypoint.h.

True if this waypoint is a road/street.

Definition at line 102 of file waypoint.h.

True if this waypoint is underground.

Definition at line 95 of file waypoint.h.

True if this waypoint is underwater.

Definition at line 96 of file waypoint.h.


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