Added editor functionality to edit bound boxes
This commit is contained in:
1 parent
22b0e1992f
commit
4b868f47c2
12 files changed
+779
-307
No files matched your search
@@ -0,0 +1,70 @@
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "render/Renderer.h"
|
||||
#include "navigation/PathFinder.h"
|
||||
#include "items/GameObjectLoader.h"
|
||||
#include <Eigen/Dense>
|
||||
|
||||
namespace ZL {
|
||||
|
||||
class Location; // forward declaration — LocationEditor.cpp includes Location.h
|
||||
|
||||
enum class EditorMode {
|
||||
None,
|
||||
Navigation,
|
||||
InteractiveObjects
|
||||
// GameObjects // future
|
||||
};
|
||||
|
||||
class LocationEditor {
|
||||
public:
|
||||
explicit LocationEditor(Location& location);
|
||||
|
||||
// Navigation editor state
|
||||
std::vector<Eigen::Vector3f> navigationEditorPoints;
|
||||
VertexRenderStruct navigationEditorPointsMesh;
|
||||
std::vector<VertexRenderStruct> navigationEditorNavMeshes;
|
||||
int navigationEditorObstacleCounter = 0;
|
||||
|
||||
// Interactive object editor state
|
||||
std::vector<VertexRenderStruct> interactiveObjectBoundsMeshes;
|
||||
std::vector<VertexRenderStruct> interactionPositionMeshes;
|
||||
int selectedInteractiveObjectIndex = 0;
|
||||
int boundsClickCount = 0; // 0 = waiting for first corner, 1 = waiting for second
|
||||
Eigen::Vector3f boundsClickA = Eigen::Vector3f::Zero();
|
||||
|
||||
// Game object editor state
|
||||
std::vector<GameObjectData> editorPlacedObjects;
|
||||
int editorPlacedObjectCounter = 0;
|
||||
|
||||
// Navigation editor methods
|
||||
void buildNavMeshes();
|
||||
void drawNavigation();
|
||||
void rebuildPointsMesh();
|
||||
void drawPoints();
|
||||
void handleLeftClick(const Eigen::Vector3f& hit, bool ctrlHeld);
|
||||
void handleRightClick();
|
||||
void save();
|
||||
void reload();
|
||||
|
||||
// Interactive object editor methods
|
||||
void buildInteractiveObjectBoundsMeshes();
|
||||
void drawInteractiveObjectBounds();
|
||||
void selectInteractiveObject(int index);
|
||||
void handleInteractiveObjectClick(const Eigen::Vector3f& worldHit, bool ctrlHeld);
|
||||
void saveInteractiveObjects();
|
||||
|
||||
// Save all editor data at once (nav mesh + interactive objects)
|
||||
void saveAll();
|
||||
|
||||
// Game object editor methods
|
||||
void placeTree();
|
||||
void saveObjects();
|
||||
|
||||
private:
|
||||
Location& loc;
|
||||
};
|
||||
|
||||
} // namespace ZL
|
||||
Reference in new issue
Block a user