Unravel Engine C++ Reference
Loading...
Searching...
No Matches
ps::Emitter Struct Reference

Public Member Functions

void create (EmitterShape::Enum _shape, EmitterDirection::Enum _direction, uint32_t _maxParticles)
 
void destroy ()
 
void reset ()
 
void update_temporal_buffer (const math::vec3 &position, float dt)
 
float calculate_smoothed_emitter_speed (float max_speed) const
 
float calculateParticleSpeed (const Particle &particle, float ttPos) const
 
void calculateRotatedAABBBounds (const math::quat &rotation, const math::vec3 &half_extents, const math::vec2 &pivot, math::vec3 &out_min, math::vec3 &out_max) const
 
void updateParticleProperties (EmitterUniforms &uniforms_, Particle &particle, float avgSystemScale, bx::EaseFn easePos, bool hasColorBySpeed, bool hasSizeBySpeed, const math::mat4 &effectiveTransform)
 
void update (EmitterUniforms *_uniforms, float _dt)
 
void getEffectiveTransform (const EmitterUniforms &uniforms_, math::vec3 &outPosition, math::vec3 &outScale, math::vec3 &outEmissionShapeScale, math::mat4 &outTransformMatrix) const
 
void spawn (EmitterUniforms &uniforms_, math::bbox &aabb, float _dt)
 

Public Attributes

EmitterShape::Enum shape_
 
EmitterDirection::Enum direction_
 
float dt_
 
bx::RngMwc rng_
 
math::bbox aabb_
 
Particleparticles_
 
uint32_t num_particles_
 
uint32_t max_particles_
 
uint32_t total_particles_spawned_
 
bool playing_
 
bool loop_
 
float start_delay_elapsed_
 
bool first_update_
 
std::vector< math::vec3 > temporal_position_buffer_
 
std::vector< float > temporal_time_buffer_
 
TextureMode::Enum texture_mode_
 
RenderMode::Enum render_mode_
 
BlendMode::Enum blend_mode_
 
math::vec3 billboard_right_
 
math::vec3 billboard_up_
 
math::vec3 particle_scale_3d_
 
math::vec2 pivot_
 

Static Public Attributes

static constexpr size_t TEMPORAL_BUFFER_SIZE = 8
 

Detailed Description

Definition at line 183 of file particle_system.cpp.

Member Function Documentation

◆ calculate_smoothed_emitter_speed()

float ps::Emitter::calculate_smoothed_emitter_speed ( float max_speed) const
inline

Definition at line 231 of file particle_system.cpp.

◆ calculateParticleSpeed()

float ps::Emitter::calculateParticleSpeed ( const Particle & particle,
float ttPos ) const
inline

Definition at line 260 of file particle_system.cpp.

◆ calculateRotatedAABBBounds()

void ps::Emitter::calculateRotatedAABBBounds ( const math::quat & rotation,
const math::vec3 & half_extents,
const math::vec2 & pivot,
math::vec3 & out_min,
math::vec3 & out_max ) const
inline

Definition at line 277 of file particle_system.cpp.

◆ create()

void ps::Emitter::create ( EmitterShape::Enum _shape,
EmitterDirection::Enum _direction,
uint32_t _maxParticles )

Definition at line 1538 of file particle_system.cpp.

◆ destroy()

void ps::Emitter::destroy ( )

Definition at line 1548 of file particle_system.cpp.

◆ getEffectiveTransform()

void ps::Emitter::getEffectiveTransform ( const EmitterUniforms & uniforms_,
math::vec3 & outPosition,
math::vec3 & outScale,
math::vec3 & outEmissionShapeScale,
math::mat4 & outTransformMatrix ) const
inline

Definition at line 621 of file particle_system.cpp.

◆ reset()

void ps::Emitter::reset ( )
inline

Definition at line 188 of file particle_system.cpp.

◆ spawn()

