mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-02 15:53:51 +00:00
Initial commit: wowee native WoW 3.3.5a client
This commit is contained in:
commit
ce6cb8f38e
147 changed files with 32347 additions and 0 deletions
59
include/rendering/swim_effects.hpp
Normal file
59
include/rendering/swim_effects.hpp
Normal file
|
|
@ -0,0 +1,59 @@
|
|||
#pragma once
|
||||
|
||||
#include <GL/glew.h>
|
||||
#include <glm/glm.hpp>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
namespace wowee {
|
||||
namespace rendering {
|
||||
|
||||
class Camera;
|
||||
class CameraController;
|
||||
class WaterRenderer;
|
||||
class Shader;
|
||||
|
||||
class SwimEffects {
|
||||
public:
|
||||
SwimEffects();
|
||||
~SwimEffects();
|
||||
|
||||
bool initialize();
|
||||
void shutdown();
|
||||
void update(const Camera& camera, const CameraController& cc,
|
||||
const WaterRenderer& water, 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_RIPPLE_PARTICLES = 200;
|
||||
static constexpr int MAX_BUBBLE_PARTICLES = 150;
|
||||
|
||||
std::vector<Particle> ripples;
|
||||
std::vector<Particle> bubbles;
|
||||
|
||||
GLuint rippleVAO = 0, rippleVBO = 0;
|
||||
GLuint bubbleVAO = 0, bubbleVBO = 0;
|
||||
std::unique_ptr<Shader> rippleShader;
|
||||
std::unique_ptr<Shader> bubbleShader;
|
||||
|
||||
std::vector<float> rippleVertexData;
|
||||
std::vector<float> bubbleVertexData;
|
||||
|
||||
float rippleSpawnAccum = 0.0f;
|
||||
float bubbleSpawnAccum = 0.0f;
|
||||
|
||||
void spawnRipple(const glm::vec3& pos, const glm::vec3& moveDir, float waterH);
|
||||
void spawnBubble(const glm::vec3& pos, float waterH);
|
||||
};
|
||||
|
||||
} // namespace rendering
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue