xoreos  0.0.5
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Graphics::Renderable Class Referenceabstract

An object that can be displayed by the graphics manager. More...

#include <renderable.h>

Inheritance diagram for Graphics::Renderable:
Inheritance graph
[legend]
Collaboration diagram for Graphics::Renderable:
Collaboration graph
[legend]

Public Member Functions

 Renderable (RenderableType type)
 
 ~Renderable ()
 
bool operator< (const Queueable &q) const
 
virtual void calculateDistance ()=0
 Calculate the object's distance. More...
 
virtual void advanceTime (float dt)
 Advance time (used by renderables with animations). More...
 
virtual void render (RenderPass pass)=0
 Render the object. 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 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

QueueType _queueExists
 
QueueType _queueVisible
 
uint32 _id
 
bool _clickable
 
Common::UString _tag
 
double _distance
 The distance of the object from the viewer. More...
 

Detailed Description

An object that can be displayed by the graphics manager.

Definition at line 42 of file renderable.h.

Constructor & Destructor Documentation

◆ Renderable()

Graphics::Renderable::Renderable ( RenderableType  type)

◆ ~Renderable()

Graphics::Renderable::~Renderable ( )

Definition at line 69 of file renderable.cpp.

References _queueExists, hide(), and Graphics::Queueable::removeFromQueue().

Here is the call graph for this function:

Member Function Documentation

◆ advanceTime()

void Graphics::Renderable::advanceTime ( float  dt)
virtual

Advance time (used by renderables with animations).

Reimplemented in Graphics::Aurora::Model.

Definition at line 79 of file renderable.cpp.

◆ calculateDistance()

virtual void Graphics::Renderable::calculateDistance ( )
pure virtual

◆ getDistance()

double Graphics::Renderable::getDistance ( ) const

Get the distance of the object from the viewer.

Definition at line 82 of file renderable.cpp.

References _distance.

◆ getID()

uint32 Graphics::Renderable::getID ( ) const

◆ getTag()

const Common::UString & Graphics::Renderable::getTag ( ) const

Get the object's tag.

Definition at line 98 of file renderable.cpp.

References _tag.

Referenced by Engines::GUI::getWidgetAt().

Here is the caller graph for this function:

◆ hide()

void Graphics::Renderable::hide ( )
virtual

◆ isClickable()

bool Graphics::Renderable::isClickable ( ) const

Is the object clickable?

Definition at line 90 of file renderable.cpp.

References _clickable.

Referenced by Graphics::GraphicsManager::getGUIObjectAt(), and Graphics::GraphicsManager::getWorldObjectAt().

Here is the caller graph for this function:

◆ isIn() [1/3]

bool Graphics::Renderable::isIn ( float  x,
float  y 
) const
virtual

◆ isIn() [2/3]

bool Graphics::Renderable::isIn ( float  x,
float  y,
float  z 
) const
virtual

Is that point within the object?

Reimplemented in Graphics::Aurora::Model, and Engines::ConsoleWindow.

Definition at line 131 of file renderable.cpp.

◆ isIn() [3/3]

bool Graphics::Renderable::isIn ( float  x1,
float  y1,
float  z1,
float  x2,
float  y2,
float  z2 
) const
virtual

Does the line from x1.y1.z1 to x2.y2.z2 intersect with the object?

Reimplemented in Graphics::Aurora::Model.

Definition at line 135 of file renderable.cpp.

◆ isVisible()

bool Graphics::Renderable::isVisible ( ) const

Is the object visible?

Definition at line 106 of file renderable.cpp.

References _queueVisible, and Graphics::Queueable::isInQueue().

Referenced by Engines::NWN::DialogBox::finishReplies(), Engines::ConsoleWindow::hidePrompt(), lockFrameIfVisible(), Engines::NWN::DialogBox::setEntry(), Graphics::Aurora::Model::setState(), Engines::ConsoleWindow::showPrompt(), and unlockFrameIfVisible().

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

◆ lockFrame()

void Graphics::Renderable::lockFrame ( )
protected

Definition at line 141 of file renderable.cpp.

References GfxMan.

Referenced by Graphics::Aurora::ModelNode::lockFrame(), and Graphics::Aurora::Model::setState().

Here is the caller graph for this function:

◆ lockFrameIfVisible()

void Graphics::Renderable::lockFrameIfVisible ( )
protected

◆ operator<()

bool Graphics::Renderable::operator< ( const Queueable q) const
virtual

Reimplemented from Graphics::Queueable.

Definition at line 75 of file renderable.cpp.

References _distance.

◆ queueRender()

virtual void Graphics::Renderable::queueRender ( const glm::mat4 &  parentTransform)
inlinevirtual

Queue the object for later rendering.

Reimplemented in Graphics::Aurora::Model.

Definition at line 62 of file renderable.h.

Referenced by Graphics::GraphicsManager::renderWorldShader().

Here is the caller graph for this function:

◆ render()

virtual void Graphics::Renderable::render ( RenderPass  pass)
pure virtual

◆ renderImmediate()

virtual void Graphics::Renderable::renderImmediate ( const glm::mat4 &  parentTransform)
inlinevirtual

For shader based systems, don't sort anything, render this right_now.

Reimplemented in Graphics::Aurora::Model, Engines::NWN::NewGameFog, Graphics::Aurora::Text, and Engines::NWN::Portrait.

Definition at line 59 of file renderable.h.

Referenced by Graphics::GraphicsManager::renderGUIShader().

Here is the caller graph for this function:

◆ resort()

void Graphics::Renderable::resort ( )
protected

◆ setClickable()

void Graphics::Renderable::setClickable ( bool  clickable)

◆ setTag()

void Graphics::Renderable::setTag ( const Common::UString tag)

◆ show()

void Graphics::Renderable::show ( )
virtual

◆ unlockFrame()

void Graphics::Renderable::unlockFrame ( )
protected

Definition at line 145 of file renderable.cpp.

References GfxMan.

Referenced by Graphics::Aurora::Model::setState(), and Graphics::Aurora::ModelNode::unlockFrame().

Here is the caller graph for this function:

◆ unlockFrameIfVisible()

void Graphics::Renderable::unlockFrameIfVisible ( )
protected

Member Data Documentation

◆ _clickable

bool Graphics::Renderable::_clickable
protected

Definition at line 98 of file renderable.h.

Referenced by isClickable(), and setClickable().

◆ _distance

double Graphics::Renderable::_distance
protected

◆ _id

uint32 Graphics::Renderable::_id
protected

Definition at line 96 of file renderable.h.

Referenced by getID(), Video::Bink::BinkVideoTrack::readColors(), and Renderable().

◆ _queueExists

QueueType Graphics::Renderable::_queueExists
protected

Definition at line 93 of file renderable.h.

Referenced by Renderable(), and ~Renderable().

◆ _queueVisible

QueueType Graphics::Renderable::_queueVisible
protected

Definition at line 94 of file renderable.h.

Referenced by hide(), isVisible(), Renderable(), resort(), and show().

◆ _tag

Common::UString Graphics::Renderable::_tag
protected

Definition at line 99 of file renderable.h.

Referenced by getTag(), and setTag().


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