Open Dudecake opened 3 years ago
apart from that struct change, everything else looks ok at first glance, didn't check it with actual hardware yet
i recommend you compile it, and at least test is with real hardware for while before merging this
just dropping by, did anyone try this with actual hardware?
I haven't had the time to source the components for a unit for me, so I wasn't able to test it. I figured the changes weren't radical enough and the reviewer would still need to test it themselves over trusting me on my (proverbial) blue eyes.
Notable fixes
Fixed array out-of-range in
Normalize
In
Normalize
an attempt is made te read index 3 of a c-array of length 3Replaced the c-arrays of
std::atomic<float>
withstd::array<float>
guarded by locksWith how the quaternions were copied, race conditions were still possible. Especially in
Relativty::HMDDriver::calibrate_quaternion
.Relativty::HMDDriver::qconj
was only written to inRelativty::HMDDriver::calibrate_quaternion
, so locking that is a waste.Replaced assignments to quaternion arrays with
std::copy
s and astd::transform
The compiler can optionally optimise
std::copy
s tomemcpy
s or vector operations.Replaced calls to
Relativty::HmdQuaternion_Init
with braced initializationRename
Relativty::ServerDriver::HMDDriver
tom_HMDDriver
The distinction between the class and the instance couldn't be made otherwise. No idea how MSVC handled that...
Replaced
NULL
s with eithernullptr
s or0
sSome
NULL
s imply the arguments are pointers when they areint
sVarious formatting changes and renamed
Relativty::HMDDriver::new_vector_avaiable
toRelativty::HMDDriver::new_vector_available