xoreos  0.0.5
Public Member Functions | Private Member Functions | List of all members
Engines::KotOR::Walkmesh Class Reference

#include <walkmesh.h>

Inheritance diagram for Engines::KotOR::Walkmesh:
Inheritance graph
[legend]
Collaboration diagram for Engines::KotOR::Walkmesh:
Collaboration graph
[legend]

Public Member Functions

void load (const Common::UString &resRef, ::Aurora::FileType type=::Aurora::kFileTypeWOK, const glm::mat4 &transform=glm::mat4())
 
- Public Member Functions inherited from Graphics::Aurora::Walkmesh
 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 ()
 

Private Member Functions

void appendFromStream (Common::SeekableReadStream &stream, const glm::mat4 &transform)
 
void appendFaceTypes (Common::SeekableReadStream &stream, uint32 faceCount, uint32 faceTypeOffset)
 
void appendIndices (Common::SeekableReadStream &stream, uint32 faceCount, uint32 faceOffset)
 
void appendVertices (Common::SeekableReadStream &stream, uint32 vertexCount, uint32 vertexOffset, const glm::mat4 &transform)
 

Additional Inherited Members

- Protected Member Functions inherited from Graphics::Aurora::Walkmesh
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 inherited from Graphics::Aurora::Walkmesh
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.

Member Function Documentation

◆ appendFaceTypes()

void Engines::KotOR::Walkmesh::appendFaceTypes ( Common::SeekableReadStream stream,
uint32  faceCount,
uint32  faceTypeOffset 
)
private

Definition at line 86 of file walkmesh.cpp.

References Graphics::Aurora::Walkmesh::_faceWalkableMap, Common::ReadStream::readUint32LE(), and Common::SeekableReadStream::seek().

Referenced by appendFromStream().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendFromStream()

void Engines::KotOR::Walkmesh::appendFromStream ( Common::SeekableReadStream stream,
const glm::mat4 &  transform 
)
private

Header format:

uint8[8] - BWM version uint32 - walkmesh type uint8[48] - reserved float[3] - position

Definition at line 55 of file walkmesh.cpp.

References appendFaceTypes(), appendIndices(), appendVertices(), MKTAG, Common::ReadStream::readUint32BE(), Common::ReadStream::readUint32LE(), Common::SeekableReadStream::seek(), and Common::SeekableReadStream::skip().

Referenced by load().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendIndices()

void Engines::KotOR::Walkmesh::appendIndices ( Common::SeekableReadStream stream,
uint32  faceCount,
uint32  faceOffset 
)
private

Definition at line 111 of file walkmesh.cpp.

References Graphics::Aurora::Walkmesh::_indices, Graphics::Aurora::Walkmesh::_vertices, Common::ReadStream::readUint32LE(), and Common::SeekableReadStream::seek().

Referenced by appendFromStream().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ appendVertices()

void Engines::KotOR::Walkmesh::appendVertices ( Common::SeekableReadStream stream,
uint32  vertexCount,
uint32  vertexOffset,
const glm::mat4 &  transform 
)
private

Definition at line 137 of file walkmesh.cpp.

References Graphics::Aurora::Walkmesh::_vertices, Engines::KotOR::multiply(), Common::ReadStream::readIEEEFloatLE(), and Common::SeekableReadStream::seek().

Referenced by appendFromStream().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ load()

void Engines::KotOR::Walkmesh::load ( const Common::UString resRef,
::Aurora::FileType  type = ::Aurora::kFileTypeWOK,
const glm::mat4 &  transform = glm::mat4() 
)

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