light objects can be fixed to model or body objects. This makes the globalTransform of the light object the affixer transform multiplied by the offsetTransform of the light object.light object is not fixed to an object, then the initial transform will be the parent node object tranform.type string: The class type of the object. A light will either have this be "pointLight" or "spotLight".node node object: The parent node of the light.name string: The name of the light.offsetTransform transform object: The local transform of the light.globalTransform transform object: The final transform of the light.range number: How far the light will be visible.affixer model or body object: The object that the light is locked to.hasShadows bool: Whether shadows are enabled or disabled for the light.angle number: The angular range of the light.color vector3: The color of the light.light object is done by passing in a node object and an array.
LGE.Light(
myNode,
{
light_name = myName, [string] -- Optional
light_color = myColor, [vector3] -- Optional, defaulted to (1, 1, 1)
light_range = myRange, [number] -- Optional, defaulted to 15
light_angle = myAngle, [number] -- Optional, defaulted to 30
light_type = myType, [string] -- Optional, can either be "spotLight" or "pointLight", defaulted to "pointLight"
light_hasShadows = shadowsEnabled [bool] -- Optional, defaulted to false
}
)
Light:setAffixer(attachment [model or body object])
Light:setAngle(number [number])
Light:setShadows(bool [bool])
vector3 that the light is rotated toward.
Light:getTarget()
globalTransform, pose, and view information of the light for use in shadowmapping.
Light:update()
globalTransform of the light.
Light:updateGlobalTransform()
Light:drawDebug(pass [lovr pass] color [optional vector3 or vector4])