Unravel Engine C++ Reference
Loading...
Searching...
No Matches
unravel::particle_emitter_component Class Reference

Component that wraps particle system emitter functionality. More...

#include <particle_emitter_component.h>

Inheritance diagram for unravel::particle_emitter_component:
unravel::component_crtp< particle_emitter_component, owned_component > unravel::owned_component unravel::basic_component

Public Member Functions

void set_enabled (bool enabled)
 Sets whether the emitter is enabled.
 
auto is_enabled () const -> bool
 Checks if the emitter is enabled.
 
auto get_emitter_handle () const -> EmitterHandle
 Gets the emitter handle.
 
void set_shape (EmitterShape::Enum shape)
 Sets the emitter shape.
 
auto get_shape () const -> EmitterShape::Enum
 Gets the emitter shape.
 
void set_direction (EmitterDirection::Enum direction)
 Sets the emitter direction.
 
auto get_direction () const -> EmitterDirection::Enum
 Gets the emitter direction.
 
void set_max_particles (uint32_t max_particles)
 Sets the maximum number of particles.
 
auto get_max_particles () const -> uint32_t
 Gets the maximum number of particles.
 
void set_emission_lifetime (std::chrono::duration< float > lifetime)
 
auto get_emission_lifetime () const -> std::chrono::duration< float >
 
void set_gravity_scale (float scale)
 
auto get_gravity_scale () const -> float
 
void set_emission_rate (float emission_rate)
 
auto get_emission_rate () const -> float
 
void set_temporal_motion (float temporal_motion)
 
auto get_temporal_motion () const -> float
 
void set_velocity_damping (float velocity_damping)
 
auto get_velocity_damping () const -> float
 
void set_force_over_lifetime (const math::vec3 &force)
 
auto get_force_over_lifetime () const -> math::vec3
 
void set_emission_shape_scale (const math::vec3 &scale)
 
auto get_emission_shape_scale () const -> math::vec3
 
void set_size_by_speed_range (const frange_t &size_range)
 
auto get_size_by_speed_range () const -> const frange_t &
 
void set_size_by_speed_velocity_range (const frange_t &velocity_range)
 
auto get_size_by_speed_velocity_range () const -> const frange_t &
 
void set_color_by_speed_gradient (const math::gradient< math::color > &gradient)
 
auto get_color_by_speed_gradient () const -> const math::gradient< math::color > &
 
void set_color_by_speed_velocity_range (const frange_t &velocity_range)
 
auto get_color_by_speed_velocity_range () const -> const frange_t &
 
void set_lifetime_by_emitter_speed_gradient (const math::gradient< float > &gradient)
 
auto get_lifetime_by_emitter_speed_gradient () const -> const math::gradient< float > &
 
void set_lifetime_by_emitter_speed_range (const frange_t &speed_range)
 
auto get_lifetime_by_emitter_speed_range () const -> const frange_t &
 
void set_lifetime (std::chrono::duration< float > lifetime)
 
auto get_lifetime () const -> std::chrono::duration< float >
 
void set_velocity_gradient (const math::gradient< frange_t > &gradient)
 
auto get_velocity_gradient () const -> const math::gradient< frange_t > &
 
void set_scale_gradient (const math::gradient< frange_t > &gradient)
 
auto get_scale_gradient () const -> const math::gradient< frange_t > &
 
void set_blend_gradient (const math::gradient< frange_t > &gradient)
 
auto get_blend_gradient () const -> const math::gradient< frange_t > &
 
void set_blend_multiplier (float multiplier)
 
auto get_blend_multiplier () const -> float
 
void play ()
 
void stop ()
 
void stop_and_reset ()
 
void pause ()
 
void resume ()
 
auto is_playing () const -> bool
 
auto is_paused () const -> bool
 
void set_loop (bool loop)
 
auto is_loop () const -> bool
 
void set_color_gradient (const math::gradient< math::color > &gradient)
 
auto get_color_gradient () const -> const math::gradient< math::color > &
 
void set_position_easing (bx::Easing::Enum easing)
 
auto get_position_easing () const -> bx::Easing::Enum
 
