fix: integrate Spatial elements into ModelWrapper construction in BridgeState reification
This commit is contained in:
@@ -10,7 +10,7 @@ use glam::Mat4;
|
|||||||
use stardust_xr_asteroids as ast; // alias for brevity
|
use stardust_xr_asteroids as ast; // alias for brevity
|
||||||
use stardust_xr_asteroids::{
|
use stardust_xr_asteroids::{
|
||||||
client::ClientState,
|
client::ClientState,
|
||||||
elements::{PlaySpace, Model, Lines},
|
elements::{PlaySpace, Model, Lines, Spatial},
|
||||||
Migrate, Reify,
|
Migrate, Reify,
|
||||||
};
|
};
|
||||||
use stardust_xr_asteroids::{CustomElement, Transformable, Projector, Context};
|
use stardust_xr_asteroids::{CustomElement, Transformable, Projector, Context};
|
||||||
@@ -196,7 +196,9 @@ impl Reify for BridgeState {
|
|||||||
// Box entity - use tex_cube model
|
// Box entity - use tex_cube model
|
||||||
Some((
|
Some((
|
||||||
*id,
|
*id,
|
||||||
ModelWrapper::builtin("tex_cube", transform, node_color).build()
|
Spatial::default().build().child(
|
||||||
|
ModelWrapper::builtin("tex_cube", transform, node_color).build()
|
||||||
|
)
|
||||||
))
|
))
|
||||||
},
|
},
|
||||||
2 => {
|
2 => {
|
||||||
@@ -208,14 +210,18 @@ impl Reify for BridgeState {
|
|||||||
let sphere_transform = Transform::from_translation_rotation_scale(trans_array, rot_array, uniform_scale_array);
|
let sphere_transform = Transform::from_translation_rotation_scale(trans_array, rot_array, uniform_scale_array);
|
||||||
Some((
|
Some((
|
||||||
*id,
|
*id,
|
||||||
ModelWrapper::builtin("tex_cube", sphere_transform, node_color).build()
|
Spatial::default().build().child(
|
||||||
|
ModelWrapper::builtin("tex_cube", sphere_transform, node_color).build()
|
||||||
|
)
|
||||||
))
|
))
|
||||||
},
|
},
|
||||||
3 if !node.model_url.is_empty() => {
|
3 if !node.model_url.is_empty() => {
|
||||||
// Model entity - use gyro as placeholder (or try to load from URL)
|
// Model entity - use gyro as placeholder (or try to load from URL)
|
||||||
Some((
|
Some((
|
||||||
*id,
|
*id,
|
||||||
ModelWrapper::builtin("gyro", transform, node_color).build()
|
Spatial::default().build().child(
|
||||||
|
ModelWrapper::builtin("gyro", transform, node_color).build()
|
||||||
|
)
|
||||||
))
|
))
|
||||||
},
|
},
|
||||||
_ => {
|
_ => {
|
||||||
@@ -223,7 +229,9 @@ impl Reify for BridgeState {
|
|||||||
let default_color = rgba_linear!(0.6, 0.6, 0.6, 0.8);
|
let default_color = rgba_linear!(0.6, 0.6, 0.6, 0.8);
|
||||||
Some((
|
Some((
|
||||||
*id,
|
*id,
|
||||||
ModelWrapper::builtin("tex_cube", transform, default_color).build()
|
Spatial::default().build().child(
|
||||||
|
ModelWrapper::builtin("tex_cube", transform, default_color).build()
|
||||||
|
)
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user