Rubeus::GraphicComponents::RRenderableObject class

A renderable object. Allows specifying the position, size and color of the renderable object.

Derived classes

class RSprite
A sprite compatible with guerrilla renderer.
class RStaticSprite
A static positioned sprite.

Constructors, destructors, conversion operators

RRenderableObject(RML::Vector3D* position, RML::Vector2D* size, RML::Vector4D* color)
Constructor. Sets position, size, color of the sprite to be used for in the given shader.
~RRenderableObject() virtual
Destructor.

Public functions

void submit(RRendererComponent& renderer) const virtual
Submit this object to a render queue.
auto getPosition() const -> const RML::Vector3D&
Gets the position.
auto getSize() const -> const RML::Vector2D&
Gets the size.
auto getColor() const -> const RML::Vector4D&
Gets the color.
auto getUV() const -> const std::vector<RML::Vector2D>&
Returns the UV coords of the vertices.
auto getTextureID() const -> const GLuint
Returns the texture ID of the respective texture assigned.

Public variables

unsigned int m_ObjectID
Identifier for the object.
RML::Vector3D* m_Position
The position of the sprite.
RML::Vector2D* m_Size
The size of the sprite.
RML::Vector4D* m_Color
The color of the sprite.
std::vector<RML::Vector2D> m_UV
The UV/texture coordinates of the current texture being utilised.
RTexture* m_Texture
The texture alloted to this object.

Protected functions

void setUV()
Sets the default values for UV coords.

Function documentation

Rubeus::GraphicComponents::RRenderableObject::RRenderableObject(RML::Vector3D* position, RML::Vector2D* size, RML::Vector4D* color)

Constructor. Sets position, size, color of the sprite to be used for in the given shader.

Parameters
position The position.
size The size.
color The color.

void Rubeus::GraphicComponents::RRenderableObject::submit(RRendererComponent& renderer) const virtual

Submit this object to a render queue.

Parameters
renderer The renderer to submit to.

const RML::Vector3D& Rubeus::GraphicComponents::RRenderableObject::getPosition() const

Gets the position.

Returns The position.

const RML::Vector2D& Rubeus::GraphicComponents::RRenderableObject::getSize() const

Gets the size.

Returns The size.

const RML::Vector4D& Rubeus::GraphicComponents::RRenderableObject::getColor() const

Gets the color.

Returns The color.

const std::vector<RML::Vector2D>& Rubeus::GraphicComponents::RRenderableObject::getUV() const

Returns the UV coords of the vertices.

Returns Reference to a std::vector containing all UV Vector2Ds.

const GLuint Rubeus::GraphicComponents::RRenderableObject::getTextureID() const

Returns the texture ID of the respective texture assigned.

Returns The texture ID.