From 498b4c369479ca947650c18b31b1aebc8d1e47db Mon Sep 17 00:00:00 2001 From: MihailRis Date: Sun, 14 Jul 2024 13:21:13 +0300 Subject: [PATCH] update block.raycast docs --- doc/en/scripting.md | 5 ++++- doc/ru/scripting.md | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/doc/en/scripting.md b/doc/en/scripting.md index d27a1dd8..6d185735 100644 --- a/doc/en/scripting.md +++ b/doc/en/scripting.md @@ -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 diff --git a/doc/ru/scripting.md b/doc/ru/scripting.md index 7d89e4f6..60bd855d 100644 --- a/doc/ru/scripting.md +++ b/doc/ru/scripting.md @@ -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, если луч не касается блока. +Для результата будет использоваться целевая таблица вместо создания новой, если указан опциональный аргумент. + ### Вращение Следующие функции используется для учёта вращения блока при обращении к соседним блокам или других целей, где направление блока имеет решающее значение.