mirror of
https://github.com/Kelsidavis/WoWee.git
synced 2026-05-03 00:03:50 +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
76
include/rendering/starfield.hpp
Normal file
76
include/rendering/starfield.hpp
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <glm/glm.hpp>
|
||||
|
||||
namespace wowee {
|
||||
namespace rendering {
|
||||
|
||||
class Shader;
|
||||
class Camera;
|
||||
|
||||
/**
|
||||
* Star field renderer
|
||||
*
|
||||
* Renders a field of stars across the night sky.
|
||||
* Stars fade in at dusk and out at dawn.
|
||||
*/
|
||||
class StarField {
|
||||
public:
|
||||
StarField();
|
||||
~StarField();
|
||||
|
||||
bool initialize();
|
||||
void shutdown();
|
||||
|
||||
/**
|
||||
* Render the star field
|
||||
* @param camera Camera for view matrix
|
||||
* @param timeOfDay Time of day in hours (0-24)
|
||||
*/
|
||||
void render(const Camera& camera, float timeOfDay);
|
||||
|
||||
/**
|
||||
* Update star twinkle animation
|
||||
*/
|
||||
void update(float deltaTime);
|
||||
|
||||
/**
|
||||
* Enable/disable star rendering
|
||||
*/
|
||||
void setEnabled(bool enabled) { renderingEnabled = enabled; }
|
||||
bool isEnabled() const { return renderingEnabled; }
|
||||
|
||||
/**
|
||||
* Get number of stars
|
||||
*/
|
||||
int getStarCount() const { return starCount; }
|
||||
|
||||
private:
|
||||
void generateStars();
|
||||
void createStarBuffers();
|
||||
void destroyStarBuffers();
|
||||
|
||||
float getStarIntensity(float timeOfDay) const;
|
||||
|
||||
std::unique_ptr<Shader> starShader;
|
||||
|
||||
struct Star {
|
||||
glm::vec3 position;
|
||||
float brightness; // 0.3 to 1.0
|
||||
float twinklePhase; // 0 to 2π for animation
|
||||
};
|
||||
|
||||
std::vector<Star> stars;
|
||||
int starCount = 1000;
|
||||
|
||||
uint32_t vao = 0;
|
||||
uint32_t vbo = 0;
|
||||
|
||||
float twinkleTime = 0.0f;
|
||||
bool renderingEnabled = true;
|
||||
};
|
||||
|
||||
} // namespace rendering
|
||||
} // namespace wowee
|
||||
Loading…
Add table
Add a link
Reference in a new issue