StevEngine
StevEngine is a customizable C++ game engine.
Loading...
Searching...
No Matches
StevEngine::Renderer::RenderComponent Class Reference

Base component for renderable objects. More...

#include <visuals/renderer/RenderComponent.hpp>

Inheritance diagram for StevEngine::Renderer::RenderComponent:
StevEngine::Component StevEngine::Visuals::CapsulePrimitive StevEngine::Visuals::CubePrimitive StevEngine::Visuals::CylinderPrimitive StevEngine::Visuals::IcospherePrimitive StevEngine::Visuals::TerrainRenderer StevEngine::Visuals::UVSpherePrimitive

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.
 
ObjectGetObject ()
 Local scale modifier.
 
Visuals::MaterialGetMaterial ()
 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.
 
- Public Member Functions inherited from StevEngine::Component
 Component ()
 Create new component.
 
virtual ~Component ()
 Clean up component resources.
 
GameObjectGetParent () const
 Get parent GameObject.
 
SceneGetScene () const
 Get containing Scene.
 
virtual void Start ()
 Initialize component after creation.
 
virtual void Deactivate ()
 Clean up when component is deactivated.
 
virtual void Update (double deltaTime)
 Update component logic.
 

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, ShaderProgramshaders
 Shader programs by type.
 
- Protected Attributes inherited from StevEngine::Component
std::vector< std::pair< Utilities::ID, std::string > > handlers
 Event handler registrations.
 

Detailed Description

Base component for renderable objects.

Component that adds rendering capability to game objects. Handles transform offsets and shader management.

Constructor & Destructor Documentation

◆ RenderComponent() [1/3]

StevEngine::Renderer::RenderComponent::RenderComponent ( const Object & object)

Create render component.

Parameters
objectRenderable object

◆ RenderComponent() [2/3]

StevEngine::Renderer::RenderComponent::RenderComponent ( const Object & object,
Utilities::Vector3 position,
Utilities::Quaternion rotation,
Utilities::Vector3 scale )

Create render component with transform.

Parameters
objectRenderable object
positionLocal position offset
rotationLocal rotation offset
scaleLocal scale modifier

◆ RenderComponent() [3/3]

StevEngine::Renderer::RenderComponent::RenderComponent ( const Object & object,
Utilities::Stream & stream )

Create from serialized data.

Parameters
objectRenderable object
streamStream containing serialized component data

Member Function Documentation

◆ AddShader()

void StevEngine::Renderer::RenderComponent::AddShader ( ShaderProgram program)

Add shader program.

Parameters
programShader to add

◆ Export()

Utilities::Stream StevEngine::Renderer::RenderComponent::Export ( Utilities::StreamType type) const
virtual

◆ GetMaterial()

Visuals::Material & StevEngine::Renderer::RenderComponent::GetMaterial ( )
inline

Get material.

Returns
Reference to material

◆ GetObject()

Object & StevEngine::Renderer::RenderComponent::GetObject ( )
inline

Local scale modifier.

Get renderable object

Returns
Reference to object

◆ GetType()

virtual std::string StevEngine::Renderer::RenderComponent::GetType ( ) const
inlinevirtual

◆ RemoveShader()

void StevEngine::Renderer::RenderComponent::RemoveShader ( ShaderType type)

Remove shader of specified type.

Parameters
typeType of shader to remove

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