From d1cecb02401f515bd1a6db267841b8d86047209e Mon Sep 17 00:00:00 2001 From: MayaTheShy Date: Sat, 8 Nov 2025 21:17:30 -0500 Subject: [PATCH] fix: update transform creation to use array types for translation, rotation, and scale in BridgeState reification --- bridge/src/lib.rs | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/bridge/src/lib.rs b/bridge/src/lib.rs index 50bb7ce..b353f95 100644 --- a/bridge/src/lib.rs +++ b/bridge/src/lib.rs @@ -181,12 +181,11 @@ impl Reify for BridgeState { // Use entity color if set let node_color = rgba_linear!(node.color[0], node.color[1], node.color[2], node.color[3]); - // Create transform - convert glam types to fusion types - use stardust_xr_fusion::values::{Vector3, Quaternion}; - let translation_vec = Vector3 { x: trans.x, y: trans.y, z: trans.z }; - let rotation_quat = Quaternion { x: rot.x, y: rot.y, z: rot.z, w: rot.w }; - let scale_vec = Vector3 { x: vis_scale.x, y: vis_scale.y, z: vis_scale.z }; - let transform = Transform::from_translation_rotation_scale(translation_vec, rotation_quat, scale_vec); + // Create transform - convert glam Vec3/Quat to [f32; 3]/[f32; 4] which implement Into + let trans_array = [trans.x, trans.y, trans.z]; + let rot_array = [rot.x, rot.y, rot.z, rot.w]; + let scale_array = [vis_scale.x, vis_scale.y, vis_scale.z]; + let transform = Transform::from_translation_rotation_scale(trans_array, rot_array, scale_array); // Entity types: 0=Unknown, 1=Box, 2=Sphere, 3=Model match node.entity_type { @@ -199,12 +198,11 @@ impl Reify for BridgeState { }, 2 => { // Sphere entity - use tex_cube with uniform scale to approximate - use stardust_xr_fusion::values::{Vector3, Quaternion}; let avg_scale = (vis_scale.x + vis_scale.y + vis_scale.z) / 3.0; - let translation_vec = Vector3 { x: trans.x, y: trans.y, z: trans.z }; - let rotation_quat = Quaternion { x: rot.x, y: rot.y, z: rot.z, w: rot.w }; - let uniform_scale_vec = Vector3 { x: avg_scale, y: avg_scale, z: avg_scale }; - let sphere_transform = Transform::from_translation_rotation_scale(translation_vec, rotation_quat, uniform_scale_vec); + let trans_array = [trans.x, trans.y, trans.z]; + let rot_array = [rot.x, rot.y, rot.z, rot.w]; + let uniform_scale_array = [avg_scale, avg_scale, avg_scale]; + let sphere_transform = Transform::from_translation_rotation_scale(trans_array, rot_array, uniform_scale_array); Some(( *id, ModelWrapper::builtin("tex_cube", sphere_transform, node_color).build()