Add support for light entities in bridge reification
This commit is contained in:
@@ -156,6 +156,8 @@ impl Reify for BridgeState {
|
||||
2 => "sphere",
|
||||
3 => "3D model",
|
||||
4 => "text",
|
||||
5 => "image",
|
||||
6 => "light",
|
||||
_ => "unknown"
|
||||
};
|
||||
|
||||
@@ -183,6 +185,19 @@ impl Reify for BridgeState {
|
||||
let panel = ast::elements::PanelUI::default();
|
||||
Some(panel.build())
|
||||
}
|
||||
6 => {
|
||||
// Light entity: use asteroids Light element
|
||||
eprintln!("[bridge/reify] Light entity type detected for node {}.", id);
|
||||
let color = ast::elements::RgbaLinear::new(
|
||||
node.color[0], node.color[1], node.color[2], node.color[3]
|
||||
);
|
||||
// Use y dimension as intensity if available, else default to 1.0
|
||||
let intensity = node.dimensions.get(1).copied().unwrap_or(1.0).max(0.01);
|
||||
let light = ast::elements::Light::new()
|
||||
.color(color)
|
||||
.intensity(intensity);
|
||||
Some(light.build())
|
||||
}
|
||||
_ => {
|
||||
match Model::direct(&model_path) {
|
||||
Ok(mut model) => {
|
||||
|
||||
Reference in New Issue
Block a user