mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
Merge pull request #299 from REDxEYE/definition_clone
Add support for `parent` field in block/item/entity json definitions
This commit is contained in:
commit
5500fe34ac
9 changed files with 262 additions and 41 deletions
12
src/objects/EntityDef.cpp
Normal file
12
src/objects/EntityDef.cpp
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
#include "EntityDef.hpp"
|
||||
void EntityDef::cloneTo(EntityDef& dst) {
|
||||
dst.components = components;
|
||||
dst.bodyType = bodyType;
|
||||
dst.hitbox = hitbox;
|
||||
dst.boxSensors = boxSensors;
|
||||
dst.radialSensors = radialSensors;
|
||||
dst.skeletonName = skeletonName;
|
||||
dst.blocking = blocking;
|
||||
dst.save = save;
|
||||
|
||||
}
|
||||
|
|
@ -24,12 +24,12 @@ struct EntityDef {
|
|||
|
||||
/// @brief Hitbox size
|
||||
glm::vec3 hitbox {0.25f};
|
||||
|
||||
|
||||
/// @brief 'aabb' sensors
|
||||
std::vector<std::pair<size_t, AABB>> boxSensors {};
|
||||
/// @brief 'radius' sensors
|
||||
std::vector<std::pair<size_t, float>> radialSensors {};
|
||||
|
||||
|
||||
/// @brief Skeleton ID
|
||||
std::string skeletonName = name;
|
||||
|
||||
|
|
@ -56,4 +56,6 @@ struct EntityDef {
|
|||
|
||||
EntityDef(const std::string& name) : name(name) {}
|
||||
EntityDef(const EntityDef&) = delete;
|
||||
void cloneTo(EntityDef& dst);
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue