Open nox opened 6 years ago
Using the slice of bytes was a design decision to decouple Webrender and the WebVR implementation. This allowed for a quicker pull request cycle and avoided dependency version conflicts.
Now that WebGL/WebVR are not included in Webrender we can remove the byte slice conversions and use standard serde serialization.
This method builds a
VRPose
(for thepose
field) out of a slice of bytes, but theVRPose
struct containsOption<f64>
types which don't have a specified layout and most importantly for which not all[u8]
slices represent a valid value.VRPose::from_bytes
should be unsafe.https://github.com/MortimerGoro/rust-webvr/blob/cab969ee734908ebaac7667bbd4cd903e2135dd5/rust-webvr-api/src/vr_frame_data.rs#L54