Luanti 5.10.0-dev
 
Loading...
Searching...
No Matches
ParticleSpawner Class Reference

#include <particles.h>

+ Collaboration diagram for ParticleSpawner:

Public Member Functions

 ParticleSpawner (LocalPlayer *player, const ParticleSpawnerParameters &params, u16 attached_id, std::vector< ClientParticleTexture > &&texpool, ParticleManager *p_manager)
 
void step (float dtime, ClientEnvironment *env)
 
bool getExpired () const
 
bool hasActive () const
 
void decrActive ()
 

Private Member Functions

void spawnParticle (ClientEnvironment *env, float radius, const core::matrix4 *attached_absolute_pos_rot_matrix)
 

Private Attributes

size_t m_active
 
ParticleManagerm_particlemanager
 
float m_time
 
LocalPlayerm_player
 
ParticleSpawnerParameters p
 
std::vector< ClientParticleTexturem_texpool
 
std::vector< float > m_spawntimes
 
u16 m_attached_id
 

Constructor & Destructor Documentation

◆ ParticleSpawner()

ParticleSpawner::ParticleSpawner ( LocalPlayer * player,
const ParticleSpawnerParameters & params,
u16 attached_id,
std::vector< ClientParticleTexture > && texpool,
ParticleManager * p_manager )

References ParticleSpawnerParameters::amount, ParticleParamTypes::TweenedParameter< T >::end, ParticleSpawnerParameters::exptime, m_spawntimes, myrand_float(), p, ParticleManager::reserveParticleSpace(), ParticleParamTypes::TweenedParameter< T >::start, and ParticleSpawnerParameters::time.

+ Here is the call graph for this function:

Member Function Documentation

◆ decrActive()

void ParticleSpawner::decrActive ( )
inline

References m_active.

Referenced by ParticleManager::stepParticles().

+ Here is the caller graph for this function:

◆ getExpired()

bool ParticleSpawner::getExpired ( ) const
inline

◆ hasActive()

bool ParticleSpawner::hasActive ( ) const
inline

References m_active.

Referenced by ParticleManager::stepParticles().

+ Here is the caller graph for this function:

◆ spawnParticle()

void ParticleSpawner::spawnParticle ( ClientEnvironment * env,
float radius,
const core::matrix4 * attached_absolute_pos_rot_matrix )
private

References ParticleParameters::acc, ParticleSpawnerParameters::acc, ParticleManager::addParticle(), ParticleTexture::animated, CommonParticleParams::animation, ParticleTexture::animation, ParticleSpawnerParameters::attract, ParticleSpawnerParameters::attractor_attachment, ParticleSpawnerParameters::attractor_direction, ParticleSpawnerParameters::attractor_direction_attachment, ParticleSpawnerParameters::attractor_kill, ParticleSpawnerParameters::attractor_kind, ParticleSpawnerParameters::attractor_origin, ParticleParamTypes::TweenedParameter< T >::blend(), ParticleParameters::bounce, ParticleSpawnerParameters::bounce, BS, CONTENT_IGNORE, CommonParticleParams::copyCommon(), dir(), ParticleParameters::drag, ParticleSpawnerParameters::drag, ParticleParamTypes::TweenedParameter< T >::end, ParticleParameters::expirationtime, ParticleSpawnerParameters::exptime, TileAnimationParams::frame_length, TileAnimationParams::frames_w, NodeDefManager::get(), ClientEnvironment::getCameraOffset(), MapNode::getContent(), ClientEnvironment::getGameDef(), ParticleManager::getNodeParticleParams(), LocalPlayer::getPosition(), ParticleParameters::jitter, ParticleSpawnerParameters::jitter, TileAnimationParams::length, ParticleParamTypes::line, m_active, ParticleManager::m_env, m_particlemanager, m_player, m_texpool, m_time, myrand_range(), IGameDef::ndef(), CommonParticleParams::node, CommonParticleParams::node_tile, ParticleParamTypes::none, numericAbsolute(), numericSign(), p, ParticleParamTypes::plane, ParticleParamTypes::point, ParticleParameters::pos, ParticleSpawnerParameters::pos, ParticleSpawnerParameters::radius, ClientParticleTexRef::ref, TileAnimationParams::sheet_2d, ParticleParameters::size, ParticleSpawnerParameters::size, ParticleParamTypes::TweenedParameter< T >::start, TAT_NONE, TAT_SHEET_2D, TAT_VERTICAL_FRAMES, ClientParticleTexRef::tex, ParticleSpawnerParameters::time, TileAnimationParams::type, ParticleParameters::vel, ParticleSpawnerParameters::vel, and TileAnimationParams::vertical_frames.

Referenced by step().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ step()

void ParticleSpawner::step ( float dtime,
ClientEnvironment * env )

References ParticleSpawnerParameters::amount, g_settings, ClientEnvironment::getGenericCAO(), Settings::getS16(), m_attached_id, m_spawntimes, m_time, MAP_BLOCKSIZE, myrand_float(), p, spawnParticle(), and ParticleSpawnerParameters::time.

+ Here is the call graph for this function:

Member Data Documentation

◆ m_active

size_t ParticleSpawner::m_active
private

◆ m_attached_id

u16 ParticleSpawner::m_attached_id
private

Referenced by step().

◆ m_particlemanager

ParticleManager* ParticleSpawner::m_particlemanager
private

Referenced by spawnParticle().

◆ m_player

LocalPlayer* ParticleSpawner::m_player
private

Referenced by spawnParticle().

◆ m_spawntimes

std::vector<float> ParticleSpawner::m_spawntimes
private

Referenced by ParticleSpawner(), and step().

◆ m_texpool

std::vector<ClientParticleTexture> ParticleSpawner::m_texpool
private

Referenced by spawnParticle().

◆ m_time

float ParticleSpawner::m_time
private

Referenced by spawnParticle(), and step().

◆ p

ParticleSpawnerParameters ParticleSpawner::p
private

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