Skip to content

Vp::ColoredObject

#include "Viewport/entity/ColoredObject.h"

Inherits from Vp::GameObject, Vp::Entity

Inherited by Vp::FrustumObject

Public Functions

Name
ColoredObject(Core::Mesh * mesh, ColorShader * shader)
const glm::vec3 &getColor() const
virtual voidprepareRenderContext(RenderContext & context, const DisplayOptions & displayOptions) override
voidsetColor(const glm::vec3 & color)
voidsetColor(const glm::vec3 * color)

Public Attributes

Name
glm::vec3m_singleColor
boolm_useSingleColor

Additional inherited members

Public Functions inherited from Vp::GameObject

Name
GameObject() =default<br>Creates an empty GameObject.
GameObject(Core::Mesh * mesh, ObjectShader * shader)
virtual voiddispose() override
voidrender(const glm::mat4 & model, const glm::mat4 & view, const glm::mat4 & projection, const DisplayOptions & displayOptions)<br>Renders the entity with default rendering parameters.
virtual voidrender(const glm::mat4 & model, const glm::mat4 & view, const glm::mat4 & projection, const RenderContext & context) override<br>IMPLEMENTATION NOTE: Derived entity classes should expect a certain kind of shader and be able to directly static cast to it.
virtual voidrender(const glm::mat4 & model, const glm::mat4 & view, const glm::mat4 & projection, const RenderContext & context)<br>IMPLEMENTATION NOTE: Derived entity classes should expect a certain kind of shader and be able to directly static cast to it.
virtual voidupdate(Scene & scene) override

Public Attributes inherited from Vp::GameObject

Name
Core::Mesh *m_mesh
floatm_opacity

Public Classes inherited from Vp::Entity

Name
structRenderContext

Public Types inherited from Vp::Entity

Name
enum classRenderType { NORMAL, CUSTOM, SILHOUETTE}

Public Functions inherited from Vp::Entity

Name
Entity()
virtual~Entity() =default
RenderContextcreateRenderContext(const DisplayOptions & displayOptions)
virtual voiddispose() =0
DisplayTypegetDisplayType() const
glm::vec3getHighlightColor() const
boolisHighlighted() const
virtual voidonSceneAdd(Scene & scene)<br>Called when the entity is added to a scene.
virtual voidonSceneRemove(Scene & scene)<br>Called when the entity is removed from a scene.
voidrender(const glm::mat4 & model, const glm::mat4 & view, const glm::mat4 & projection, const DisplayOptions & displayOptions)<br>Renders the entity with default rendering parameters.
virtual voidrender(const glm::mat4 & model, const glm::mat4 & view, const glm::mat4 & projection, const RenderContext & context) =0<br>IMPLEMENTATION NOTE: Derived entity classes should expect a certain kind of shader and be able to directly static cast to it.
voidsetDisplayType(DisplayType type)
voidsetHighlightColor(glm::vec3 highlightColor)
voidsetHighlighted(bool highlight)
virtual voidupdate(Scene & scene) =0

Public Attributes inherited from Vp::Entity

Name
boolm_backFaceCull
unsigned intm_explicitTransparencyOrder <br>Explicit order for ordered transparency.
boolm_highlight <br>Whether to paint this entity with an outline, can be used for selection or just highlighting.
glm::vec3m_highlightColor
boolm_highlightUseDepth <br>Whether the highlight outline should respect the scene's depth buffer.
boolm_ignoreReferenceSpace <br>When true, the "global"/"reference space" model matrix passed to viewport drawing methods is ignored.
boolm_ignoreUserClipping <br>Whether to ignore user clip planes defined in DisplayOptions.
glm::mat4m_lastModelMatrix <br>Potentially modifed model matrix last passed to the shader.
glm::mat4m_modelMatrix <br>Model "world" transformation of the entity.
glm::mat4m_modMatrix <br>Modification transformation, precedes any other transformations, modifies entity vertex data as if the modified data came directly from a source (model file).
boolm_opaque
boolm_selectable <br>Whether this entity should be written into the selection stencil buffer.
intm_selectionId <br>Id of the object, -1 if not assigned, for selection purposes.
Shader *m_shader
boolm_visible
boolm_wboit <br>Whether this entity should be rendered using order independent transparency, relevant if using a shader that supports wboit.
intm_wboitFunc <br>Index of the weight function to be used in wboit.

Protected Attributes inherited from Vp::Entity

Name
DisplayTypem_displayType

Public Functions Documentation

function ColoredObject

cpp
ColoredObject(
    Core::Mesh * mesh,
    ColorShader * shader
)
ColoredObject(
    Core::Mesh * mesh,
    ColorShader * shader
)

function getColor

cpp
const glm::vec3 & getColor() const
const glm::vec3 & getColor() const

function prepareRenderContext

cpp
virtual void prepareRenderContext(
    RenderContext & context,
    const DisplayOptions & displayOptions
) override
virtual void prepareRenderContext(
    RenderContext & context,
    const DisplayOptions & displayOptions
) override

Reimplements: Vp::Entity::prepareRenderContext

Reimplemented by: Vp::FrustumObject::prepareRenderContext

function setColor

cpp
void setColor(
    const glm::vec3 & color
)
void setColor(
    const glm::vec3 & color
)

function setColor

cpp
void setColor(
    const glm::vec3 * color
)
void setColor(
    const glm::vec3 * color
)

Public Attributes Documentation

variable m_singleColor

cpp
glm::vec3 m_singleColor {1.0f, 0.0f, 1.0f};
glm::vec3 m_singleColor {1.0f, 0.0f, 1.0f};

variable m_useSingleColor

cpp
bool m_useSingleColor {false};
bool m_useSingleColor {false};

Updated on 2025-05-31 at 12:55:31 +0000