Tramway SDK
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
tram::LightComponent Class Reference

#include <light.h>

Inheritance diagram for tram::LightComponent:
tram::EntityComponent

Public Member Functions

void Init ()
 
void Start ()
 
void SetLocation (vec3 location)
 Sets the location of the light. More...
 
void SetColor (Render::color_t color)
 Sets the color of the light. More...
 
void SetDistance (float dist)
 Sets the distance of the light. More...
 
void SetDirection (vec3 direction)
 
void SetExponent (float exponent)
 
vec3 GetColor ()
 Returns the color of the light. More...
 
float GetDistance ()
 Returns the distance of the light. More...
 
void EventHandler (Event &event)
 
 ~LightComponent ()
 
- Public Member Functions inherited from tram::EntityComponent
 EntityComponent ()
 
virtual ~EntityComponent ()
 
bool IsReady ()
 
bool IsInit ()
 
EntityGetParent ()
 
void SetParent (Entity *parent)
 

Protected Member Functions

void Update ()
 
- Protected Member Functions inherited from tram::EntityComponent
void ResourceReady ()
 

Protected Attributes

Render::light_t light = {.generic = nullptr}
 
vec3 location = {0.0f, 0.0f, 0.0f}
 
Render::color_t color = {1.0f, 1.0f, 1.0f}
 
float distance = 15.0f
 
vec3 direction = {0.0f, 0.0f, -1.0f}
 
float exponent = 0.0f
 
- Protected Attributes inherited from tram::EntityComponent
size_t resources_waiting = 0
 
bool is_ready = false
 
bool is_init = false
 
Entityparent = nullptr
 

Constructor & Destructor Documentation

◆ ~LightComponent()

tram::LightComponent::~LightComponent ( )

Member Function Documentation

◆ EventHandler()

void tram::LightComponent::EventHandler ( Event event)
inlinevirtual

Implements tram::EntityComponent.

◆ GetColor()

Render::color_t tram::LightComponent::GetColor ( )

Returns the color of the light.

◆ GetDistance()

float tram::LightComponent::GetDistance ( )

Returns the distance of the light.

◆ Init()

void tram::LightComponent::Init ( )
virtual

Reimplemented from tram::EntityComponent.

◆ SetColor()

void tram::LightComponent::SetColor ( Render::color_t  color)

Sets the color of the light.

◆ SetDirection()

void tram::LightComponent::SetDirection ( vec3  direction)

◆ SetDistance()

void tram::LightComponent::SetDistance ( float  dist)

Sets the distance of the light.

Sets how far the light will travel.

◆ SetExponent()

void tram::LightComponent::SetExponent ( float  exponent)

◆ SetLocation()

void tram::LightComponent::SetLocation ( vec3  location)

Sets the location of the light.

◆ Start()

void tram::LightComponent::Start ( )
inlinevirtual

Implements tram::EntityComponent.

◆ Update()

void tram::LightComponent::Update ( )
protected

Member Data Documentation

◆ color

Render::color_t tram::LightComponent::color = {1.0f, 1.0f, 1.0f}
protected

◆ direction

vec3 tram::LightComponent::direction = {0.0f, 0.0f, -1.0f}
protected

◆ distance

float tram::LightComponent::distance = 15.0f
protected

◆ exponent

float tram::LightComponent::exponent = 0.0f
protected

◆ light

Render::light_t tram::LightComponent::light = {.generic = nullptr}
protected

◆ location

vec3 tram::LightComponent::location = {0.0f, 0.0f, 0.0f}
protected

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