Riferimento API di nanos world Documentazione italiana non ufficiale
Documentazione ufficiale
Costruttore Condiviso

Light.Default Constructor

Sintassi

Lua
Light(location, rotation = Rotator(0, 0, 0), color = Color(1, 1, 1), light_type = LightType.Point, intensity = 30, attenuation_radius = 250, cone_angle = 44, inner_cone_angle_percent = 0, max_draw_distance = 10000, use_inverse_squared_falloff = true, cast_shadows = true, visible = true, source_radius = 2, spawn_mode = SpawnMode.Immediate)

Parametri

Nome Tipo Predefinito Descrizione
location Vector
rotation facoltativo Rotator Rotator(0, 0, 0) Relevant only for Rect and Spot LightTypes
color facoltativo Color Color(1, 1, 1)
light_type facoltativo LightType LightType.Point
intensity facoltativo float 30
attenuation_radius facoltativo float 250
cone_angle facoltativo float 44 Relevant only for Spot LightType
inner_cone_angle_percent facoltativo float 0 Inner Cone Angle Percent (Relevant only for Spot LightType) (0-1)
max_draw_distance facoltativo float 10000 Max Draw Distance (Good for performance) - 0 for infinite
use_inverse_squared_falloff facoltativo boolean true Whether to use physically based inverse squared distance falloff, where Attenuation Radius is only clamping the light's contribution. (Spot and Point types only)
cast_shadows facoltativo boolean true
visible facoltativo boolean true
source_radius facoltativo float 2 Radius of light source shape. (Spot and Point types only)
spawn_mode facoltativo SpawnMode SpawnMode.Immediate Pass <code>SpawnMode.AfterConstructor</code> or <code>SpawnMode.Manual</code> to avoid immediately sending the entity to clients and improve performance when you want to configure it by setting several configs. Must call <code>FinishSpawn()</code> after all