V-Gears 0
Free Final Fantasy VII engine.
Walkmesh Class Reference

A walkmesh. More...

#include <Walkmesh.h>

Public Member Functions

 Walkmesh ()
 Constructor. More...
 
virtual ~Walkmesh ()
 Destructor. More...
 
void UpdateDebug ()
 Updates the walkmesh with debug information. More...
 
void Clear ()
 Deletes all the triangles in the walkmesh. More...
 
void AddTriangle (const WalkmeshTriangle &triangle)
 Adds a triangle to the walkmesh. More...
 
int GetAccessSide (unsigned int triangle_id, unsigned char side) const
 Checks which other triangle is accessed from one side of a triangle. More...
 
const Ogre::Vector3 & GetA (unsigned int triangle_id) const
 Retrieves the first side of a triangle. More...
 
const Ogre::Vector3 & GetB (unsigned int triangle_id) const
 Retrieves the second side of a triangle. More...
 
const Ogre::Vector3 & GetC (unsigned int triangle_id) const
 Retrieves the third side of a triangle. More...
 
int GetNumberOfTriangles () const
 Counts the triangles in the walkmesh. More...
 
void LockWalkmesh (unsigned int triangle_id, bool lock)
 Locks or unlocks a triangle. More...
 
bool IsLocked (unsigned int triangle_id) const
 Checks if a triangle is locked. More...
 
virtual void load (const VGears::WalkmeshFilePtr &walkmesh)
 Loads a walkmesh from a file. More...
 

Private Attributes

std::vector< WalkmeshTriangletriangles_
 The list of triangles. More...
 

Detailed Description

A walkmesh.

Constructor & Destructor Documentation

◆ Walkmesh()

Walkmesh::Walkmesh ( )

Constructor.

◆ ~Walkmesh()

Walkmesh::~Walkmesh ( )
virtual

Destructor.

Member Function Documentation

◆ AddTriangle()

void Walkmesh::AddTriangle ( const WalkmeshTriangle triangle)

Adds a triangle to the walkmesh.

Parameters
[in]triangleTriangle to add.

◆ Clear()

void Walkmesh::Clear ( )

Deletes all the triangles in the walkmesh.

◆ GetA()

const Ogre::Vector3 & Walkmesh::GetA ( unsigned int  triangle_id) const

Retrieves the first side of a triangle.

Parameters
[in]triangle_idID of the triangle.
Returns
The side of the triangle. Ogre::Vector3::ZERO if the triangle doesn't exist.

◆ GetAccessSide()

int Walkmesh::GetAccessSide ( unsigned int  triangle_id,
unsigned char  side 
) const

Checks which other triangle is accessed from one side of a triangle.

Parameters
[in]triangle_idTriangle.
[in]sideThe side index in the triangle.
Returns
The id of the triangle accessed from the indicated triangle and side, or -1 if no triangle can be accessed.

◆ GetB()

const Ogre::Vector3 & Walkmesh::GetB ( unsigned int  triangle_id) const

Retrieves the second side of a triangle.

Parameters
[in]triangle_idID of the triangle.
Returns
The side of the triangle. Ogre::Vector3::ZERO if the triangle doesn't exist.

◆ GetC()

const Ogre::Vector3 & Walkmesh::GetC ( unsigned int  triangle_id) const

Retrieves the third side of a triangle.

Parameters
[in]triangle_idID of the triangle.
Returns
The side of the triangle. Ogre::Vector3::ZERO if the triangle doesn't exist.

◆ GetNumberOfTriangles()

int Walkmesh::GetNumberOfTriangles ( ) const

Counts the triangles in the walkmesh.

Returns
The number of triangles in the walkmesh.

◆ IsLocked()

bool Walkmesh::IsLocked ( unsigned int  triangle_id) const

Checks if a triangle is locked.

Parameters
[in]triangle_idID of the trinagle.
Returns
True if the triangle is locked, false otherwise.

◆ load()

void Walkmesh::load ( const VGears::WalkmeshFilePtr walkmesh)
virtual

Loads a walkmesh from a file.

Parameters
[in]walkmeshWalkmesh file.

◆ LockWalkmesh()

void Walkmesh::LockWalkmesh ( unsigned int  triangle_id,
bool  lock 
)

Locks or unlocks a triangle.

Parameters
[in]triangle_idID of the triangle.
[in]lockTrue to lock, false to unlock.

◆ UpdateDebug()

void Walkmesh::UpdateDebug ( )

Updates the walkmesh with debug information.

Member Data Documentation

◆ triangles_

std::vector<WalkmeshTriangle> Walkmesh::triangles_
private

The list of triangles.


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