mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 13:31:49 +00:00
block.raycast: fix documentation
This commit is contained in:
parent
a48d54aa27
commit
615dd23913
2 changed files with 2 additions and 6 deletions
|
|
@ -115,14 +115,12 @@ Set specified bits.
|
||||||
## Raycast
|
## Raycast
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
block.raycast(start: vec3, dir: vec3, max_distance: number, [optional] dest: table) -> {
|
block.raycast(start: vec3, dir: vec3, max_distance: number, [optional] dest: table, [optional] filter: table) -> {
|
||||||
block: int, -- block id
|
block: int, -- block id
|
||||||
endpoint: vec3, -- point of the ray hit point
|
endpoint: vec3, -- point of the ray hit point
|
||||||
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, -- table where result will be written to instead of function return
|
|
||||||
[optional] filter: table -- list of block names that are "transparent" for ray
|
|
||||||
} or nil
|
} or nil
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,14 +60,12 @@ block.get_picking_item(id: int) -> int
|
||||||
### Raycast
|
### Raycast
|
||||||
|
|
||||||
```lua
|
```lua
|
||||||
block.raycast(start: vec3, dir: vec3, max_distance: number, [опционально] dest: table) -> {
|
block.raycast(start: vec3, dir: vec3, max_distance: number, [опционально] dest: table, [опционально] filter: table) -> {
|
||||||
block: int, -- id блока
|
block: int, -- id блока
|
||||||
endpoint: vec3, -- точка касания луча
|
endpoint: vec3, -- точка касания луча
|
||||||
iendpoint: vec3, -- позиция блока, которого касается луч
|
iendpoint: vec3, -- позиция блока, которого касается луч
|
||||||
length: number, -- длина луча
|
length: number, -- длина луча
|
||||||
normal: vec3, -- вектор нормали поверхности, которой касается луч
|
normal: vec3, -- вектор нормали поверхности, которой касается луч
|
||||||
[optional] dest: table, -- таблица куда будет записан результат вместо возврата из функции
|
|
||||||
[optional] filter: table -- массив имён блоков которые "прозрачны" для луча
|
|
||||||
} или nil
|
} или nil
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue