Copperfield Engine 0.1
C++ Game Engine
Loading...
Searching...
No Matches
RenderCmp Struct Reference

Component used to render an object. More...

#include <default_components.hpp>

Public Member Functions

 RenderCmp (const Mesh *mesh, const Texture *texture, const coma::Vec3 &color={1.0f, 1.0f, 1.0f}, bool castShadows=true, float roughness=0.5f, float shininess=32.0f)
 Creates a RenderCmp allowing setting its parameters. More...
 

Public Attributes

Mesh const * mesh_ = nullptr
 Mesh of the object you want to render. Must have a value.
 
Texture const * texture_ = nullptr
 Texture of the object. Must have a value.
 
coma::Vec3 color_ = {1.0f,1.0f,1.0f}
 Color of the object; it will get mixed with the texture.
 
float roughness_ = 0.5f
 Affects the intensity of the reflections it receives.
 
float shininess_ = 32.0f
 Affects the size and definition of the reflections it receives.
 
bool cast_shadows_ = true
 Defines if the object projects shadows.
 

Detailed Description

Component used to render an object.

mesh_ and texture_ must have a value. If you don't want to use a texture and prefer a simple color, you can set a white texture with ResourceManager::getEmptyTexture.

Constructor & Destructor Documentation

◆ RenderCmp()

RenderCmp::RenderCmp ( const Mesh *  mesh,
const Texture *  texture,
const coma::Vec3 color = {1.0f,1.0f,1.0f},
bool  castShadows = true,
float  roughness = 0.5f,
float  shininess = 32.0f 
)
inline

Creates a RenderCmp allowing setting its parameters.

Parameters
meshmesh_
texturetexture_
colorcolor_
castShadowscast_shadows_
roughnessroughness_
shininessshininess_