From abef6da56913f1c55528103e60a50451a39628b1 Mon Sep 17 00:00:00 2001 From: WlodekM Date: Sun, 16 Jun 2024 10:35:45 +0300 Subject: initial commit --- src/Particle.h | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 src/Particle.h (limited to 'src/Particle.h') diff --git a/src/Particle.h b/src/Particle.h new file mode 100644 index 0000000..f322bbc --- /dev/null +++ b/src/Particle.h @@ -0,0 +1,46 @@ +#ifndef CC_PARTICLE_H +#define CC_PARTICLE_H +#include "Vectors.h" +#include "PackedCol.h" +/* +Represents particle effects, and manages rendering and spawning particles +Copyright 2014-2023 ClassiCube | Licensed under BSD-3 +*/ + +struct IGameComponent; +struct VertexTextured; +struct ScheduledTask; +extern struct IGameComponent Particles_Component; + +struct Particle { + Vec3 velocity; + float lifetime; + Vec3 lastPos, nextPos; + float size; +}; + +struct CustomParticleEffect { + TextureRec rec; + PackedCol tintCol; + cc_uint8 frameCount; + cc_uint8 particleCount; + cc_uint8 collideFlags; + cc_bool fullBright; + float size; + float sizeVariation; + float spread; /* how far from the spawnpoint their location can vary */ + float speed; /* how fast they move away/towards the origin */ + float gravity; + float baseLifetime; /* how long (in seconds) the particle lives for */ + float lifetimeVariation; +}; + +extern struct CustomParticleEffect Particles_CustomEffects[256]; + +/* http://www.opengl-tutorial.org/intermediate-tutorials/billboards-particles/billboards/ */ +void Particle_DoRender(const Vec2* size, const Vec3* pos, const TextureRec* rec, PackedCol col, struct VertexTextured* vertices); +void Particles_Render(float t); +void Particles_BreakBlockEffect(IVec3 coords, BlockID oldBlock, BlockID block); +void Particles_RainSnowEffect(float x, float y, float z); +void Particles_CustomEffect(int effectID, float x, float y, float z, float originX, float originY, float originZ); +#endif -- cgit 1.4.1-2-gfad0