void set_simulation_space (SimulationSpace::Enum space)
 
auto get_simulation_space () const -> SimulationSpace::Enum
 
auto get_num_particles () const -> uint32_t
 
auto get_world_bounds () const -> math::bbox
 
auto get_updated_world_bounds (const math::transform &world_transform) const -> math::bbox
 
void set_texture (const asset_handle< gfx::texture > &texture)
 
auto get_texture () const -> const asset_handle< gfx::texture > &
 
void update_emitter (const math::transform &world_transform, delta_t dt)
 Updates the emitter with external transform data.
 
auto get_uniforms () const -> const EmitterUniforms &
 Gets the emitter uniforms for direct access.
 
void recreate_emitter ()
 Recreates the emitter with current shape and direction.
 
void reset_emitter ()
 Resets the emitter, clearing all particles and resetting internal state.
 
- Public Member Functions inherited from unravel::owned_component
auto operator= (const owned_component &other) -> owned_component &=default
 
void set_owner (entt::handle owner)
 Sets the owner of the component.
 
auto get_owner () const noexcept -> entt::const_handle
 Gets the owner of the component.
 
auto get_owner () noexcept -> entt::handle
 Gets the owner of the component.
 
- Public Member Functions inherited from unravel::basic_component
void touch ()
 Marks the component as 'touched'.
 

Static Public Member Functions

static void on_create_component (entt::registry &r, entt::entity e)
 Called when the component is created.
 
static void on_destroy_component (entt::registry &r, entt::entity e)
 Called when the component is destroyed.
 
- Static Public Member Functions inherited from unravel::owned_component
template<typename T >
static void on_create_component (entt::registry &r, entt::entity e)
 
template<typename T >
static void on_destroy_component (entt::registry &r, entt::entity e)
 

Additional Inherited Members

- Public Types inherited from unravel::component_crtp< particle_emitter_component, owned_component >
using base
 
- Public Attributes inherited from unravel::basic_component
bool eto {}
 Disable empty type optimizations.
 
- Static Public Attributes inherited from unravel::component_crtp< particle_emitter_component, owned_component >
static constexpr bool in_place_delete
 Indicates if the component can be deleted in place.
 

Detailed Description

Component that wraps particle system emitter functionality.

Definition at line 21 of file particle_emitter_component.h.

Member Function Documentation

◆ get_blend_gradient()

auto unravel::particle_emitter_component::get_blend_gradient ( ) const -> const math::gradient<frange_t>&

Definition at line 281 of file particle_emitter_component.cpp.

◆ get_blend_multiplier()

auto unravel::particle_emitter_component::get_blend_multiplier ( ) const -> float

Definition at line 291 of file particle_emitter_component.cpp.

◆ get_color_by_speed_gradient()

auto unravel::particle_emitter_component::get_color_by_speed_gradient ( ) const -> const math::gradient<math::color>&

Definition at line 206 of file particle_emitter_component.cpp.

◆ get_color_by_speed_velocity_range()

auto unravel::particle_emitter_component::get_color_by_speed_velocity_range ( ) const -> const frange_t&

Definition at line 216 of file particle_emitter_component.cpp.

◆ get_color_gradient()

auto unravel::particle_emitter_component::get_color_gradient ( ) const -> const math::gradient<math::color>&

Definition at line 358 of file particle_emitter_component.cpp.

◆ get_direction()

auto unravel::particle_emitter_component::get_direction ( ) const -> EmitterDirection::Enum

Gets the emitter direction.

Returns
The emitter direction.

Definition at line 88 of file particle_emitter_component.cpp.

◆ get_emission_lifetime()

auto unravel::particle_emitter_component::get_emission_lifetime ( ) const -> std::chrono::duration<float>

Definition at line 113 of file particle_emitter_component.cpp.

◆ get_emission_rate()

auto unravel::particle_emitter_component::get_emission_rate ( ) const -> float

Definition at line 135 of file particle_emitter_component.cpp.

◆ get_emission_shape_scale()

auto unravel::particle_emitter_component::get_emission_shape_scale ( ) const -> math::vec3

Definition at line 175 of file particle_emitter_component.cpp.

◆ get_emitter_handle()

