3D

PointLight3D

Point 3D light.

Point light with range, color, intensity, cast_shadows, active, and Node3D transform.

Base node: Node3D

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

Fields

colorintensityrangecast_shadowsactive
pub struct PointLight3D {    pub base: Node3D,    pub color: [f32; 3],    pub intensity: f32,    pub range: f32,    pub active: bool,}

Scene template

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

Script API

Create

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

Access / mutate

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