MCPcopy Create free account
hub / github.com/ValveSoftware/openvr / HmdQuaternion_Normalize

Function HmdQuaternion_Normalize

samples/drivers/utils/vrmath/vrmath.h:83–94  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

81}
82
83static vr::HmdQuaternion_t HmdQuaternion_Normalize( const vr::HmdQuaternion_t &q )
84{
85 vr::HmdQuaternion_t result{};
86 double n = sqrt( q.x * q.x + q.y * q.y + q.z * q.z + q.w * q.w );
87
88 result.w = q.w / n;
89 result.x = q.x / n;
90 result.y = q.y / n;
91 result.z = q.z / n;
92
93 return result;
94}
95
96static vr::HmdQuaternion_t HmdQuaternion_FromEulerAngles(double roll, double pitch, double yaw) {
97 double cr = cos(roll * 0.5);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected