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

Graphics class that represents a billboard, a 2D surface which simulates a 3D object. More...

Inheritance diagram for Nz::Billboard:
Nz::InstancedRenderable Nz::RefCounted

Public Member Functions

 Billboard ()
 Constructs a Billboard object by default.
 
 Billboard (MaterialRef material)
 Constructs a Billboard object with a reference to a material. More...
 
 Billboard (Texture *texture)
 Constructs a Billboard object with a pointer to a texture. More...
 
 Billboard (const Billboard &billboard)
 Constructs a Billboard object by assignation. More...
 
 Billboard (Billboard &&)=delete
 
void AddToRenderQueue (AbstractRenderQueue *renderQueue, const InstanceData &instanceData) const override
 Adds this billboard to the render queue. More...
 
const ColorGetColor () const
 Gets the color of the billboard. More...
 
float GetRotation () const
 Gets the rotation of the billboard. More...
 
const Vector2fGetSize () const
 Gets the size of the billboard. More...
 
void SetColor (const Color &color)
 Sets the color of the billboard. More...
 
void SetDefaultMaterial ()
 Sets the default material of the billboard (just default material)
 
void SetMaterial (MaterialRef material, bool resizeBillboard=true)
 Sets the material of the billboard. More...
 
void SetMaterial (std::size_t skinIndex, MaterialRef material, bool resizeBillboard=true)
 Sets the material of the billboard. More...
 
void SetRotation (float rotation)
 Sets the rotation of the billboard. More...
 
void SetSize (const Vector2f &size)
 Sets the size of the billboard. More...
 
void SetSize (float sizeX, float sizeY)
 Sets the size of the billboard. More...
 
void SetTexture (TextureRef texture, bool resizeBillboard=true)
 Sets the texture of the billboard. More...
 
void SetTexture (std::size_t skinIndex, TextureRef texture, bool resizeBillboard=true)
 Sets the texture of the billboard for a specific index. More...
 
Billboardoperator= (const Billboard &billboard)
 Sets the current billboard with the content of the other one. More...
 
Billboardoperator= (Billboard &&)=delete
 
- Public Member Functions inherited from Nz::InstancedRenderable
 InstancedRenderable ()
 Constructs a InstancedRenderable object by default.
 
 InstancedRenderable (const InstancedRenderable &renderable)
 Constructs a InstancedRenderable object by assignation. More...
 
 InstancedRenderable (InstancedRenderable &&renderable)=delete
 
virtual ~InstancedRenderable ()
 Destructs the object and calls OnInstancedRenderableRelease. More...
 
virtual bool Cull (const Frustumf &frustum, const InstanceData &instanceData) const
 Culls the instanced if not in the frustum. More...
 
void EnsureBoundingVolumeUpdated () const
 Ensures that the bounding volume is up to date.
 
virtual const BoundingVolumefGetBoundingVolume () const
 Gets the bounding volume. More...
 
const MaterialRefGetMaterial (std::size_t matIndex=0) const
 Gets one of the material used by the object. More...
 
const MaterialRefGetMaterial (std::size_t skinIndex, std::size_t matIndex) const
 Gets one of the material used by the object, independently from the active skin. More...
 
std::size_t GetMaterialCount () const
 Gets the number of material per skin. More...
 
std::size_t GetSkin () const
 Gets the current active skin index. More...
 
std::size_t GetSkinCount () const
 Gets the number of skins this object has. More...
 
virtual void InvalidateData (InstanceData *instanceData, UInt32 flags) const
 Invalidates data for instanced. More...
 
void SetSkin (std::size_t skinIndex)
 Changes the active skin. More...
 
void SetSkinCount (std::size_t skinCount)
 Changes the maximum skin count of the object. More...
 
virtual void UpdateBoundingVolume (InstanceData *instanceData) const
 Updates the bounding volume. More...
 
virtual void UpdateData (InstanceData *instanceData) const
 Updates the instance data. More...
 
InstancedRenderableoperator= (const InstancedRenderable &renderable)
 Sets the current instanced renderable with the content of the other one. More...
 
InstancedRenderableoperator= (InstancedRenderable &&renderable)=delete
 
 NazaraSignal (OnInstancedRenderableInvalidateBoundingVolume, const InstancedRenderable *)
 
 NazaraSignal (OnInstancedRenderableInvalidateData, const InstancedRenderable *, UInt32)
 
 NazaraSignal (OnInstancedRenderableInvalidateMaterial, const InstancedRenderable *, std::size_t, std::size_t, const MaterialRef &)
 
 NazaraSignal (OnInstancedRenderableRelease, const InstancedRenderable *)
 
 NazaraSignal (OnInstancedRenderableResetMaterials, const InstancedRenderable *, std::size_t)
 
 NazaraSignal (OnInstancedRenderableSkinChange, const InstancedRenderable *, std::size_t)
 
- Public Member Functions inherited from Nz::RefCounted
 RefCounted (bool persistent=true)
 Constructs a RefCounted object with a persistance aspect. More...
 
 RefCounted (const RefCounted &)=delete
 
 RefCounted (RefCounted &&)=default
 
virtual ~RefCounted ()
 Destructs the object. More...
 
void AddReference () const
 Adds a reference to the object.
 
unsigned int GetReferenceCount () const
 Gets the number of references to the object. More...
 
