Working on path visualization
This commit is contained in:
1 parent
96e748715b
commit
0240721d46
12 files changed
+335
-3
No files matched your search
@@ -0,0 +1,41 @@
|
||||
#pragma once
|
||||
|
||||
#include "render/Renderer.h"
|
||||
|
||||
#include <cstdint>
|
||||
#include <vector>
|
||||
|
||||
namespace FRG {
|
||||
|
||||
class Character;
|
||||
|
||||
class PathVisualization
|
||||
{
|
||||
public:
|
||||
void initialize();
|
||||
void setEnabled(bool enabled);
|
||||
bool isEnabled() const { return enabled; }
|
||||
|
||||
void start(const Character& player, const Eigen::Vector3f& clickedDestination);
|
||||
void cancel();
|
||||
void update(int64_t deltaMs);
|
||||
void draw(Renderer& renderer);
|
||||
|
||||
private:
|
||||
struct Dot {
|
||||
Eigen::Vector3f position = Eigen::Vector3f::Zero();
|
||||
float delayMs = 0.0f;
|
||||
float lifetimeMs = 0.0f;
|
||||
};
|
||||
|
||||
bool enabled = true;
|
||||
bool active = false;
|
||||
float elapsedMs = 0.0f;
|
||||
float durationMs = 0.0f;
|
||||
Eigen::Vector3f destination = Eigen::Vector3f::Zero();
|
||||
std::vector<Dot> dots;
|
||||
VertexRenderStruct dotMesh;
|
||||
VertexRenderStruct destinationMesh;
|
||||
};
|
||||
|
||||
} // namespace FRG
|
||||
Reference in new issue
Block a user