voxelcore/src/objects/EntityDef.hpp
2024-07-06 02:55:19 +03:00

43 lines
952 B
C++

#ifndef OBJECTS_ENTITY_DEF_HPP_
#define OBJECTS_ENTITY_DEF_HPP_
#include <string>
#include <vector>
#include <glm/glm.hpp>
#include "../typedefs.hpp"
#include "../maths/aabb.hpp"
namespace rigging {
class RigConfig;
}
struct EntityDef {
/// @brief Entity string id (with prefix included)
std::string const name;
std::vector<std::string> components;
glm::vec3 hitbox {0.5f};
std::vector<std::pair<size_t, AABB>> boxTriggers {};
std::vector<std::pair<size_t, float>> radialTriggers {};
std::string rigName = name.substr(name.find(":") + 1);
struct {
bool enabled = true;
struct {
bool textures = false;
bool pose = false;
} rig;
} save {};
struct {
entityid_t id;
rigging::RigConfig* rig;
} rt {};
EntityDef(const std::string& name) : name(name) {}
EntityDef(const EntityDef&) = delete;
};
#endif // OBJECTS_ENTITY_DEF_HPP_