A multiplayer VR framework w/voice chat
1use bevy::transform::components::Transform;
2use unity_asset_binary::object::UnityObject;
3
4use crate::unity::unity_value::{unity_value_to_quat, unity_value_to_vec3};
5
6pub fn into_bevy_transform(value: UnityObject) -> Transform {
7 let position = value.get("m_LocalPosition").unwrap();
8 let rotation = value.get("m_LocalRotation").unwrap();
9 let scale = value.get("m_LocalScale").unwrap();
10
11 Transform {
12 translation: unity_value_to_vec3(position),
13 rotation: unity_value_to_quat(rotation),
14 scale: unity_value_to_vec3(scale)
15 }
16}