Point Light

self:to_local

Client

Converts a world-space position to local-space relative to the point light

Syntax

local local_position = self:to_local(
    global_point
)

Parameters

TypeNameDescription
vector3global_pointPosition in world space as {x, y, z}

Returns

TypeNameDescription
vector3local_positionEquivalent position in local space as {x, y, z}

Examples

Convert a world position to the point light's local space
local entity = light.point.create()
entity:set_position({10, 0, 0})

core.engine.print("info", util.table.unpack(entity:to_local({10, 0, 5})))

On this page