add english version of the entity-properties.md

This commit is contained in:
MihailRis 2024-07-10 05:15:41 +03:00
parent d40bbff0d3
commit 8db259f3f3
2 changed files with 109 additions and 8 deletions

101
doc/en/entity-properties.md Normal file
View File

@ -0,0 +1,101 @@
# Entity properties
## Logic
### *components*
Defines components and the order in which they are initialized.
```json
"components": [
list of components
]
```
Example:
```json
"components": [
"base:drop"
]
```
The components code should be in `scripts/components`.
## Physics
### *hitbox*
An array of three numbers indicating the size of the entity's hitbox.
Example:
```json
"hitbox": [0.6, 1.8, 0.6]
```
### *body-type*
Determines how the physics engine will work with it.
- *dynamic* - default type. The physics engine calculates movement and collisions.
- *kinematic* - only movement is calculated, without collisions.
### *blocking*
Determines whether the entity blocks installation of blocks.
*In the future will also block other entities movement.*
Default value: *true*.
### *sensors*
A sensor is an area attached to a physical body that detects the entry of other bodies into it.
- When a body enter, the *on_sensor_enter* event is triggered.
- When a body exit, the *on_sensor_exit* event is called.
Sensors are indexed in the same order as they are presented in the list, starting from 0.
The following types (shapes) of sensors exist:
- *radius* is the simplest sensor. Defines the area around the center of the hitbox. The following values are specified:
- radius - number.
- *aabb* - a rectangular area that changes position depending on the rotation of the entity. **The area itself does not rotate.** The following values are specified:
- three numbers x, y, z of the minimal corner of the area.
- three numbers x, y, z of the opposite corner of the area.
Example:
```json
"sensors": [
["aabb", -0.2, -0.2, -0.2, 0.2, 0.2, 0.2],
["radius", 1.6]
]
```
0. A rectangular area with a width, height and length of 0.4 m, centered at 0.0.
1. Radial area with a radius of 1.6 m.
## View
### *skeleton-name*
The default value is the same as the entity name. Determines which skeleton will be used by the entity. See [rigging](rigging.md).
## Saving/Loading
In addition to custom components, the engine automatically saves data from the built-in ones: transform, rigidbody, skeleton.
There is a set of flags that allow you to specify which data will be saved and which will not.
(Boolean values are specified)
| Title | Goal | Default |
| ---------------------- | ---------------------------------------------------- | ------- |
| save | the entity itself | true |
| save-skeleton-pose | skeleton pose | false |
| save-skeleton-textures | dynamically assigned textures | false |
| save-body-velocity | body velocity | true |
| save-body-settings | changed body settings <br>(type, damping, crouching) | false |

View File

@ -8,7 +8,7 @@
```json
"components": [
список компонентов
список компонентов
]
```
@ -16,7 +16,7 @@
```json
"components": [
"base:drop"
"base:drop"
]
```
@ -61,17 +61,17 @@
Существуют следующие типы (формы) сенсоров:
- radius (радиус) - самый простой сенсор. Определяет область вокруг центра хитбокса. Указываются следующие значения:
- радиус - число.
- радиус - число.
- aabb (коробка) - прямоугольная область, меняющая положение в зависимости от поворота сущности. **Сама область не поворачивается.** Указываются следующие значения:
- три числа x, y, z минимального угла области.
- три числа x, y, z противоположного угла области.
- три числа x, y, z минимального угла области.
- три числа x, y, z противоположного угла области.
Пример:
```json
"sensors": [
["aabb", -0.2, -0.2, -0.2, 0.2, 0.2, 0.2],
["radius", 1.6]
["aabb", -0.2, -0.2, -0.2, 0.2, 0.2, 0.2],
["radius", 1.6]
]
```
@ -86,7 +86,7 @@
## Сохранение/загрузка
Кроме данных пользовательских компонентов, движок автоматически сохраняет данные встроенных: transform, rigidbody, modeltree.
Кроме данных пользовательских компонентов, движок автоматически сохраняет данные встроенных: transform, rigidbody, skeleton.
Есть набор флагов, позволяющих указать какие данные будут сохранены, а какие нет.