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

#include <particle.h>

Inheritance diagram for tram::ParticleComponent:
tram::EntityComponent

Classes

struct  Particle
 

Public Member Functions

 ParticleComponent ()
 
 ~ParticleComponent ()
 
name_t GetSprite ()
 
void SetSprite (Render::Sprite *sprite)
 
void Start ()
 
void Update ()
 
void UpdateRenderListObject ()
 
void UpdateLocation (vec3 nlocation)
 
void EventHandler (Event &event)
 
void EmitParticle (const Particle &particle)
 
- Public Member Functions inherited from tram::EntityComponent
 EntityComponent ()
 
virtual ~EntityComponent ()
 
virtual void Init ()
 
bool IsReady ()
 
bool IsInit ()
 
EntityGetParent ()
 
void SetParent (Entity *parent)
 

Public Attributes

uint32_t emission_rate = 1
 
uint32_t particle_max_age = 120
 
vec3 gravity = vec3(0.0f, -0.005f, 0.0f)
 
vec3 initial_velocity = vec3(0.0f, 0.15f, 0.0f)
 
float initial_velocity_randomness = 0.1f
 

Protected Attributes

std::vector< Particleparticles
 
ResourceProxy< Render::Spritesprite
 
vec3 location
 
Render::drawlistentry_t draw_list_entry = {.generic = nullptr}
 
Render::vertexarray_t vertex_array = {.generic = nullptr}
 
- Protected Attributes inherited from tram::EntityComponent
size_t resources_waiting = 0
 
bool is_ready = false
 
bool is_init = false
 
Entityparent = nullptr
 

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ ParticleComponent()

tram::ParticleComponent::ParticleComponent ( )
inline

◆ ~ParticleComponent()

tram::ParticleComponent::~ParticleComponent ( )

Member Function Documentation

◆ EmitParticle()

void tram::ParticleComponent::EmitParticle ( const Particle particle)

◆ EventHandler()

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

Implements tram::EntityComponent.

◆ GetSprite()

name_t tram::ParticleComponent::GetSprite ( )
inline

◆ SetSprite()

void tram::ParticleComponent::SetSprite ( Render::Sprite sprite)
inline

◆ Start()

void tram::ParticleComponent::Start ( )
virtual

Implements tram::EntityComponent.

◆ Update()

void tram::ParticleComponent::Update ( )

◆ UpdateLocation()

void tram::ParticleComponent::UpdateLocation ( vec3  nlocation)
inline

◆ UpdateRenderListObject()

void tram::ParticleComponent::UpdateRenderListObject ( )

Member Data Documentation

◆ draw_list_entry

Render::drawlistentry_t tram::ParticleComponent::draw_list_entry = {.generic = nullptr}
protected

◆ emission_rate

uint32_t tram::ParticleComponent::emission_rate = 1

◆ gravity

vec3 tram::ParticleComponent::gravity = vec3(0.0f, -0.005f, 0.0f)

◆ initial_velocity

vec3 tram::ParticleComponent::initial_velocity = vec3(0.0f, 0.15f, 0.0f)

◆ initial_velocity_randomness

float tram::ParticleComponent::initial_velocity_randomness = 0.1f

◆ location

vec3 tram::ParticleComponent::location
protected

◆ particle_max_age

uint32_t tram::ParticleComponent::particle_max_age = 120

◆ particles

std::vector<Particle> tram::ParticleComponent::particles
protected

◆ sprite

ResourceProxy<Render::Sprite> tram::ParticleComponent::sprite
protected

◆ vertex_array

Render::vertexarray_t tram::ParticleComponent::vertex_array = {.generic = nullptr}
protected

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