update block.raycast docs
This commit is contained in:
parent
9cec475866
commit
498b4c3694
@ -489,13 +489,16 @@ block.raycast(start: vec3, dir: vec3, max_distance: number) -> {
|
|||||||
iendpoint: vec3, -- position of the block hit by the ray
|
iendpoint: vec3, -- position of the block hit by the ray
|
||||||
length: number, -- ray length
|
length: number, -- ray length
|
||||||
normal: vec3, -- normal vector of the surface hit by the ray
|
normal: vec3, -- normal vector of the surface hit by the ray
|
||||||
|
[optional] dest: table -- destination table
|
||||||
} or nil
|
} 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 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
|
## *item* library
|
||||||
|
|
||||||
```python
|
```python
|
||||||
|
|||||||
@ -409,6 +409,7 @@ block.raycast(start: vec3, dir: vec3, max_distance: number) -> {
|
|||||||
iendpoint: vec3, -- позиция блока, которого касается луч
|
iendpoint: vec3, -- позиция блока, которого касается луч
|
||||||
length: number, -- длина луча
|
length: number, -- длина луча
|
||||||
normal: vec3, -- вектор нормали поверхности, которой касается луч
|
normal: vec3, -- вектор нормали поверхности, которой касается луч
|
||||||
|
[опционально] dest: table -- целевая таблица
|
||||||
} или nil
|
} или nil
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -416,6 +417,8 @@ block.raycast(start: vec3, dir: vec3, max_distance: number) -> {
|
|||||||
|
|
||||||
Функция возвращает таблицу с результатами или nil, если луч не касается блока.
|
Функция возвращает таблицу с результатами или nil, если луч не касается блока.
|
||||||
|
|
||||||
|
Для результата будет использоваться целевая таблица вместо создания новой, если указан опциональный аргумент.
|
||||||
|
|
||||||
### Вращение
|
### Вращение
|
||||||
|
|
||||||
Следующие функции используется для учёта вращения блока при обращении к соседним блокам или других целей, где направление блока имеет решающее значение.
|
Следующие функции используется для учёта вращения блока при обращении к соседним блокам или других целей, где направление блока имеет решающее значение.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user