11#include "SMeshBuffer.h"
15#include <unordered_map>
37 video::ITexture *
ref =
nullptr;
48 video::ITexture *
ref =
nullptr;
73 std::unique_ptr<ClientParticleTexture> owned_texture =
nullptr
131 std::vector<ClientParticleTexture> &&texpool,
144 const core::matrix4 *attached_absolute_pos_rot_matrix);
187 virtual void render()
override;
216 void step (
float dtime);
244 v2f &texsize, video::SColor *color, u8 tilenum = 0);
#define DISABLE_CLASS_COPY(C)
Definition basic_macros.h:26
Definition clientenvironment.h:54
Definition texturesource.h:36
Definition localplayer.h:50
Definition particles.h:157
virtual void render() override
Definition particles.cpp:647
bool m_bounding_box_dirty
Definition particles.h:202
ParticleBuffer(ClientEnvironment *env, const video::SMaterial &material)
Definition particles.cpp:550
irr_ptr< scene::SMeshBuffer > m_mesh_buffer
Definition particles.h:195
u16 m_count
Definition particles.h:201
static constexpr u16 MAX_PARTICLES_PER_BUFFER
Definition particles.h:192
void release(u16 index)
Frees the particle at index
Definition particles.cpp:592
float m_usage_timer
Definition particles.h:199
virtual void OnRegisterSceneNode() override
Definition particles.cpp:609
virtual u32 getMaterialCount() const override
Definition particles.h:181
std::optional< u16 > allocate()
Reserves one more slot for a particle (4 vertices, 6 indices)
Definition particles.cpp:561
video::S3DVertex * getVertices(u16 index)
Definition particles.cpp:601
virtual video::SMaterial & getMaterial(u32 num) override
Definition particles.h:178
bool isEmpty() const
Definition particles.h:174
virtual const core::aabbox3df & getBoundingBox() const override
Definition particles.cpp:619
std::vector< u16 > m_free_list
Definition particles.h:197
Class doing particle as well as their spawners handling.
Definition particles.h:209
u64 m_next_particle_spawner_id
Definition particles.h:267
std::mutex m_particle_list_lock
Definition particles.h:273
void stepSpawners(float dtime)
Definition particles.cpp:679
static bool getNodeParticleParams(const MapNode &n, const ContentFeatures &f, ParticleParameters &p, video::ITexture **texture, v2f &texpos, v2f &texsize, video::SColor *color, u8 tilenum=0)
Definition particles.cpp:856
void clearAll()
Definition particles.cpp:759
~ParticleManager()
Definition particles.cpp:667
IntervalLimiter m_buffer_gc
Definition particles.h:271
void addParticleSpawner(u64 id, std::unique_ptr< ParticleSpawner > toadd)
Definition particles.cpp:1066
void stepParticles(float dtime)
Definition particles.cpp:708
void addNodeParticle(IGameDef *gamedef, LocalPlayer *player, v3s16 pos, const MapNode &n, const ContentFeatures &f)
Definition particles.cpp:913
static video::SMaterial getMaterialForParticle(const Particle *texture)
Definition particles.cpp:998
void step(float dtime)
Definition particles.cpp:672
std::vector< irr_ptr< ParticleBuffer > > m_particle_buffers
Definition particles.h:263
void reserveParticleSpace(size_t max_estimate)
Definition particles.cpp:954
u64 generateSpawnerId()
This function is only used by client particle spawners.
Definition particles.h:236
void deleteParticleSpawner(u64 id)
Definition particles.cpp:1080
void addDiggingParticles(IGameDef *gamedef, LocalPlayer *player, v3s16 pos, const MapNode &n, const ContentFeatures &f)
Definition particles.cpp:898
void handleParticleEvent(ClientEvent *event, Client *client, LocalPlayer *player)
Definition particles.cpp:775
std::vector< std::unique_ptr< ParticleSpawner > > m_dying_particle_spawners
Definition particles.h:262
bool addParticle(std::unique_ptr< Particle > toadd)
Definition particles.cpp:1029
ParticleManager(ClientEnvironment *env)
Definition particles.cpp:663
void stepBuffers(float dtime)
Definition particles.cpp:730
std::unordered_map< u64, std::unique_ptr< ParticleSpawner > > m_particle_spawners
Definition particles.h:261
std::vector< std::unique_ptr< Particle > > m_particles
Definition particles.h:260
ClientEnvironment * m_env
Definition particles.h:269
std::mutex m_spawner_list_lock
Definition particles.h:274
Definition particles.h:126
ParticleSpawnerParameters p
Definition particles.h:150
float m_time
Definition particles.h:148
size_t m_active
Definition particles.h:146
std::vector< float > m_spawntimes
Definition particles.h:152
void decrActive()
Definition particles.h:140
bool hasActive() const
Definition particles.h:139
ParticleSpawner(LocalPlayer *player, const ParticleSpawnerParameters ¶ms, u16 attached_id, std::vector< ClientParticleTexture > &&texpool, ParticleManager *p_manager)
Definition particles.cpp:253
std::vector< ClientParticleTexture > m_texpool
Definition particles.h:151
void step(float dtime, ClientEnvironment *env)
Definition particles.cpp:499
u16 m_attached_id
Definition particles.h:153
void spawnParticle(ClientEnvironment *env, float radius, const core::matrix4 *attached_absolute_pos_rot_matrix)
Definition particles.cpp:295
LocalPlayer * m_player
Definition particles.h:149
bool getExpired() const
Definition particles.h:136
ParticleManager * m_particlemanager
Definition particles.h:147
Definition particles.h:64
v3f m_velocity
Definition particles.h:112
void updateVertices(ClientEnvironment *env, video::SColor color)
Definition particles.cpp:185
ParticleSpawner * getParent() const
Definition particles.h:85
Particle(const ParticleParameters &p, const ClientParticleTexRef &texture, v2f texpos, v2f texsize, video::SColor color, ParticleSpawner *parent=nullptr, std::unique_ptr< ClientParticleTexture > owned_texture=nullptr)
Definition particles.cpp:40
u16 m_index
Definition particles.h:100
ParticleBuffer * m_buffer
Definition particles.h:99
v3f m_pos
Definition particles.h:111
float m_animation_time
Definition particles.h:117
const ParticleParameters m_p
Definition particles.h:115
bool attachToBuffer(ParticleBuffer *buffer)
Definition particles.cpp:72
v2f m_texpos
Definition particles.h:109
ParticleParamTypes::BlendMode getBlendMode() const
Definition particles.h:89
ParticleSpawner * m_parent
Definition particles.h:120
float m_time
Definition particles.h:102
const ClientParticleTexRef & getTextureRef() const
Definition particles.h:87
video::SColor updateLight(ClientEnvironment *env)
Definition particles.cpp:161
v3f m_acceleration
Definition particles.h:113
float m_expiration
Definition particles.h:103
v2f m_texsize
Definition particles.h:110
video::SColor m_base_color
Definition particles.h:106
~Particle()
Definition particles.cpp:66
int m_animation_frame
Definition particles.h:118
ClientParticleTexRef m_texture
Definition particles.h:108
void step(float dtime, ClientEnvironment *env)
Definition particles.cpp:83
bool isExpired() const
Definition particles.h:82
ParticleBuffer * getBuffer() const
Definition particles.h:92
std::unique_ptr< ClientParticleTexture > m_owned_texture
Definition particles.h:122
core::vector2d< f32 > v2f
Definition irr_v2d.h:11
core::vector3d< s16 > v3s16
Definition irr_v3d.h:13
core::vector3df v3f
Definition irr_v3d.h:11
#define U32_MAX
Definition irrlichttypes.h:29
BlendMode
Definition particles.h:237
Definition activeobjectmgr.cpp:11
Definition clientmap.h:35
Definition clientevent.h:68
Definition particles.h:44
ClientParticleTexRef(ClientParticleTexture &t)
Definition particles.h:53
ClientParticleTexRef(video::ITexture *tp)
Definition particles.h:57
ClientParticleTexRef()=default
video::ITexture * ref
Definition particles.h:48
ParticleTexture * tex
Definition particles.h:47
Definition particles.h:33
ClientParticleTexture()=default
ParticleTexture tex
Definition particles.h:36
video::ITexture * ref
Definition particles.h:37
ServerParticleTexture texture
Definition particles.h:277
Definition particles.h:304
Definition particles.h:315
u16 amount
Definition particles.h:316
f32 time
Definition particles.h:317
Definition particles.h:254
ParticleParamTypes::BlendMode blendmode
Definition particles.h:256
Definition particles.h:263
static std::string p(std::string path)
Definition test_filesys.cpp:55