#include <particles.h>
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 |
ParticleSpawner * | getParent () const |
const ClientParticleTexRef & | getTextureRef () const |
ParticleParamTypes::BlendMode | getBlendMode () const |
ParticleBuffer * | getBuffer () const |
bool | attachToBuffer (ParticleBuffer *buffer) |
Private Member Functions | |
video::SColor | updateLight (ClientEnvironment *env) |
void | updateVertices (ClientEnvironment *env, video::SColor color) |
Private Attributes | |
ParticleBuffer * | m_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 |
ParticleSpawner * | m_parent = nullptr |
std::unique_ptr< ClientParticleTexture > | m_owned_texture |
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 | ( | ) |
References m_buffer, m_index, and ParticleBuffer::release().
bool Particle::attachToBuffer | ( | ParticleBuffer * | buffer | ) |
References ParticleBuffer::allocate(), m_buffer, and m_index.
|
inline |
References ParticleTexture::blendmode, m_p, m_texture, ClientParticleTexRef::tex, and CommonParticleParams::texture.
Referenced by ParticleManager::getMaterialForParticle().
|
inline |
References m_buffer.
|
inline |
References m_parent.
|
inline |
References m_texture.
Referenced by ParticleManager::getMaterialForParticle().
|
inline |
References m_expiration, and m_time.
void Particle::step | ( | float | dtime, |
ClientEnvironment * | env ) |
References CommonParticleParams::animation, ParticleParameters::bounce, BS, collisionMoveResult::collides, CommonParticleParams::collision_removal, CommonParticleParams::collisiondetection, collisionMoveSimple(), TileAnimationParams::determineParams(), ParticleParameters::drag, ClientEnvironment::getGameDef(), ParticleParameters::jitter, m_acceleration, m_animation_frame, m_animation_time, m_expiration, m_p, m_pos, m_texture, m_time, m_velocity, CommonParticleParams::object_collision, ParticleParamTypes::RangedParameter< T >::pickWithin(), ClientParticleTexRef::ref, ParticleParameters::size, TAT_NONE, ClientParticleTexRef::tex, TileAnimationParams::type, updateLight(), updateVertices(), vecAbsolute(), and vecSign().
|
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().
|
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().
|
private |
Referenced by step(), and updateVertices().
|
private |
Referenced by step().
|
private |
Referenced by updateLight().
|
private |
Referenced by ~Particle(), attachToBuffer(), getBuffer(), and updateVertices().
|
private |
Referenced by isExpired(), step(), and updateVertices().
|
private |
Referenced by ~Particle(), attachToBuffer(), and updateVertices().
|
private |
|
private |
Referenced by getBlendMode(), step(), updateLight(), and updateVertices().
|
private |
Referenced by getParent().
|
private |
Referenced by step(), updateLight(), and updateVertices().
|
private |
Referenced by updateVertices().
|
private |
Referenced by updateVertices().
|
private |
Referenced by getBlendMode(), getTextureRef(), step(), and updateVertices().
|
private |
Referenced by isExpired(), step(), and updateVertices().