33 lines
664 B
C++
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
|