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

#include <particles.h>

+ Collaboration diagram for Particle:

Public Member Functions

 Particle (const ParticleParameters &p, const ClientParticleTexRef &texture, v2f texpos, v2f texsize, video::SColor color, ParticleSpawner *parent=nullptr, std::unique_ptr< ClientParticleTexture > owned_texture=nullptr)
 
 ~Particle ()
 
void step (float dtime, ClientEnvironment *env)
 
bool isExpired () const
 
ParticleSpawnergetParent () const
 
const ClientParticleTexRefgetTextureRef () const
 
ParticleBuffergetBuffer () const
 
bool attachToBuffer (ParticleBuffer *buffer)
 

Private Member Functions

video::SColor updateLight (ClientEnvironment *env)
 
void updateVertices (ClientEnvironment *env, video::SColor color)
 

Private Attributes

ParticleBufferm_buffer = nullptr
 
u16 m_index
 
float m_time = 0.0f
 
float m_expiration
 
video::SColor m_base_color
 
ClientParticleTexRef m_texture
 
v2f m_texpos
 
v2f m_texsize
 
v3f m_pos
 
v3f m_velocity
 
v3f m_acceleration
 
const ParticleParameters m_p
 
float m_animation_time = 0.0f
 
int m_animation_frame = 0
 
ParticleSpawnerm_parent = nullptr
 
std::unique_ptr< ClientParticleTexturem_owned_texture
 

Constructor & Destructor Documentation

◆ Particle()

Particle::Particle ( const ParticleParameters & p,
const ClientParticleTexRef & texture,
v2f texpos,
v2f texsize,
video::SColor color,
ParticleSpawner * parent = nullptr,
std::unique_ptr< ClientParticleTexture > owned_texture = nullptr )

◆ ~Particle()

Particle::~Particle ( )

References m_buffer, m_index, and ParticleBuffer::release().

+ Here is the call graph for this function:

Member Function Documentation

◆ attachToBuffer()

bool Particle::attachToBuffer ( ParticleBuffer * buffer)

References ParticleBuffer::allocate(), m_buffer, and m_index.

+ Here is the call graph for this function:

◆ getBuffer()

ParticleBuffer * Particle::getBuffer ( ) const
inline

References m_buffer.

◆ getParent()

ParticleSpawner * Particle::getParent ( ) const
inline

References m_parent.

◆ getTextureRef()

const ClientParticleTexRef & Particle::getTextureRef ( ) const
inline

References m_texture.

◆ isExpired()

bool Particle::isExpired ( ) const
inline

References m_expiration, and m_time.

◆ step()

◆ updateLight()

video::SColor Particle::updateLight ( ClientEnvironment * env)
private

References blend_light(), ClientEnvironment::getClientMap(), Environment::getDayNightRatio(), ClientEnvironment::getGameDef(), MapNode::getLightBlend(), NodeDefManager::getLightingFlags(), Map::getNode(), CommonParticleParams::glow, LIGHT_SUN, m_base_color, m_p, m_pos, IGameDef::ndef(), and p().

Referenced by step().

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

◆ updateVertices()

void Particle::updateVertices ( ClientEnvironment * env,
video::SColor color )
private

References CommonParticleParams::animation, BS, TileAnimationParams::determineParams(), ClientEnvironment::getCameraOffset(), ClientEnvironment::getLocalPlayer(), TileAnimationParams::getTextureCoords(), ParticleBuffer::getVertices(), intToFloat(), m_animation_frame, m_buffer, m_expiration, m_index, m_p, m_pos, m_texpos, m_texsize, m_texture, m_time, ClientParticleTexRef::ref, ParticleParameters::size, TAT_NONE, ClientParticleTexRef::tex, TileAnimationParams::type, and CommonParticleParams::vertical.

Referenced by step().

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

Member Data Documentation

◆ m_acceleration

v3f Particle::m_acceleration
private

Referenced by step().

◆ m_animation_frame

int Particle::m_animation_frame = 0
private

Referenced by step(), and updateVertices().

◆ m_animation_time

float Particle::m_animation_time = 0.0f
private

Referenced by step().

◆ m_base_color

video::SColor Particle::m_base_color
private

Referenced by updateLight().

◆ m_buffer

ParticleBuffer* Particle::m_buffer = nullptr
private

◆ m_expiration

float Particle::m_expiration
private

Referenced by isExpired(), step(), and updateVertices().

◆ m_index

u16 Particle::m_index
private

◆ m_owned_texture

std::unique_ptr<ClientParticleTexture> Particle::m_owned_texture
private

◆ m_p

const ParticleParameters Particle::m_p
private

Referenced by step(), updateLight(), and updateVertices().

◆ m_parent

ParticleSpawner* Particle::m_parent = nullptr
private

Referenced by getParent().

◆ m_pos

v3f Particle::m_pos
private

Referenced by step(), updateLight(), and updateVertices().

◆ m_texpos

v2f Particle::m_texpos
private

Referenced by updateVertices().

◆ m_texsize

v2f Particle::m_texsize
private

Referenced by updateVertices().

◆ m_texture

ClientParticleTexRef Particle::m_texture
private

Referenced by getTextureRef(), step(), and updateVertices().

◆ m_time

float Particle::m_time = 0.0f
private

Referenced by isExpired(), step(), and updateVertices().

◆ m_velocity

v3f Particle::m_velocity
private

Referenced by step().


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