3D

AmbientLight3D

Ambient 3D light.

Global ambient light data: color, intensity, cast_shadows, active.

Base node: Node3D

Source: perro_source/core/perro_nodes/src/nodes/lights_3d.rs

Fields

colorintensitycast_shadowsactive
pub struct AmbientLight3D {    pub color: [f32; 3],    pub intensity: f32,    pub cast_shadows: bool,    pub active: bool,}

Scene template

[node_instance]tags = ["runtime", "demo"]parent = @rootscript = "res://script.rs"script_vars = { speed = 4.0, health = 100 }   [AmbientLight3D]    color = #ffffff    intensity = 1.0    cast_shadows = 0    active = true  [/AmbientLight3D][/node_instance]

Script API

Create

let node_id = create_node!(ctx, AmbientLight3D, "Spawned Node", ["enemy", "runtime"], parent_id);

Access / mutate

let value = with_node!(ctx, AmbientLight3D, node_id, |node| {    node.color}); let pair = with_node!(ctx, AmbientLight3D, node_id, |node| {    (node.color, node.intensity)}); with_node_mut!(ctx, AmbientLight3D, node_id, |node| {    node.color = Color::new(1.0, 1.0, 1.0, 1.0);});