LegacyLight
Note: This class is only compatible with Legacy Drawing.
| Function | Description |
|---|---|
| LegacyLight.new() | Creates a default legacy light |
LegacyLight.new(LegacyLight other) |
Creates a copy of another legacy light |
LegacyLight.new(int type) |
Creates a light of specified type, see LEGACY_LIGHT_TYPE |
LegacyLight.new(Vector3D position) |
Creates a light at the specified position |
LegacyLight.new(int type, Vector3D position, Vector3D rotation, Vector4D color) |
Full constructor with type, transform, and color |
| Property | Type | Description |
|---|---|---|
| .position | Vector3D | Light position |
| .rotation | Vector3D | Light rotation |
| .type | int | Light type; see LEGACY_LIGHT_TYPE |
| .radius | float | Light radius |
| .cones | Vector2D | Inner and outer cone angles |
| .attenuation | Vector3D | Attenuation factors (constant, linear, quadratic) |
| .falloff | float | Light falloff intensity |
| .diffuseColor | Vector4D | Diffuse (main) color |
| .ambientColor | Vector4D | Ambient color |
| .specularColor | Vector4D | Specular highlight color |
| .debug | bool | Enable/disable debug visualization |
| .active | bool | Whether the light is active in rendering |
| Function | Returns | Description |
|---|---|---|
| :destroy() | Destroys the object | |
:setParent(3DObject other) |
Parents this light to another 3D object | |
| :getAbsolutePosition() | Vector3D | Returns world position |
| :getAbsoluteRotation() | Vector3D | Returns world rotation |
| :getAbsoluteScale() | Vector3D | Returns world scale |
| :updateAbsolutePosition() | Updates world transform (non-recursive) |