VEX Engine
Retro looking game engine made in vulkan mostly because i wanted to understand it better.
Loading...
Searching...
No Matches
vex::ParticleEmitterComponent Struct Reference

Component that emits and manages a system of particles. More...

#include <ParticleEmitterComponent.hpp>

Public Attributes

vex::texture_asset_path texturePath
 Path to the texture applied to particles.
bool isTransparent = true
 Indicates if the particles should be rendered in the transparent pass.
bool isUnlit = true
 Indicates if the particles should ignore lighting.
bool active = true
 Indicates if the emitter is active and emitting particles.
float spawnRate = 0.1f
 Time in seconds between particle spawns.
float spawnTimer = 0.0f
 Internal timer to track time since last spawn.
glm::vec3 gravity = glm::vec3(0.0f, -9.81f, 0.0f)
 Gravity applied to particles.
glm::vec3 initialVelocity = glm::vec3(0.0f, 5.0f, 0.0f)
 Base starting velocity for new particles.
glm::vec3 velocityVariation = glm::vec3(2.0f, 2.0f, 2.0f)
 Random variation range applied to initial velocity.
float particleLife = 3.0f
 Base lifetime for new particles.
float particleLifeVariation = 0.5f
 Random variation range applied to lifetime.
float startSize = 1.0f
 Base size for new particles.
float endSize = 0.0f
 Size of particles at the end of their life.
vex::rgba startColor = vex::rgba(1.0f, 1.0f, 1.0f, 1.0f)
 Color of particles at spawn.
vex::rgba endColor = vex::rgba(1.0f, 1.0f, 1.0f, 0.0f)
 Color of particles at the end of their life.
std::vector< ParticlecpuParticles
 Internal list of active CPU particles.
std::vector< ParticleGPUDataactiveParticles
 GPU data buffer built every frame for rendering.

Detailed Description

Component that emits and manages a system of particles.

Definition at line 42 of file ParticleEmitterComponent.hpp.

Member Data Documentation

◆ active

bool vex::ParticleEmitterComponent::active = true

Indicates if the emitter is active and emitting particles.

Definition at line 46 of file ParticleEmitterComponent.hpp.

◆ activeParticles

std::vector<ParticleGPUData> vex::ParticleEmitterComponent::activeParticles

GPU data buffer built every frame for rendering.

Definition at line 59 of file ParticleEmitterComponent.hpp.

◆ cpuParticles

std::vector<Particle> vex::ParticleEmitterComponent::cpuParticles

Internal list of active CPU particles.

Definition at line 58 of file ParticleEmitterComponent.hpp.

◆ endColor

vex::rgba vex::ParticleEmitterComponent::endColor = vex::rgba(1.0f, 1.0f, 1.0f, 0.0f)

Color of particles at the end of their life.

Definition at line 57 of file ParticleEmitterComponent.hpp.

◆ endSize

float vex::ParticleEmitterComponent::endSize = 0.0f

Size of particles at the end of their life.

Definition at line 55 of file ParticleEmitterComponent.hpp.

◆ gravity

glm::vec3 vex::ParticleEmitterComponent::gravity = glm::vec3(0.0f, -9.81f, 0.0f)

Gravity applied to particles.

Definition at line 49 of file ParticleEmitterComponent.hpp.

◆ initialVelocity

glm::vec3 vex::ParticleEmitterComponent::initialVelocity = glm::vec3(0.0f, 5.0f, 0.0f)

Base starting velocity for new particles.

Definition at line 50 of file ParticleEmitterComponent.hpp.

◆ isTransparent

bool vex::ParticleEmitterComponent::isTransparent = true

Indicates if the particles should be rendered in the transparent pass.

Definition at line 44 of file ParticleEmitterComponent.hpp.

◆ isUnlit

bool vex::ParticleEmitterComponent::isUnlit = true

Indicates if the particles should ignore lighting.

Definition at line 45 of file ParticleEmitterComponent.hpp.

◆ particleLife

float vex::ParticleEmitterComponent::particleLife = 3.0f

Base lifetime for new particles.

Definition at line 52 of file ParticleEmitterComponent.hpp.

◆ particleLifeVariation

float vex::ParticleEmitterComponent::particleLifeVariation = 0.5f

Random variation range applied to lifetime.

Definition at line 53 of file ParticleEmitterComponent.hpp.

◆ spawnRate

float vex::ParticleEmitterComponent::spawnRate = 0.1f

Time in seconds between particle spawns.

Definition at line 47 of file ParticleEmitterComponent.hpp.

◆ spawnTimer

float vex::ParticleEmitterComponent::spawnTimer = 0.0f

Internal timer to track time since last spawn.

Definition at line 48 of file ParticleEmitterComponent.hpp.

◆ startColor

vex::rgba vex::ParticleEmitterComponent::startColor = vex::rgba(1.0f, 1.0f, 1.0f, 1.0f)

Color of particles at spawn.

Definition at line 56 of file ParticleEmitterComponent.hpp.

◆ startSize

float vex::ParticleEmitterComponent::startSize = 1.0f

Base size for new particles.

Definition at line 54 of file ParticleEmitterComponent.hpp.

◆ texturePath

vex::texture_asset_path vex::ParticleEmitterComponent::texturePath

Path to the texture applied to particles.

Definition at line 43 of file ParticleEmitterComponent.hpp.

◆ velocityVariation

glm::vec3 vex::ParticleEmitterComponent::velocityVariation = glm::vec3(2.0f, 2.0f, 2.0f)

Random variation range applied to initial velocity.

Definition at line 51 of file ParticleEmitterComponent.hpp.


The documentation for this struct was generated from the following file: