Nazara Engine  0.4
A fast, complete, cross-platform API designed for game development
Ndk::GraphicsComponent Class Reference

NDK class that represents the component for graphics. More...

Inherits Ndk::Component< ComponentType >, and Nz::HandledObject< T >.

Public Types

using RenderableList = std::vector< Nz::InstancedRenderableRef >
 

Public Member Functions

 GraphicsComponent (const GraphicsComponent &graphicsComponent)
 Constructs a GraphicsComponent object by copy semantic. More...
 
void AddToCullingList (GraphicsComponentCullingList *cullingList) const
 
void AddToRenderQueue (Nz::AbstractRenderQueue *renderQueue) const
 Adds the renderable elements to the render queue. More...
 
void Attach (Nz::InstancedRenderableRef renderable, int renderOrder=0)
 Attaches a renderable to the entity. More...
 
void Attach (Nz::InstancedRenderableRef renderable, const Nz::Matrix4f &localMatrix, int renderOrder=0)
 Attaches a renderable to the entity with a specific matrix. More...
 
void Clear ()
 Clears every renderable elements.
 
void Detach (const Nz::InstancedRenderable *renderable)
 Detaches a renderable to the entity. More...
 
bool DoesRequireRealTimeReflections () const
 Checks if this graphics component requires real-time reflections to be generated. More...
 
void EnsureBoundingVolumeUpdate () const
 Ensures the bounding volume is up to date.
 
void EnsureTransformMatrixUpdate () const
 Ensures the transformation matrix is up to date.
 
void GetAttachedRenderables (RenderableList *renderables) const
 Gets the set of renderable elements. More...
 
std::size_t GetAttachedRenderableCount () const
 Gets the number of renderable elements attached to the entity. More...
 
const Nz::BoundingVolumefGetBoundingVolume () const
 Gets the bouding volume of the entity. More...
 
void RemoveFromCullingList (GraphicsComponentCullingList *cullingList) const
 
void UpdateLocalMatrix (const Nz::InstancedRenderable *instancedRenderable, const Nz::Matrix4f &localMatrix)
 
void UpdateRenderOrder (const Nz::InstancedRenderable *instancedRenderable, int renderOrder)
 

Static Public Attributes

static ComponentIndex componentIndex
 

Friends

class RenderSystem
 

Detailed Description

NDK class that represents the component for graphics.

Constructor & Destructor Documentation

◆ GraphicsComponent()

Ndk::GraphicsComponent::GraphicsComponent ( const GraphicsComponent graphicsComponent)
inline

Constructs a GraphicsComponent object by copy semantic.

Parameters
graphicsComponentGraphicsComponent to copy

Member Function Documentation

◆ AddToRenderQueue()

void Ndk::GraphicsComponent::AddToRenderQueue ( Nz::AbstractRenderQueue renderQueue) const

Adds the renderable elements to the render queue.

Parameters
renderQueueQueue to be added

◆ Attach() [1/2]

void Ndk::GraphicsComponent::Attach ( Nz::InstancedRenderableRef  renderable,
int  renderOrder = 0 
)
inline

Attaches a renderable to the entity.

Parameters
renderableReference to a renderable element
renderOrderRender order of the element

◆ Attach() [2/2]

void Ndk::GraphicsComponent::Attach ( Nz::InstancedRenderableRef  renderable,
const Nz::Matrix4f localMatrix,
int  renderOrder = 0 
)

Attaches a renderable to the entity with a specific matrix.

Parameters
renderableReference to a renderable element
localMatrixLocal matrix that will be applied to the instanced renderable
renderOrderRender order of the element

◆ Detach()

void Ndk::GraphicsComponent::Detach ( const Nz::InstancedRenderable renderable)
inline

Detaches a renderable to the entity.

Parameters
renderableReference to a renderable element

◆ DoesRequireRealTimeReflections()

bool Ndk::GraphicsComponent::DoesRequireRealTimeReflections ( ) const
inline

Checks if this graphics component requires real-time reflections to be generated.

If any of the materials attached to a GraphicsComponent (via the attached instanced renderable) needs real-time reflections, this function will return true.

Returns
True if real-time reflections needs to be generated or false

◆ GetAttachedRenderableCount()

std::size_t Ndk::GraphicsComponent::GetAttachedRenderableCount ( ) const
inline

Gets the number of renderable elements attached to the entity.

Returns
Number of renderable elements

◆ GetAttachedRenderables()

void Ndk::GraphicsComponent::GetAttachedRenderables ( RenderableList *  renderables) const
inline

Gets the set of renderable elements.

Parameters
renderablesPointer to the list of renderables
Remarks
Produces a NazaraAssert if renderables is invalid

◆ GetBoundingVolume()

const Nz::BoundingVolumef & Ndk::GraphicsComponent::GetBoundingVolume ( ) const
inline

Gets the bouding volume of the entity.

Returns
A constant reference to the bounding volume

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