auto unravel::particle_emitter_component::get_emitter_handle ( ) const -> EmitterHandle

Gets the emitter handle.

Returns
The emitter handle.

Definition at line 60 of file particle_emitter_component.cpp.

◆ get_force_over_lifetime()

auto unravel::particle_emitter_component::get_force_over_lifetime ( ) const -> math::vec3

Definition at line 165 of file particle_emitter_component.cpp.

◆ get_gravity_scale()

auto unravel::particle_emitter_component::get_gravity_scale ( ) const -> float

Definition at line 123 of file particle_emitter_component.cpp.

◆ get_lifetime()

auto unravel::particle_emitter_component::get_lifetime ( ) const -> std::chrono::duration<float>

Definition at line 248 of file particle_emitter_component.cpp.

◆ get_lifetime_by_emitter_speed_gradient()

auto unravel::particle_emitter_component::get_lifetime_by_emitter_speed_gradient ( ) const -> const math::gradient<float>&

Definition at line 227 of file particle_emitter_component.cpp.

◆ get_lifetime_by_emitter_speed_range()

auto unravel::particle_emitter_component::get_lifetime_by_emitter_speed_range ( ) const -> const frange_t&

Definition at line 237 of file particle_emitter_component.cpp.

◆ get_max_particles()

auto unravel::particle_emitter_component::get_max_particles ( ) const -> uint32_t

Gets the maximum number of particles.

Returns
Maximum particles count.

Definition at line 102 of file particle_emitter_component.cpp.

◆ get_num_particles()

auto unravel::particle_emitter_component::get_num_particles ( ) const -> uint32_t

Definition at line 375 of file particle_emitter_component.cpp.

◆ get_position_easing()

auto unravel::particle_emitter_component::get_position_easing ( ) const -> bx::Easing::Enum

Definition at line 368 of file particle_emitter_component.cpp.

◆ get_scale_gradient()

auto unravel::particle_emitter_component::get_scale_gradient ( ) const -> const math::gradient<frange_t>&

Definition at line 270 of file particle_emitter_component.cpp.

◆ get_shape()

auto unravel::particle_emitter_component::get_shape ( ) const -> EmitterShape::Enum

Gets the emitter shape.

Returns
The emitter shape.

Definition at line 74 of file particle_emitter_component.cpp.

◆ get_simulation_space()

auto unravel::particle_emitter_component::get_simulation_space ( ) const -> SimulationSpace::Enum

Definition at line 475 of file particle_emitter_component.cpp.

◆ get_size_by_speed_range()

auto unravel::particle_emitter_component::get_size_by_speed_range ( ) const -> const frange_t&

Definition at line 185 of file particle_emitter_component.cpp.

◆ get_size_by_speed_velocity_range()

auto unravel::particle_emitter_component::get_size_by_speed_velocity_range ( ) const -> const frange_t&

Definition at line 195 of file particle_emitter_component.cpp.

◆ get_temporal_motion()

auto unravel::particle_emitter_component::get_temporal_motion ( ) const -> float

Definition at line 145 of file particle_emitter_component.cpp.

◆ get_texture()

auto unravel::particle_emitter_component::get_texture ( ) const -> const asset_handle<gfx::texture>&

Definition at line 402 of file particle_emitter_component.cpp.

◆ get_uniforms()

auto unravel::particle_emitter_component::get_uniforms ( ) const -> const EmitterUniforms&

Gets the emitter uniforms for direct access.

Returns
Reference to the emitter uniforms.

Definition at line 436 of file particle_emitter_component.cpp.

◆ get_updated_world_bounds()

auto unravel::particle_emitter_component::get_updated_world_bounds ( const math::transform & world_transform) const -> math::bbox

Definition at line 387 of file particle_emitter_component.cpp.

◆ get_velocity_damping()

auto unravel::particle_emitter_component::get_velocity_damping ( ) const -> float

Definition at line 155 of file particle_emitter_component.cpp.

◆ get_velocity_gradient()

auto unravel::particle_emitter_component::get_velocity_gradient ( ) const -> const math::gradient<frange_t>&

Definition at line 259 of file particle_emitter_component.cpp.

