3D
SpotLight3D
Spot 3D light.
Cone light with range, inner/outer angles, color, intensity, cast_shadows, active, and Node3D transform.
Base node: Node3D
Source: perro_source/core/perro_nodes/src/nodes/lights_3d.rs
Fields
colorintensityrangeinner_angle_radiansouter_angle_radianscast_shadowsactive
pub struct SpotLight3D { pub base: Node3D, pub color: [f32; 3], pub intensity: f32, pub range: f32, pub inner_angle_radians: f32, pub outer_angle_radians: f32,}Scene template
[node_instance]tags = ["runtime", "demo"]parent = @rootscript = "res://script.rs"script_vars = { speed = 4.0, health = 100 } [SpotLight3D] color = #ffffff intensity = 1.0 range = 1.0 inner_angle_radians = 0.0 outer_angle_radians = 0.0 [/SpotLight3D][/node_instance]Script API
Create
let node_id = create_node!(ctx, SpotLight3D, "Spawned Node", ["enemy", "runtime"], parent_id);Access / mutate
let value = with_node!(ctx, SpotLight3D, node_id, |node| { node.color}); let pair = with_node!(ctx, SpotLight3D, node_id, |node| { (node.color, node.intensity)}); with_node_mut!(ctx, SpotLight3D, node_id, |node| { node.color = Color::new(1.0, 1.0, 1.0, 1.0);});