void ps::Emitter::spawn ( EmitterUniforms & uniforms_,
math::bbox & aabb,
float _dt )
inline

Definition at line 634 of file particle_system.cpp.

◆ update()

void ps::Emitter::update ( EmitterUniforms * _uniforms,
float _dt )
inline

Definition at line 469 of file particle_system.cpp.

◆ update_temporal_buffer()

void ps::Emitter::update_temporal_buffer ( const math::vec3 & position,
float dt )
inline

Definition at line 217 of file particle_system.cpp.

◆ updateParticleProperties()

void ps::Emitter::updateParticleProperties ( EmitterUniforms & uniforms_,
Particle & particle,
float avgSystemScale,
bx::EaseFn easePos,
bool hasColorBySpeed,
bool hasSizeBySpeed,
const math::mat4 & effectiveTransform )
inline

Definition at line 323 of file particle_system.cpp.

Member Data Documentation

◆ aabb_

math::bbox ps::Emitter::aabb_

Definition at line 987 of file particle_system.cpp.

◆ billboard_right_

math::vec3 ps::Emitter::billboard_right_

Definition at line 1014 of file particle_system.cpp.

◆ billboard_up_

math::vec3 ps::Emitter::billboard_up_

Definition at line 1015 of file particle_system.cpp.

◆ blend_mode_

BlendMode::Enum ps::Emitter::blend_mode_

Definition at line 1011 of file particle_system.cpp.

◆ direction_

EmitterDirection::Enum ps::Emitter::direction_

Definition at line 982 of file particle_system.cpp.

◆ dt_

float ps::Emitter::dt_

Definition at line 984 of file particle_system.cpp.

◆ first_update_

bool ps::Emitter::first_update_

Definition at line 998 of file particle_system.cpp.

◆ loop_

bool ps::Emitter::loop_

Definition at line 995 of file particle_system.cpp.

◆ max_particles_

uint32_t ps::Emitter::max_particles_

Definition at line 991 of file particle_system.cpp.

◆ num_particles_

uint32_t ps::Emitter::num_particles_

Definition at line 990 of file particle_system.cpp.

◆ particle_scale_3d_

math::vec3 ps::Emitter::particle_scale_3d_

Definition at line 1018 of file particle_system.cpp.

◆ particles_

Particle* ps::Emitter::particles_

Definition at line 989 of file particle_system.cpp.

◆ pivot_

math::vec2 ps::Emitter::pivot_

Definition at line 1021 of file particle_system.cpp.

◆ playing_

bool ps::Emitter::playing_

Definition at line 994 of file particle_system.cpp.

◆ render_mode_

RenderMode::Enum ps::Emitter::render_mode_

Definition at line 1008 of file particle_system.cpp.

◆ rng_

bx::RngMwc ps::Emitter::rng_

Definition at line 985 of file particle_system.cpp.

◆ shape_

EmitterShape::Enum ps::Emitter::shape_

Definition at line 981 of file particle_system.cpp.

◆ start_delay_elapsed_

float ps::Emitter::start_delay_elapsed_

Definition at line 996 of file particle_system.cpp.

◆ TEMPORAL_BUFFER_SIZE

size_t ps::Emitter::TEMPORAL_BUFFER_SIZE = 8
staticconstexpr

Definition at line 215 of file particle_system.cpp.

◆ temporal_position_buffer_

std::vector<math::vec3> ps::Emitter::temporal_position_buffer_

Definition at line 1001 of file particle_system.cpp.

◆ temporal_time_buffer_

std::vector<float> ps::Emitter::temporal_time_buffer_

Definition at line 1002 of file particle_system.cpp.

◆ texture_mode_

TextureMode::Enum ps::Emitter::texture_mode_

Definition at line 1005 of file particle_system.cpp.

◆ total_particles_spawned_

uint32_t ps::Emitter::total_particles_spawned_

Definition at line 992 of file particle_system.cpp.


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