ScummVM API documentation
Alcachofa::PathFindingShape Class Referencefinal

Path finding is based on the Shape class with the invariant that every polygon is a convex polygon with at most four points. Equal points of different quads link them together, for shared edges we add an additional link point in the center of the edge. More...

#include <shape.h>

Inheritance diagram for Alcachofa::PathFindingShape:
Alcachofa::Shape

Public Types

using iterator = PolygonIterator< PathFindingShape, PathFindingPolygon >
 
- Public Types inherited from Alcachofa::Shape
using iterator = PolygonIterator< Shape, Polygon >
 

Public Member Functions

 PathFindingShape (Common::ReadStream &stream)
 
iterator begin () const
 
iterator end () const
 
PathFindingPolygon at (uint index) const
 
int8 orderAt (Common::Point query) const
 
float depthAt (Common::Point query) const
 
bool findPath (Common::Point from, Common::Point to, Common::Stack< Common::Point > &path) const
 
int32 edgeTarget (uint polygonI, uint pointI) const
 
bool findEvadeTarget (Common::Point centerTarget, float depthScale, float minDistSqr, Common::Point &evadeTarget) const
 
- Public Member Functions inherited from Alcachofa::Shape
 Shape (Common::ReadStream &stream)
 
Common::Point firstPoint () const
 
uint polygonCount () const
 
bool empty () const
 
iterator begin () const
 
iterator end () const
 
Polygon at (uint index) const
 
int32 polygonContaining (Common::Point query) const
 
bool contains (Common::Point query) const
 
Common::Point closestPointTo (Common::Point query, int32 &polygonI) const
 
Common::Point closestPointTo (Common::Point query) const
 
void setAsRectangle (const Common::Rect &rect)
 

Static Public Attributes

static constexpr const uint kPointsPerPolygon = 4
 

Additional Inherited Members

- Protected Types inherited from Alcachofa::Shape
using PolygonRange = Common::Pair< uint, uint >
 
- Protected Member Functions inherited from Alcachofa::Shape
uint addPolygon (uint maxCount)
 
- Protected Attributes inherited from Alcachofa::Shape
Common::Array< PolygonRange_polygons
 
Common::Array< Common::Point_points
 

Detailed Description

Path finding is based on the Shape class with the invariant that every polygon is a convex polygon with at most four points. Equal points of different quads link them together, for shared edges we add an additional link point in the center of the edge.

The resulting graph is processed using Floyd-Warshall to precalculate for the actual path finding. Additionally we check whether a character can walk straight through an edge instead of following the link points.


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