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

+33
View File
@@ -0,0 +1,33 @@
#pragma once
#include <string>
#include <memory>
#include <Eigen/Core>
#include "Item.h"
#include "render/Renderer.h"
namespace ZL {
struct Texture;
struct VertexRenderStruct;
class Renderer;
struct InteractiveObject {
std::string id;
std::string name;
Eigen::Vector3f position;
float interactionRadius;
std::shared_ptr<Texture> texture;
VertexRenderStruct mesh;
Item dropItem;
bool isActive = true;
InteractiveObject() : interactionRadius(2.0f) {}
bool isInRange(const Eigen::Vector3f& playerPos) const {
return (playerPos - position).norm() <= interactionRadius;
}
void draw(Renderer& renderer) const;
};
} // namespace ZL