◆ get_world_bounds()

auto unravel::particle_emitter_component::get_world_bounds ( ) const -> math::bbox

Definition at line 380 of file particle_emitter_component.cpp.

◆ is_enabled()

auto unravel::particle_emitter_component::is_enabled ( ) const -> bool

Checks if the emitter is enabled.

Returns
True if enabled, false otherwise.

Definition at line 55 of file particle_emitter_component.cpp.

◆ is_loop()

auto unravel::particle_emitter_component::is_loop ( ) const -> bool

Definition at line 347 of file particle_emitter_component.cpp.

◆ is_paused()

auto unravel::particle_emitter_component::is_paused ( ) const -> bool

Definition at line 337 of file particle_emitter_component.cpp.

◆ is_playing()

auto unravel::particle_emitter_component::is_playing ( ) const -> bool

Definition at line 332 of file particle_emitter_component.cpp.

◆ on_create_component()

void unravel::particle_emitter_component::on_create_component ( entt::registry & r,
entt::entity e )
static

Called when the component is created.

Parameters
rThe registry containing the component.
eThe entity associated with the component.

Definition at line 22 of file particle_emitter_component.cpp.

◆ on_destroy_component()

void unravel::particle_emitter_component::on_destroy_component ( entt::registry & r,
entt::entity e )
static

Called when the component is destroyed.

Parameters
rThe registry containing the component.
eThe entity associated with the component.

Definition at line 34 of file particle_emitter_component.cpp.

◆ pause()

void unravel::particle_emitter_component::pause ( )

Definition at line 316 of file particle_emitter_component.cpp.

◆ play()

void unravel::particle_emitter_component::play ( )

Definition at line 296 of file particle_emitter_component.cpp.

◆ recreate_emitter()

void unravel::particle_emitter_component::recreate_emitter ( )

Recreates the emitter with current shape and direction.

Definition at line 441 of file particle_emitter_component.cpp.

◆ reset_emitter()

void unravel::particle_emitter_component::reset_emitter ( )

Resets the emitter, clearing all particles and resetting internal state.

Definition at line 461 of file particle_emitter_component.cpp.

◆ resume()

void unravel::particle_emitter_component::resume ( )

Definition at line 324 of file particle_emitter_component.cpp.

◆ set_blend_gradient()

void unravel::particle_emitter_component::set_blend_gradient ( const math::gradient< frange_t > & gradient)

Definition at line 275 of file particle_emitter_component.cpp.

◆ set_blend_multiplier()

void unravel::particle_emitter_component::set_blend_multiplier ( float multiplier)

Definition at line 286 of file particle_emitter_component.cpp.

◆ set_color_by_speed_gradient()

void unravel::particle_emitter_component::set_color_by_speed_gradient ( const math::gradient< math::color > & gradient)

Definition at line 200 of file particle_emitter_component.cpp.

◆ set_color_by_speed_velocity_range()

void unravel::particle_emitter_component::set_color_by_speed_velocity_range ( const frange_t & velocity_range)

Definition at line 211 of file particle_emitter_component.cpp.

◆ set_color_gradient()

void unravel::particle_emitter_component::set_color_gradient ( const math::gradient< math::color > & gradient)

Definition at line 352 of file particle_emitter_component.cpp.

◆ set_direction()

void unravel::particle_emitter_component::set_direction ( EmitterDirection::Enum direction)

Sets the emitter direction.

Parameters
directionThe emitter direction.

Definition at line 79 of file particle_emitter_component.cpp.

◆ set_emission_lifetime()

void unravel::particle_emitter_component::set_emission_lifetime ( std::chrono::duration< float > lifetime)

Definition at line 108 of file particle_emitter_component.cpp.

◆ set_emission_rate()

void unravel::particle_emitter_component::set_emission_rate ( float emission_rate)

Definition at line 128 of file particle_emitter_component.cpp.

◆ set_emission_shape_scale()

void unravel::particle_emitter_component::set_emission_shape_scale ( const math::vec3 & scale)

Definition at line 170 of file particle_emitter_component.cpp.

◆ set_enabled()