bool IsPersistent () const
 Checks whether the object is persistent. More...
 
bool RemoveReference () const
 Removes a reference to the object. More...
 
bool SetPersistent (bool persistent=true, bool checkReferenceCount=false)
 Sets the persistence of the object. More...
 
RefCountedoperator= (const RefCounted &)=delete
 
RefCountedoperator= (RefCounted &&)=default
 

Static Public Member Functions

template<typename... Args>
static BillboardRef New (Args &&... args)
 Creates a new billboard from the arguments. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Nz::InstancedRenderable
void InvalidateBoundingVolume ()
 Invalidates the bounding volume.
 
void InvalidateInstanceData (UInt32 flags)
 Invalidates the instance data based on flags. More...
 
void ResetMaterials (std::size_t matCount, std::size_t skinCount=1)
 Resets the materials, material count and skin count. More...
 
void SetMaterial (std::size_t matIndex, MaterialRef material)
 Changes the material used at the specified index by another one. More...
 
void SetMaterial (std::size_t skinIndex, std::size_t matIndex, MaterialRef material)
 Changes the material used at the specified index by another one, independently from the active skin. More...
 
- Protected Attributes inherited from Nz::InstancedRenderable
BoundingVolumef m_boundingVolume
 

Detailed Description

Graphics class that represents a billboard, a 2D surface which simulates a 3D object.

Constructor & Destructor Documentation

◆ Billboard() [1/3]

Nz::Billboard::Billboard ( MaterialRef  material)
inline

Constructs a Billboard object with a reference to a material.

Parameters
materialReference to a material

◆ Billboard() [2/3]

Nz::Billboard::Billboard ( Texture *  texture)
inline

Constructs a Billboard object with a pointer to a texture.

Parameters
texturePointer to a texture

◆ Billboard() [3/3]

Nz::Billboard::Billboard ( const Billboard billboard)
inline

Constructs a Billboard object by assignation.

Parameters
billboardBillboard to copy into this

Member Function Documentation

◆ AddToRenderQueue()

void Nz::Billboard::AddToRenderQueue ( AbstractRenderQueue renderQueue,
const InstanceData &  instanceData 
) const
overridevirtual

Adds this billboard to the render queue.

Parameters
renderQueueQueue to be added
instanceDataData used for instance

Implements Nz::InstancedRenderable.

◆ GetColor()

const Color & Nz::Billboard::GetColor ( ) const
inline

Gets the color of the billboard.

Returns
Current color

◆ GetRotation()

float Nz::Billboard::GetRotation ( ) const
inline

Gets the rotation of the billboard.

Returns
Current rotation

◆ GetSize()

const Vector2f & Nz::Billboard::GetSize ( ) const
inline

Gets the size of the billboard.

Returns
Current size

◆ New()

template<typename... Args>
BillboardRef Nz::Billboard::New ( Args &&...  args)
static

Creates a new billboard from the arguments.

Returns
A reference to the newly created billboard
Parameters
argsArguments for the billboard

◆ operator=()

Billboard & Nz::Billboard::operator= ( const Billboard billboard)
inline

Sets the current billboard with the content of the other one.

Returns
A reference to this
Parameters
billboardThe other Billboard

◆ SetColor()

void Nz::Billboard::SetColor ( const Color color)
inline

Sets the color of the billboard.

Parameters
colorColor for the billboard

◆ SetMaterial() [1/2]

void Nz::Billboard::SetMaterial ( MaterialRef  material,
bool  resizeBillboard = true 
)
inline

Sets the material of the billboard.

Parameters
materialMaterial for the billboard
resizeBillboardShould billboard be resized to the material size (diffuse map)

◆ SetMaterial() [2/2]

void Nz::Billboard::SetMaterial ( std::size_t  skinIndex,
MaterialRef  material,
bool  resizeBillboard = true 
)
inline

Sets the material of the billboard.

Parameters
skinIndexSkin index to change
materialMaterial for the billboard
resizeBillboardShould billboard be resized to the material size (diffuse map)

◆ SetRotation()

void Nz::Billboard::SetRotation ( float  rotation)
inline

Sets the rotation of the billboard.

Parameters
rotationRotation for the billboard

◆ SetSize() [1/2]

void Nz::Billboard::SetSize ( const Vector2f size)
inline

Sets the size of the billboard.

Parameters
sizeSize for the billboard

◆ SetSize() [2/2]

void Nz::Billboard::SetSize ( float  sizeX,
float  sizeY 
)
inline

Sets the size of the billboard.

Parameters
sizeXSize in X for the billboard
sizeYSize in Y for the billboard

◆ SetTexture() [1/2]

void Nz::Billboard::SetTexture ( TextureRef  texture,
bool  resizeBillboard = true 
)
inline

Sets the texture of the billboard.

Parameters
textureTexture for the billboard
resizeBillboardShould billboard be resized to the texture size

◆ SetTexture() [2/2]

void Nz::Billboard::SetTexture ( std::size_t  skinIndex,
TextureRef  texture,
bool  resizeBillboard = true 
)
inline

Sets the texture of the billboard for a specific index.

This function changes the diffuse map of the material associated with the specified skin index

Parameters
skinIndexSkin index to change
textureTexture for the billboard
resizeBillboardShould billboard be resized to the texture size

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