8#include <unordered_map>
28 video::ITexture *
ref =
nullptr;
39 video::ITexture *
ref =
nullptr;
64 std::unique_ptr<ClientParticleTexture> owned_texture =
nullptr
119 std::vector<ClientParticleTexture> &&texpool,
132 const core::matrix4 *attached_absolute_pos_rot_matrix);
175 virtual void render()
override;
204 void step (
float dtime);
232 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:49
Definition particles.h:145
virtual void render() override
Definition particles.cpp:632
bool m_bounding_box_dirty
Definition particles.h:190
ParticleBuffer(ClientEnvironment *env, const video::SMaterial &material)
Definition particles.cpp:545
irr_ptr< scene::SMeshBuffer > m_mesh_buffer
Definition particles.h:183
u16 m_count
Definition particles.h:189
static constexpr u16 MAX_PARTICLES_PER_BUFFER
Definition particles.h:180
void release(u16 index)
Frees the particle at index
Definition particles.cpp:587
float m_usage_timer
Definition particles.h:187
virtual void OnRegisterSceneNode() override
Definition particles.cpp:604
virtual u32 getMaterialCount() const override
Definition particles.h:169
std::optional< u16 > allocate()
Reserves one more slot for a particle (4 vertices, 6 indices)
Definition particles.cpp:556
video::S3DVertex * getVertices(u16 index)
Definition particles.cpp:596
virtual video::SMaterial & getMaterial(u32 num) override
Definition particles.h:166
bool isEmpty() const
Definition particles.h:162
virtual const core::aabbox3df & getBoundingBox() const override
Definition particles.cpp:611
std::vector< u16 > m_free_list
Definition particles.h:185
Class doing particle as well as their spawners handling.
Definition particles.h:197
u64 m_next_particle_spawner_id
Definition particles.h:255
std::mutex m_particle_list_lock
Definition particles.h:261
void stepSpawners(float dtime)
Definition particles.cpp:664
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:841
void clearAll()
Definition particles.cpp:744
~ParticleManager()
Definition particles.cpp:652
IntervalLimiter m_buffer_gc
Definition particles.h:259
void addParticleSpawner(u64 id, std::unique_ptr< ParticleSpawner > toadd)
Definition particles.cpp:1040
void stepParticles(float dtime)
Definition particles.cpp:693
void addNodeParticle(IGameDef *gamedef, LocalPlayer *player, v3s16 pos, const MapNode &n, const ContentFeatures &f)
Definition particles.cpp:898
static video::SMaterial getMaterialForParticle(const ClientParticleTexRef &texture)
Definition particles.cpp:943
void step(float dtime)
Definition particles.cpp:657
std::vector< irr_ptr< ParticleBuffer > > m_particle_buffers
Definition particles.h:251
void reserveParticleSpace(size_t max_estimate)
Definition particles.cpp:936
u64 generateSpawnerId()
This function is only used by client particle spawners.
Definition particles.h:224
void deleteParticleSpawner(u64 id)
Definition particles.cpp:1054
void addDiggingParticles(IGameDef *gamedef, LocalPlayer *player, v3s16 pos, const MapNode &n, const ContentFeatures &f)
Definition particles.cpp:883
void handleParticleEvent(ClientEvent *event, Client *client, LocalPlayer *player)
Definition particles.cpp:760
std::vector< std::unique_ptr< ParticleSpawner > > m_dying_particle_spawners
Definition particles.h:250
bool addParticle(std::unique_ptr< Particle > toadd)
Definition particles.cpp:1003
ParticleManager(ClientEnvironment *env)
Definition particles.cpp:648
void stepBuffers(float dtime)
Definition particles.cpp:715
std::unordered_map< u64, std::unique_ptr< ParticleSpawner > > m_particle_spawners
Definition particles.h:249
std::vector< std::unique_ptr< Particle > > m_particles
Definition particles.h:248
ClientEnvironment * m_env
Definition particles.h:257
std::mutex m_spawner_list_lock
Definition particles.h:262
Definition particles.h:114
ParticleSpawnerParameters p
Definition particles.h:138
float m_time
Definition particles.h:136
size_t m_active
Definition particles.h:134
std::vector< float > m_spawntimes
Definition particles.h:140
void decrActive()
Definition particles.h:128
bool hasActive() const
Definition particles.h:127
ParticleSpawner(LocalPlayer *player, const ParticleSpawnerParameters ¶ms, u16 attached_id, std::vector< ClientParticleTexture > &&texpool, ParticleManager *p_manager)
Definition particles.cpp:249
std::vector< ClientParticleTexture > m_texpool
Definition particles.h:139
void step(float dtime, ClientEnvironment *env)
Definition particles.cpp:494
u16 m_attached_id
Definition particles.h:141
void spawnParticle(ClientEnvironment *env, float radius, const core::matrix4 *attached_absolute_pos_rot_matrix)
Definition particles.cpp:290
LocalPlayer * m_player
Definition particles.h:137
bool getExpired() const
Definition particles.h:124
ParticleManager * m_particlemanager
Definition particles.h:135
Definition particles.h:55
v3f m_velocity
Definition particles.h:100
void updateVertices(ClientEnvironment *env, video::SColor color)
Definition particles.cpp:181
ParticleSpawner * getParent() const
Definition particles.h:76
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:36
u16 m_index
Definition particles.h:88
ParticleBuffer * m_buffer
Definition particles.h:87
v3f m_pos
Definition particles.h:99
float m_animation_time
Definition particles.h:105
const ParticleParameters m_p
Definition particles.h:103
bool attachToBuffer(ParticleBuffer *buffer)
Definition particles.cpp:68
v2f m_texpos
Definition particles.h:97
ParticleSpawner * m_parent
Definition particles.h:108
float m_time
Definition particles.h:90
const ClientParticleTexRef & getTextureRef() const
Definition particles.h:78
video::SColor updateLight(ClientEnvironment *env)
Definition particles.cpp:157
v3f m_acceleration
Definition particles.h:101
float m_expiration
Definition particles.h:91
v2f m_texsize
Definition particles.h:98
video::SColor m_base_color
Definition particles.h:94
~Particle()
Definition particles.cpp:62
int m_animation_frame
Definition particles.h:106
ClientParticleTexRef m_texture
Definition particles.h:96
void step(float dtime, ClientEnvironment *env)
Definition particles.cpp:79
bool isExpired() const
Definition particles.h:73
ParticleBuffer * getBuffer() const
Definition particles.h:80
std::unique_ptr< ClientParticleTexture > m_owned_texture
Definition particles.h:110
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
Definition activeobjectmgr.cpp:11
Definition clientevent.h:67
Definition particles.h:35
ClientParticleTexRef(ClientParticleTexture &t)
Definition particles.h:44
ClientParticleTexRef(video::ITexture *tp)
Definition particles.h:48
ClientParticleTexRef()=default
video::ITexture * ref
Definition particles.h:39
ParticleTexture * tex
Definition particles.h:38
Definition particles.h:24
ClientParticleTexture()=default
ParticleTexture tex
Definition particles.h:27
video::ITexture * ref
Definition particles.h:28
Definition particles.h:303
Definition particles.h:314
u16 amount
Definition particles.h:315
f32 time
Definition particles.h:316
Definition particles.h:253
Definition particles.h:262
static std::string p(std::string path)
Definition test_filesys.cpp:53