void unravel::particle_emitter_component::set_enabled ( bool enabled)

Sets whether the emitter is enabled.

Parameters
enabledTrue if enabled, false otherwise.

Definition at line 50 of file particle_emitter_component.cpp.

◆ set_force_over_lifetime()

void unravel::particle_emitter_component::set_force_over_lifetime ( const math::vec3 & force)

Definition at line 160 of file particle_emitter_component.cpp.

◆ set_gravity_scale()

void unravel::particle_emitter_component::set_gravity_scale ( float scale)

Definition at line 118 of file particle_emitter_component.cpp.

◆ set_lifetime()

void unravel::particle_emitter_component::set_lifetime ( std::chrono::duration< float > lifetime)

Definition at line 242 of file particle_emitter_component.cpp.

◆ set_lifetime_by_emitter_speed_gradient()

void unravel::particle_emitter_component::set_lifetime_by_emitter_speed_gradient ( const math::gradient< float > & gradient)

Definition at line 221 of file particle_emitter_component.cpp.

◆ set_lifetime_by_emitter_speed_range()

void unravel::particle_emitter_component::set_lifetime_by_emitter_speed_range ( const frange_t & speed_range)

Definition at line 232 of file particle_emitter_component.cpp.

◆ set_loop()

void unravel::particle_emitter_component::set_loop ( bool loop)

Definition at line 342 of file particle_emitter_component.cpp.

◆ set_max_particles()

void unravel::particle_emitter_component::set_max_particles ( uint32_t max_particles)

Sets the maximum number of particles.

Parameters
max_particlesMaximum particles count.

Definition at line 93 of file particle_emitter_component.cpp.

◆ set_position_easing()

void unravel::particle_emitter_component::set_position_easing ( bx::Easing::Enum easing)

Definition at line 363 of file particle_emitter_component.cpp.

◆ set_scale_gradient()

void unravel::particle_emitter_component::set_scale_gradient ( const math::gradient< frange_t > & gradient)

Definition at line 264 of file particle_emitter_component.cpp.

◆ set_shape()

void unravel::particle_emitter_component::set_shape ( EmitterShape::Enum shape)

Sets the emitter shape.

Parameters
shapeThe emitter shape.

Definition at line 65 of file particle_emitter_component.cpp.

◆ set_simulation_space()

void unravel::particle_emitter_component::set_simulation_space ( SimulationSpace::Enum space)

Definition at line 469 of file particle_emitter_component.cpp.

◆ set_size_by_speed_range()

void unravel::particle_emitter_component::set_size_by_speed_range ( const frange_t & size_range)

Definition at line 180 of file particle_emitter_component.cpp.

◆ set_size_by_speed_velocity_range()

void unravel::particle_emitter_component::set_size_by_speed_velocity_range ( const frange_t & velocity_range)

Definition at line 190 of file particle_emitter_component.cpp.

◆ set_temporal_motion()

void unravel::particle_emitter_component::set_temporal_motion ( float temporal_motion)

Definition at line 140 of file particle_emitter_component.cpp.

◆ set_texture()

void unravel::particle_emitter_component::set_texture ( const asset_handle< gfx::texture > & texture)

Definition at line 397 of file particle_emitter_component.cpp.

◆ set_velocity_damping()

void unravel::particle_emitter_component::set_velocity_damping ( float velocity_damping)

Definition at line 150 of file particle_emitter_component.cpp.

◆ set_velocity_gradient()

void unravel::particle_emitter_component::set_velocity_gradient ( const math::gradient< frange_t > & gradient)

Definition at line 253 of file particle_emitter_component.cpp.

◆ stop()

void unravel::particle_emitter_component::stop ( )

Definition at line 302 of file particle_emitter_component.cpp.

◆ stop_and_reset()

void unravel::particle_emitter_component::stop_and_reset ( )

Definition at line 308 of file particle_emitter_component.cpp.

◆ update_emitter()

void unravel::particle_emitter_component::update_emitter ( const math::transform & world_transform,
delta_t dt )

Updates the emitter with external transform data.

Parameters
world_transformThe world transform to apply to the emitter.

Definition at line 412 of file particle_emitter_component.cpp.


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