update block.raycast docs

This commit is contained in:
MihailRis 2024-07-14 13:21:13 +03:00
parent 9cec475866
commit 498b4c3694
2 changed files with 7 additions and 1 deletions

View File

@ -489,13 +489,16 @@ block.raycast(start: vec3, dir: vec3, max_distance: number) -> {
iendpoint: vec3, -- position of the block hit by the ray
length: number, -- ray length
normal: vec3, -- normal vector of the surface hit by the ray
[optional] dest: table -- destination table
} or nil
```
Casts a ray from the start point in the direction of dir. Max_distance specifies the maximum ray length.
Casts a ray from the start point in the direction of *dir*. Max_distance specifies the maximum ray length.
The function returns a table with the results or nil if the ray does not hit any block.
The result will use the destination table instead of creating a new one if the optional argument specified.
## *item* library
```python

View File

@ -409,6 +409,7 @@ block.raycast(start: vec3, dir: vec3, max_distance: number) -> {
iendpoint: vec3, -- позиция блока, которого касается луч
length: number, -- длина луча
normal: vec3, -- вектор нормали поверхности, которой касается луч
[опционально] dest: table -- целевая таблица
} или nil
```
@ -416,6 +417,8 @@ block.raycast(start: vec3, dir: vec3, max_distance: number) -> {
Функция возвращает таблицу с результатами или nil, если луч не касается блока.
Для результата будет использоваться целевая таблица вместо создания новой, если указан опциональный аргумент.
### Вращение
Следующие функции используется для учёта вращения блока при обращении к соседним блокам или других целей, где направление блока имеет решающее значение.