mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-04-17 01:23:51 +00:00
Add mount dust particle effects
Implemented dust cloud particles that spawn at mount feet when running on the ground, similar to the original WoW. Features: - Brownish/tan dust particles using point sprite rendering - Spawn rate proportional to movement speed - Particles rise up, drift backward, and fade out naturally - Only active when mounted, moving, and on ground (not flying) - Smooth particle animation with size growth and alpha fade Uses similar particle system architecture as swim effects with GL_POINTS rendering and custom shaders for soft circular particles.
This commit is contained in:
parent
c6a915397c
commit
c95c3db03a
5 changed files with 299 additions and 0 deletions
50
include/rendering/mount_dust.hpp
Normal file
50
include/rendering/mount_dust.hpp
Normal file
|
|
@ -0,0 +1,50 @@
|
|||
#pragma once
|
||||
|
||||
#include <GL/glew.h>
|
||||
#include <glm/glm.hpp>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
namespace wowee {
|
||||
namespace rendering {
|
||||
|
||||
class Camera;
|
||||
class Shader;
|
||||
|
||||
class MountDust {
|
||||
public:
|
||||
MountDust();
|
||||
~MountDust();
|
||||
|
||||
bool initialize();
|
||||
void shutdown();
|
||||
|
||||
// Spawn dust particles at mount feet when moving on ground
|
||||
void spawnDust(const glm::vec3& position, const glm::vec3& velocity, bool isMoving);
|
||||
|
||||
void update(float deltaTime);
|
||||
void render(const Camera& camera);
|
||||
|
||||
private:
|
||||
struct Particle {
|
||||
glm::vec3 position;
|
||||
glm::vec3 velocity;
|
||||
float lifetime;
|
||||
float maxLifetime;
|
||||
float size;
|
||||
float alpha;
|
||||
};
|
||||
|
||||
static constexpr int MAX_DUST_PARTICLES = 300;
|
||||
std::vector<Particle> particles;
|
||||
|
||||
GLuint vao = 0;
|
||||
GLuint vbo = 0;
|
||||
std::unique_ptr<Shader> shader;
|
||||
std::vector<float> vertexData;
|
||||
|
||||
float spawnAccum = 0.0f;
|
||||
};
|
||||
|
||||
} // namespace rendering
|
||||
} // namespace wowee
|
||||
|
|
@ -27,6 +27,7 @@ class Clouds;
|
|||
class LensFlare;
|
||||
class Weather;
|
||||
class SwimEffects;
|
||||
class MountDust;
|
||||
class CharacterRenderer;
|
||||
class WMORenderer;
|
||||
class M2Renderer;
|
||||
|
|
@ -165,6 +166,7 @@ private:
|
|||
std::unique_ptr<LensFlare> lensFlare;
|
||||
std::unique_ptr<Weather> weather;
|
||||
std::unique_ptr<SwimEffects> swimEffects;
|
||||
std::unique_ptr<MountDust> mountDust;
|
||||
std::unique_ptr<CharacterRenderer> characterRenderer;
|
||||
std::unique_ptr<WMORenderer> wmoRenderer;
|
||||
std::unique_ptr<M2Renderer> m2Renderer;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue