#include <walkregion.h>
Public Member Functions | |
bool | init (const Polygon &contour, const Common::Array< Polygon > *pHoles=0) override |
bool | queryPath (int x1, int y1, int x2, int y2, BS_Path &path) |
bool | queryPath (Vertex startPoint, Vertex endPoint, BS_Path &path) |
void | setPos (int x, int y) override |
const Common::Array< Vertex > & | getNodes () const |
const Common::Array< Common::Array< int > > & | getVisibilityMatrix () const |
bool | persist (OutputPersistenceBlock &writer) override |
bool | unpersist (InputPersistenceBlock &reader) override |
Public Member Functions inherited from Sword25::Region | |
bool | isValid () const |
const Vertex & | getPosition () const |
int | getPosX () const |
int | getPosY () const |
bool | isPointInRegion (const Vertex &vertex) const |
bool | isPointInRegion (int x, int y) const |
const Polygon & | getContour () const |
int | getHoleCount () const |
const Polygon & | getHole (uint i) const |
Vertex | findClosestRegionPoint (const Vertex &point) const |
Vertex | getCentroid () const |
bool | isLineOfSight (const Vertex &a, const Vertex &b) const |
void | setPosX (int x) |
void | setPosY (int y) |
Protected Member Functions | |
WalkRegion (InputPersistenceBlock &Reader, uint handle) | |
Protected Member Functions inherited from Sword25::Region | |
Region () | |
Region (InputPersistenceBlock &reader, uint handle) | |
void | updateBoundingBox () |
Vertex | findClosestPointOnLine (const Vertex &lineStart, const Vertex &lineEnd, const Vertex point) const |
Additional Inherited Members | |
Public Types inherited from Sword25::Region | |
enum | REGION_TYPE { RT_REGION, RT_WALKREGION } |
Static Public Member Functions inherited from Sword25::Region | |
static uint | create (REGION_TYPE type) |
static uint | create (InputPersistenceBlock &reader, uint handle=0) |
Protected Attributes inherited from Sword25::Region | |
REGION_TYPE | _type |
This specifies the type of object. | |
bool | _valid |
This variable indicates whether the current object state is valid. | |
Vertex | _position |
This vertex is the position of the region. | |
Common::Array< Polygon > | _polygons |
This array contains all the polygons that define the region. The first element of. | |
Common::Rect | _boundingBox |
The bounding box for the region. | |
This class represents the region in which the main character can move
|
overridevirtual |
Initializes a BS_Region object
Contour | A polygon indicating the outline of the region |
pHoles | A pointer to an array of polygons representing the hole state in the region. If the region has no holes, it must be passed as NULL. The default value is NULL. |
Reimplemented from Sword25::Region.
|
inline |
Get the shortest path between two points in the region
This method requires that the starting point lies within the region. The end point may lie outside the region. Int his case, the end is chosen as the cloest point to it that lies within the region.
X1 | X Co-ordinate of the start point |
Y1 | Y Co-ordinate of the start point |
X2 | X Co-ordinate of the end point |
Y2 | Y Co-ordinate of the end point |
Path | An empty BS_Path that will be set to the resulting path |
Get the shortest path between two points in the region.
StartPoint | The start point |
EndPoint | The end point |
Path | An empty BS_Path that will be set to the resulting path |
|
overridevirtual |
Sets the position of the region
X | The new X psoition of the region |
Y | The new Y psoition of the region |
Reimplemented from Sword25::Region.