setLightDirection
Cliente
Cambia hacia dónde apunta una luz spot o rect.
bool setLightDirection(light light, float x, y, z)
Parámetros
| Nombre | Tipo | Descripción |
|---|---|---|
| light | light | La luz. |
| x, y, z | float | Hacia dónde apunta la luz. Tres números o un vec3, finito y no nulo; se normaliza. |
Retorno
true si cambió. Con un argumento incorrecto, registra un aviso y devuelve false.
Mientras la luz está enganchada a otro elemento, la dirección es relativa a él. La tangente de una luz rect se rehace perpendicular a la nueva dirección.
Ejemplo
local light = createSpotLight(2495.1, -1687.4, 20, 0, 0, -1, 25)
addEventHandler("onClientRender", root, function()
local angle = getTickCount() / 1000
setLightDirection(light, math.cos(angle), math.sin(angle), -1)
end)AtenciónSolo para luces spot y rect. En una luz point, registra un aviso y devuelve
false.