xoreos  0.0.5
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Graphics::Aurora::Walkmesh Class Reference

#include <walkmesh.h>

Inheritance diagram for Graphics::Aurora::Walkmesh:
Inheritance graph
[legend]
Collaboration diagram for Graphics::Aurora::Walkmesh:
Collaboration graph
[legend]

Public Member Functions

 Walkmesh ()
 
float getElevationAt (float x, float y, uint32 &faceIndex) const
 Return elevation at given coordinates or FLT_MIN if can't walk there. More...
 
bool testCollision (const glm::vec3 &orig, const glm::vec3 &dest) const
 
void highlightFace (uint32 index)
 Highlight face with specified index. More...
 
void setInvisible (bool invisible)
 
void calculateDistance ()
 Calculate the object's distance. More...
 
void render (Graphics::RenderPass pass)
 Render the object. More...
 
- Public Member Functions inherited from Graphics::Renderable
 Renderable (RenderableType type)
 
 ~Renderable ()
 
bool operator< (const Queueable &q) const
 
virtual void advanceTime (float dt)
 Advance time (used by renderables with animations). More...
 
virtual void renderImmediate (const glm::mat4 &parentTransform)
 For shader based systems, don't sort anything, render this right_now. More...
 
virtual void queueRender (const glm::mat4 &parentTransform)
 Queue the object for later rendering. More...
 
double getDistance () const
 Get the distance of the object from the viewer. More...
 
uint32 getID () const
 Get the object's unique ID. More...
 
bool isClickable () const
 Is the object clickable? More...
 
void setClickable (bool clickable)
 Set the object's clickable state. More...
 
const Common::UStringgetTag () const
 Get the object's tag. More...
 
void setTag (const Common::UString &tag)
 Set the object's tag. More...
 
bool isVisible () const
 Is the object visible? More...
 
virtual void show ()
 Show the object. More...
 
virtual void hide ()
 Hide the object. More...
 
virtual bool isIn (float x, float y) const
 Is that point within the object? More...
 
virtual bool isIn (float x, float y, float z) const
 Is that point within the object? More...
 
virtual bool isIn (float x1, float y1, float z1, float x2, float y2, float z2) const
 Does the line from x1.y1.z1 to x2.y2.z2 intersect with the object? More...
 
- Public Member Functions inherited from Graphics::Queueable
 Queueable ()
 
virtual ~Queueable ()
 

Protected Member Functions

void refreshIndexGroups ()
 
- Protected Member Functions inherited from Graphics::Renderable
void resort ()
 
void lockFrame ()
 
void unlockFrame ()
 
void lockFrameIfVisible ()
 
void unlockFrameIfVisible ()
 
- Protected Member Functions inherited from Graphics::Queueable
bool isInQueue (QueueType queue) const
 
void addToQueue (QueueType queue)
 
void removeFromQueue (QueueType queue)
 
void lockQueue (QueueType queue)
 
void unlockQueue (QueueType queue)
 
void sortQueue (QueueType queue)
 

Protected Attributes

std::vector< float > _vertices
 
std::vector< uint32_indices
 
std::vector< bool > _faceWalkableMap
 
std::vector< uint32_indicesWalkable
 
std::vector< uint32_indicesNonWalkable
 
int _highlightFaceIndex
 
bool _invisible
 
- Protected Attributes inherited from Graphics::Renderable
QueueType _queueExists
 
QueueType _queueVisible
 
uint32 _id
 
bool _clickable
 
Common::UString _tag
 
double _distance
 The distance of the object from the viewer. More...
 

Detailed Description

Definition at line 41 of file walkmesh.h.

Constructor & Destructor Documentation

◆ Walkmesh()

Graphics::Aurora::Walkmesh::Walkmesh ( )

Definition at line 37 of file walkmesh.cpp.

Member Function Documentation

◆ calculateDistance()

void Graphics::Aurora::Walkmesh::calculateDistance ( )
virtual

Calculate the object's distance.

Implements Graphics::Renderable.

Definition at line 114 of file walkmesh.cpp.

◆ getElevationAt()

float Graphics::Aurora::Walkmesh::getElevationAt ( float  x,
float  y,
uint32 faceIndex 
) const

Return elevation at given coordinates or FLT_MIN if can't walk there.

Parameters
faceIndexIndex of the intersected walkmesh face

Definition at line 43 of file walkmesh.cpp.

References _indicesWalkable, _vertices, and FLT_MIN.

Referenced by Engines::KotOR::Room::evaluateElevation(), and Engines::KotOR2::Room::evaluateElevation().

Here is the caller graph for this function:

◆ highlightFace()

void Graphics::Aurora::Walkmesh::highlightFace ( uint32  index)

Highlight face with specified index.

Parameters
indexIndex of the face to highlight or -1 to disable highlighting

Definition at line 106 of file walkmesh.cpp.

References _highlightFaceIndex.

Referenced by Engines::KotOR::Room::disableWalkmeshHighlight(), Engines::KotOR2::Room::disableWalkmeshHighlight(), Engines::KotOR::Room::evaluateElevation(), and Engines::KotOR2::Room::evaluateElevation().

Here is the caller graph for this function:

◆ refreshIndexGroups()

void Graphics::Aurora::Walkmesh::refreshIndexGroups ( )
protected

Definition at line 146 of file walkmesh.cpp.

References _faceWalkableMap, _indices, _indicesNonWalkable, and _indicesWalkable.

Referenced by Engines::KotOR::Walkmesh::load().

Here is the caller graph for this function:

◆ render()

void Graphics::Aurora::Walkmesh::render ( Graphics::RenderPass  pass)
virtual

◆ setInvisible()

void Graphics::Aurora::Walkmesh::setInvisible ( bool  invisible)

◆ testCollision()

bool Graphics::Aurora::Walkmesh::testCollision ( const glm::vec3 &  orig,
const glm::vec3 &  dest 
) const

Member Data Documentation

◆ _faceWalkableMap

std::vector<bool> Graphics::Aurora::Walkmesh::_faceWalkableMap
protected

◆ _highlightFaceIndex

int Graphics::Aurora::Walkmesh::_highlightFaceIndex
protected

Definition at line 74 of file walkmesh.h.

Referenced by highlightFace(), and render().

◆ _indices

std::vector<uint32> Graphics::Aurora::Walkmesh::_indices
protected

◆ _indicesNonWalkable

std::vector<uint32> Graphics::Aurora::Walkmesh::_indicesNonWalkable
protected

Definition at line 73 of file walkmesh.h.

Referenced by refreshIndexGroups(), render(), and testCollision().

◆ _indicesWalkable

std::vector<uint32> Graphics::Aurora::Walkmesh::_indicesWalkable
protected

Definition at line 72 of file walkmesh.h.

Referenced by getElevationAt(), refreshIndexGroups(), and render().

◆ _invisible

bool Graphics::Aurora::Walkmesh::_invisible
protected

Definition at line 75 of file walkmesh.h.

Referenced by render(), and setInvisible().

◆ _vertices

std::vector<float> Graphics::Aurora::Walkmesh::_vertices
protected

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