block.raycast/entity.raycast: Updated docs to reflect changes

This commit is contained in:
REDxEYE
2024-08-20 15:33:29 +03:00
parent 1be50c2e06
commit a48d54aa27
4 changed files with 14 additions and 4 deletions
+6 -1
View File
@@ -120,12 +120,17 @@ block.raycast(start: vec3, dir: vec3, max_distance: number, [optional] dest: tab
endpoint: vec3, -- point of the ray hit point
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
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
```
Casts a ray from the start point in the direction of *dir*. Max_distance specifies the maximum ray length.
Argument `filter` can be used to tell ray what blocks can be skipped(passed through) during ray-casting.
To use filter `dest` argument must be filled with some value(can be nil), it's done for backwards compatability
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.