ScummVM API documentation
Stark::Resources::FloorEdge Class Reference

#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)
 

Detailed Description

A floor face (triangle) edge

Used for path finding

Member Function Documentation

◆ buildNeighbours()

void Stark::Resources::FloorEdge::buildNeighbours ( const Floor floor)

Build a list of neighbour edges in the graph

◆ computeMiddle()

void Stark::Resources::FloorEdge::computeMiddle ( const Floor floor)

Set the edge middle position

◆ setOtherFace()

void Stark::Resources::FloorEdge::setOtherFace ( uint32  faceIndex)

Set the edge's second face

◆ hasVertices()

bool Stark::Resources::FloorEdge::hasVertices ( uint16  vertexIndex1,
uint16  vertexIndex2 
) const

Check if the edge has the same vertices as the parameters

◆ getNeighbours()

Common::Array<FloorEdge *> Stark::Resources::FloorEdge::getNeighbours ( ) const

List the edge neighbour edges in the floor

◆ costTo()

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

◆ getPosition()

Math::Vector3d Stark::Resources::FloorEdge::getPosition ( ) const

Get the edge position

This is the middle of the edge

◆ isFloorBorder()

bool Stark::Resources::FloorEdge::isFloorBorder ( ) const

Is this edge on the floor border?

◆ intersectsSegment()

bool Stark::Resources::FloorEdge::intersectsSegment ( const Floor floor,
const Math::Line3d &  segment 
) const

Does the segment intersect the edge in the 2D plane?

◆ enable()

void Stark::Resources::FloorEdge::enable ( bool  enable)

Allow or disallow characters to path using this edge

◆ isEnabled()

bool Stark::Resources::FloorEdge::isEnabled ( ) const

Is pathing through this edge allowed for characters?

◆ saveLoad()

void Stark::Resources::FloorEdge::saveLoad ( ResourceSerializer serializer)

Save or restore the edge's status


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