StevEngine
StevEngine is a customizable C++ game engine.
|
Base component for renderable objects. More...
#include <visuals/renderer/RenderComponent.hpp>
Public Member Functions | |
RenderComponent (const Object &object) | |
Create render component. | |
RenderComponent (const Object &object, Utilities::Vector3 position, Utilities::Quaternion rotation, Utilities::Vector3 scale) | |
Create render component with transform. | |
RenderComponent (const Object &object, Utilities::Stream &stream) | |
Create from serialized data. | |
virtual std::string | GetType () const |
Get component type. | |
Object & | GetObject () |
Local scale modifier. | |
Visuals::Material & | GetMaterial () |
Get material. | |
void | AddShader (ShaderProgram program) |
Add shader program. | |
void | RemoveShader (ShaderType type) |
Remove shader of specified type. | |
~RenderComponent () | |
Clean up component resources. | |
virtual Utilities::Stream | Export (Utilities::StreamType type) const |
Serialize component to a stream. | |
![]() | |
Component () | |
Create new component. | |
virtual | ~Component () |
Clean up component resources. | |
GameObject & | GetParent () const |
Get parent GameObject. | |
Scene & | GetScene () const |
Get containing Scene. | |
virtual void | Start () |
Initialize component after creation. | |
Public Attributes | |
Utilities::Vector3 | position = Utilities::Vector3() |
Utilities::Quaternion | rotation = Utilities::Quaternion() |
Local position offset. | |
Utilities::Vector3 | scale = Utilities::Vector3(1, 1, 1) |
Local rotation offset. | |
Protected Attributes | |
Object | object |
Renderable object. | |
std::map< ShaderType, ShaderProgram > | shaders |
Shader programs by type. | |
![]() | |
std::vector< std::pair< Utilities::ID, std::string > > | handlers |
Event handler registrations. | |
Base component for renderable objects.
Component that adds rendering capability to game objects. Handles transform offsets and shader management.
StevEngine::Renderer::RenderComponent::RenderComponent | ( | const Object & | object | ) |
Create render component.
object | Renderable object |
StevEngine::Renderer::RenderComponent::RenderComponent | ( | const Object & | object, |
Utilities::Vector3 | position, | ||
Utilities::Quaternion | rotation, | ||
Utilities::Vector3 | scale ) |
Create render component with transform.
object | Renderable object |
position | Local position offset |
rotation | Local rotation offset |
scale | Local scale modifier |
StevEngine::Renderer::RenderComponent::RenderComponent | ( | const Object & | object, |
Utilities::Stream & | stream ) |
Create from serialized data.
object | Renderable object |
stream | Stream containing serialized component data |
void StevEngine::Renderer::RenderComponent::AddShader | ( | ShaderProgram | program | ) |
Add shader program.
program | Shader to add |
|
virtual |
Serialize component to a stream.
type | Type of stream to export to |
Implements StevEngine::Component.
Reimplemented in StevEngine::Visuals::CapsulePrimitive, StevEngine::Visuals::CubePrimitive, StevEngine::Visuals::CylinderPrimitive, StevEngine::Visuals::IcospherePrimitive, StevEngine::Visuals::TerrainRenderer, and StevEngine::Visuals::UVSpherePrimitive.
|
inline |
Get material.
|
inline |
Local scale modifier.
Get renderable object
|
inlinevirtual |
Get component type.
Implements StevEngine::Component.
Reimplemented in StevEngine::Visuals::CapsulePrimitive, StevEngine::Visuals::CubePrimitive, StevEngine::Visuals::CylinderPrimitive, StevEngine::Visuals::IcospherePrimitive, StevEngine::Visuals::TerrainRenderer, and StevEngine::Visuals::UVSpherePrimitive.
void StevEngine::Renderer::RenderComponent::RemoveShader | ( | ShaderType | type | ) |
Remove shader of specified type.
type | Type of shader to remove |