added inventory & active object

This commit is contained in:
Vlad committed 2026-04-09 15:33:55 +06:00
1 parent e1b491be73
commit b3fda88784
16 files changed
+793 -98

No files matched your search

+15 -3
View File
@@ -10,6 +10,8 @@
#include "Projectile.h"
#include "utils/TaskManager.h"
#include "items/GameObjectLoader.h"
#include "items/Item.h"
#include "items/InteractiveObject.h"
#include <queue>
#include <vector>
#include <string>
@@ -61,12 +63,24 @@ namespace ZL {
std::shared_ptr<Texture> benchTexture;
VertexRenderStruct benchMesh;
*/
std::vector<InteractiveObject> interactiveObjects;
Inventory inventory;
InteractiveObject* pickedUpObject = nullptr;
// Interactive object targeting
InteractiveObject* targetInteractiveObject = nullptr;
bool inventoryOpen = false;
std::unique_ptr<Character> player;
std::vector<std::unique_ptr<Character>> npcs;
float cameraAzimuth = 0.0f;
float cameraInclination = M_PI * 30.f / 180.f;
// Public access for ScriptEngine
MenuManager menuManager;
ScriptEngine scriptEngine;
private:
bool rightMouseDown = false;
int lastMouseX = 0;
@@ -83,6 +97,7 @@ namespace ZL {
void handleDown(int64_t fingerId, int mx, int my);
void handleUp(int64_t fingerId, int mx, int my);
void handleMotion(int64_t fingerId, int mx, int my);
InteractiveObject* raycastInteractiveObjects(const Eigen::Vector3f& rayOrigin, const Eigen::Vector3f& rayDir);
#ifdef EMSCRIPTEN
static Game* s_instance;
@@ -97,9 +112,6 @@ namespace ZL {
static const size_t CONST_TIMER_INTERVAL = 10;
static const size_t CONST_MAX_TIME_INTERVAL = 1000;
MenuManager menuManager;
ScriptEngine scriptEngine;
};