42 lines
656 B
C++
42 lines
656 B
C++
#pragma once
|
|
|
|
#include "blitz/common/Vector.h"
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
namespace blitz {
|
|
|
|
namespace shader {
|
|
class BulletShader;
|
|
} // namespace shader
|
|
|
|
|
|
namespace render {
|
|
|
|
struct Trail {
|
|
Vec3f m_From;
|
|
Vec3f m_To;
|
|
float m_Decay;
|
|
};
|
|
|
|
|
|
class BulletRenderer {
|
|
private:
|
|
std::vector<Trail> m_Trails;
|
|
std::unique_ptr<shader::BulletShader> m_Shader;
|
|
unsigned int m_Vbo;
|
|
|
|
public:
|
|
BulletRenderer();
|
|
~BulletRenderer();
|
|
|
|
void AddBullet(const Vec3f& origin, const Vec3f& direction);
|
|
void Update(float delta);
|
|
void Render();
|
|
|
|
void UpdateShader(const Mat4f& proj, const Mat4f& trans) const;
|
|
};
|
|
|
|
} // namespace render
|
|
} // namespace blitz
|