inline void GjkCollisionState::compute_vector(int bits, VectorF& v) { F32 sum = 0; v.set(0, 0, 0); for (int i = 0, bit = 1; i < 4; ++i, bit <<= 1) { if (bits & bit) { sum += det[bits][i]; v += y[i] * det[bits][i]; } } v *= 1 / sum; }
void convertMagnetometer(OVR::Vector3f& inMagnetometer, VectorF& outMagnetometer) { outMagnetometer.set(inMagnetometer.x, -inMagnetometer.z, inMagnetometer.y); }
void convertAcceleration(OVR::Vector3f& inAcceleration, VectorF& outAcceleration) { outAcceleration.set(inAcceleration.x, -inAcceleration.z, inAcceleration.y); }