mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 05:51:51 +00:00
Merge pull request #820 from MihailRis/entity-material-property
Entity material property
This commit is contained in:
commit
b5f5aeb5c6
5 changed files with 13 additions and 0 deletions
|
|
@ -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.
|
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
|
## View
|
||||||
|
|
||||||
### *skeleton-name*
|
### *skeleton-name*
|
||||||
|
|
|
||||||
|
|
@ -112,6 +112,10 @@
|
||||||
|
|
||||||
Определяет максимальную высоту препятствия, на которое сущность может шагнуть без прыжка.
|
Определяет максимальную высоту препятствия, на которое сущность может шагнуть без прыжка.
|
||||||
|
|
||||||
|
### Материал - *material*
|
||||||
|
|
||||||
|
Определяет материал сущности (то же, что и у блоков).
|
||||||
|
|
||||||
## Вид
|
## Вид
|
||||||
|
|
||||||
### Имя скелета - *skeleton-name*
|
### Имя скелета - *skeleton-name*
|
||||||
|
|
|
||||||
|
|
@ -87,6 +87,7 @@ template<> void ContentUnitLoader<EntityDef>::loadUnit(
|
||||||
BodyTypeMeta.getItem(bodyTypeName, def.bodyType);
|
BodyTypeMeta.getItem(bodyTypeName, def.bodyType);
|
||||||
|
|
||||||
root.at("skeleton-name").get(def.skeletonName);
|
root.at("skeleton-name").get(def.skeletonName);
|
||||||
|
root.at("material").get(def.material);
|
||||||
root.at("blocking").get(def.blocking);
|
root.at("blocking").get(def.blocking);
|
||||||
root.at("solid").get(def.solid);
|
root.at("solid").get(def.solid);
|
||||||
root.at("mass").get(def.mass);
|
root.at("mass").get(def.mass);
|
||||||
|
|
|
||||||
|
|
@ -39,6 +39,9 @@ struct EntityDef {
|
||||||
/// @brief Skeleton ID
|
/// @brief Skeleton ID
|
||||||
std::string skeletonName = name;
|
std::string skeletonName = name;
|
||||||
|
|
||||||
|
/// @brief Solid entity material material
|
||||||
|
std::string material;
|
||||||
|
|
||||||
/// @brief Does entity prevent blocks setup
|
/// @brief Does entity prevent blocks setup
|
||||||
bool blocking = true;
|
bool blocking = true;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -87,4 +87,5 @@ void Rigidbody::initialize(
|
||||||
create_sensor_callback<scripting::on_sensor_exit>(entities)};
|
create_sensor_callback<scripting::on_sensor_exit>(entities)};
|
||||||
}
|
}
|
||||||
hitbox.stepHeight = def.stepHeight;
|
hitbox.stepHeight = def.stepHeight;
|
||||||
|
hitbox.material = def.material;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue