diff --git a/doc/en/entity-properties.md b/doc/en/entity-properties.md index bb12dcd86..8bc4d5d37 100644 --- a/doc/en/entity-properties.md +++ b/doc/en/entity-properties.md @@ -112,6 +112,10 @@ Defines the entity's elasticity (affects the bounce on collision). Defines the maximum height of an obstacle an entity can step onto without jumping. +### *material* + +Defines the entity's material (same as for blocks). + ## View ### *skeleton-name* diff --git a/doc/ru/entity-properties.md b/doc/ru/entity-properties.md index 50b3b1499..c66f0141f 100644 --- a/doc/ru/entity-properties.md +++ b/doc/ru/entity-properties.md @@ -112,6 +112,10 @@ Определяет максимальную высоту препятствия, на которое сущность может шагнуть без прыжка. +### Материал - *material* + +Определяет материал сущности (то же, что и у блоков). + ## Вид ### Имя скелета - *skeleton-name* diff --git a/src/content/loading/EntityLoader.cpp b/src/content/loading/EntityLoader.cpp index 91967ea89..5741b2079 100644 --- a/src/content/loading/EntityLoader.cpp +++ b/src/content/loading/EntityLoader.cpp @@ -87,6 +87,7 @@ template<> void ContentUnitLoader::loadUnit( BodyTypeMeta.getItem(bodyTypeName, def.bodyType); root.at("skeleton-name").get(def.skeletonName); + root.at("material").get(def.material); root.at("blocking").get(def.blocking); root.at("solid").get(def.solid); root.at("mass").get(def.mass); diff --git a/src/objects/EntityDef.hpp b/src/objects/EntityDef.hpp index 195d07a17..6ecb1c917 100644 --- a/src/objects/EntityDef.hpp +++ b/src/objects/EntityDef.hpp @@ -39,6 +39,9 @@ struct EntityDef { /// @brief Skeleton ID std::string skeletonName = name; + /// @brief Solid entity material material + std::string material; + /// @brief Does entity prevent blocks setup bool blocking = true; diff --git a/src/objects/Rigidbody.cpp b/src/objects/Rigidbody.cpp index 2c885f8e0..2426aabac 100644 --- a/src/objects/Rigidbody.cpp +++ b/src/objects/Rigidbody.cpp @@ -87,4 +87,5 @@ void Rigidbody::initialize( create_sensor_callback(entities)}; } hitbox.stepHeight = def.stepHeight; + hitbox.material = def.material; }