8#include <unordered_map>
28 video::ITexture *
ref =
nullptr;
39 video::ITexture *
ref =
nullptr;
64 std::unique_ptr<ClientParticleTexture> owned_texture =
nullptr
122 std::vector<ClientParticleTexture> &&texpool,
135 const core::matrix4 *attached_absolute_pos_rot_matrix);
178 virtual void render()
override;
207 void step (
float dtime);
235 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:148
virtual void render() override
Definition particles.cpp:638
bool m_bounding_box_dirty
Definition particles.h:193
ParticleBuffer(ClientEnvironment *env, const video::SMaterial &material)
Definition particles.cpp:548
irr_ptr< scene::SMeshBuffer > m_mesh_buffer
Definition particles.h:186
u16 m_count
Definition particles.h:192
static constexpr u16 MAX_PARTICLES_PER_BUFFER
Definition particles.h:183
void release(u16 index)
Frees the particle at index
Definition particles.cpp:590
float m_usage_timer
Definition particles.h:190
virtual void OnRegisterSceneNode() override
Definition particles.cpp:607
virtual u32 getMaterialCount() const override
Definition particles.h:172
std::optional< u16 > allocate()
Reserves one more slot for a particle (4 vertices, 6 indices)
Definition particles.cpp:559
video::S3DVertex * getVertices(u16 index)
Definition particles.cpp:599
virtual video::SMaterial & getMaterial(u32 num) override
Definition particles.h:169
bool isEmpty() const
Definition particles.h:165
virtual const core::aabbox3df & getBoundingBox() const override
Definition particles.cpp:617
std::vector< u16 > m_free_list
Definition particles.h:188
Class doing particle as well as their spawners handling.
Definition particles.h:200
u64 m_next_particle_spawner_id
Definition particles.h:258
std::mutex m_particle_list_lock
Definition particles.h:264
void stepSpawners(float dtime)
Definition particles.cpp:670
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:847
void clearAll()
Definition particles.cpp:750
~ParticleManager()
Definition particles.cpp:658
IntervalLimiter m_buffer_gc
Definition particles.h:262
void addParticleSpawner(u64 id, std::unique_ptr< ParticleSpawner > toadd)
Definition particles.cpp:1057
void stepParticles(float dtime)
Definition particles.cpp:699
void addNodeParticle(IGameDef *gamedef, LocalPlayer *player, v3s16 pos, const MapNode &n, const ContentFeatures &f)
Definition particles.cpp:904
static video::SMaterial getMaterialForParticle(const Particle *texture)
Definition particles.cpp:989
void step(float dtime)
Definition particles.cpp:663
std::vector< irr_ptr< ParticleBuffer > > m_particle_buffers
Definition particles.h:254
void reserveParticleSpace(size_t max_estimate)
Definition particles.cpp:945
u64 generateSpawnerId()
This function is only used by client particle spawners.
Definition particles.h:227
void deleteParticleSpawner(u64 id)
Definition particles.cpp:1071
void addDiggingParticles(IGameDef *gamedef, LocalPlayer *player, v3s16 pos, const MapNode &n, const ContentFeatures &f)
Definition particles.cpp:889
void handleParticleEvent(ClientEvent *event, Client *client, LocalPlayer *player)
Definition particles.cpp:766
std::vector< std::unique_ptr< ParticleSpawner > > m_dying_particle_spawners
Definition particles.h:253
bool addParticle(std::unique_ptr< Particle > toadd)
Definition particles.cpp:1020
ParticleManager(ClientEnvironment *env)
Definition particles.cpp:654
void stepBuffers(float dtime)
Definition particles.cpp:721
std::unordered_map< u64, std::unique_ptr< ParticleSpawner > > m_particle_spawners
Definition particles.h:252
std::vector< std::unique_ptr< Particle > > m_particles
Definition particles.h:251
ClientEnvironment * m_env
Definition particles.h:260
std::mutex m_spawner_list_lock
Definition particles.h:265
Definition particles.h:117
ParticleSpawnerParameters p
Definition particles.h:141
float m_time
Definition particles.h:139
size_t m_active
Definition particles.h:137
std::vector< float > m_spawntimes
Definition particles.h:143
void decrActive()
Definition particles.h:131
bool hasActive() const
Definition particles.h:130
ParticleSpawner(LocalPlayer *player, const ParticleSpawnerParameters ¶ms, u16 attached_id, std::vector< ClientParticleTexture > &&texpool, ParticleManager *p_manager)
Definition particles.cpp:251
std::vector< ClientParticleTexture > m_texpool
Definition particles.h:142
void step(float dtime, ClientEnvironment *env)
Definition particles.cpp:497
u16 m_attached_id
Definition particles.h:144
void spawnParticle(ClientEnvironment *env, float radius, const core::matrix4 *attached_absolute_pos_rot_matrix)
Definition particles.cpp:293
LocalPlayer * m_player
Definition particles.h:140
bool getExpired() const
Definition particles.h:127
ParticleManager * m_particlemanager
Definition particles.h:138
Definition particles.h:55
v3f m_velocity
Definition particles.h:103
void updateVertices(ClientEnvironment *env, video::SColor color)
Definition particles.cpp:183
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:38
u16 m_index
Definition particles.h:91
ParticleBuffer * m_buffer
Definition particles.h:90
v3f m_pos
Definition particles.h:102
float m_animation_time
Definition particles.h:108
const ParticleParameters m_p
Definition particles.h:106
bool attachToBuffer(ParticleBuffer *buffer)
Definition particles.cpp:70
v2f m_texpos
Definition particles.h:100
ParticleParamTypes::BlendMode getBlendMode() const
Definition particles.h:80
ParticleSpawner * m_parent
Definition particles.h:111
float m_time
Definition particles.h:93
const ClientParticleTexRef & getTextureRef() const
Definition particles.h:78
video::SColor updateLight(ClientEnvironment *env)
Definition particles.cpp:159
v3f m_acceleration
Definition particles.h:104
float m_expiration
Definition particles.h:94
v2f m_texsize
Definition particles.h:101
video::SColor m_base_color
Definition particles.h:97
~Particle()
Definition particles.cpp:64
int m_animation_frame
Definition particles.h:109
ClientParticleTexRef m_texture
Definition particles.h:99
void step(float dtime, ClientEnvironment *env)
Definition particles.cpp:81
bool isExpired() const
Definition particles.h:73
ParticleBuffer * getBuffer() const
Definition particles.h:83
std::unique_ptr< ClientParticleTexture > m_owned_texture
Definition particles.h:113
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 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
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:53