Spot Light
self:to_local
ClientConverts a world-space position to local-space relative to the spot light
Syntax
local local_position = self:to_local(
global_point
)Parameters
| Type | Name | Description |
|---|---|---|
vector3 | global_point | Position in world space as {x, y, z} |
Returns
| Type | Name | Description |
|---|---|---|
vector3 | local_position | Equivalent position in local space as {x, y, z} |
Examples
local entity = light.spot.create()
entity:set_position({10, 0, 0})
core.engine.print("info", util.table.unpack(entity:to_local({10, 0, 5})))