#include <floor.h>
Public Member Functions | |
FloorEdge (uint16 vertexIndex1, uint16 vertexIndex2, uint32 faceIndex1) | |
void | buildNeighbours (const Floor *floor) |
void | computeMiddle (const Floor *floor) |
void | setOtherFace (uint32 faceIndex) |
bool | hasVertices (uint16 vertexIndex1, uint16 vertexIndex2) const |
Common::Array< FloorEdge * > | getNeighbours () const |
float | costTo (const FloorEdge *other) const |
Math::Vector3d | getPosition () const |
bool | isFloorBorder () const |
bool | intersectsSegment (const Floor *floor, const Math::Line3d &segment) const |
int32 | getFaceIndex1 () const |
int32 | getFaceIndex2 () const |
void | enable (bool enable) |
bool | isEnabled () const |
void | saveLoad (ResourceSerializer *serializer) |
A floor face (triangle) edge
Used for path finding
void Stark::Resources::FloorEdge::buildNeighbours | ( | const Floor * | floor | ) |
Build a list of neighbour edges in the graph
void Stark::Resources::FloorEdge::computeMiddle | ( | const Floor * | floor | ) |
Set the edge middle position
void Stark::Resources::FloorEdge::setOtherFace | ( | uint32 | faceIndex | ) |
Set the edge's second face
bool Stark::Resources::FloorEdge::hasVertices | ( | uint16 | vertexIndex1, |
uint16 | vertexIndex2 | ||
) | const |
Check if the edge has the same vertices as the parameters
Common::Array<FloorEdge *> Stark::Resources::FloorEdge::getNeighbours | ( | ) | const |
List the edge neighbour edges in the floor
float Stark::Resources::FloorEdge::costTo | ( | const FloorEdge * | other | ) | const |
Computes the cost for going to a neighbour edge
This is used for pathfinding. The cost is equal to the distance between the middle of both edges
Math::Vector3d Stark::Resources::FloorEdge::getPosition | ( | ) | const |
Get the edge position
This is the middle of the edge
bool Stark::Resources::FloorEdge::isFloorBorder | ( | ) | const |
Is this edge on the floor border?
bool Stark::Resources::FloorEdge::intersectsSegment | ( | const Floor * | floor, |
const Math::Line3d & | segment | ||
) | const |
Does the segment intersect the edge in the 2D plane?
void Stark::Resources::FloorEdge::enable | ( | bool | enable | ) |
Allow or disallow characters to path using this edge
bool Stark::Resources::FloorEdge::isEnabled | ( | ) | const |
Is pathing through this edge allowed for characters?
void Stark::Resources::FloorEdge::saveLoad | ( | ResourceSerializer * | serializer | ) |
Save or restore the edge's status