shadow-over-bishkek001/src/items/InteractiveObject.h
2026-04-09 15:33:55 +06:00

33 lines
664 B
C++

#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