Exemplo n.º 1
0
void OculusVRSensorData::setData(const OVR::SensorFusion& data, const F32& maxAxisRadius)
{
   // Sensor rotation
   OVR::Quatf orientation;
   if(data.GetPredictionDelta() > 0)
   {
      orientation = data.GetPredictedOrientation();
   }
   else
   {
      orientation = data.GetOrientation();
   }
   OVR::Matrix4f orientMat(orientation);
   OculusVRUtil::convertRotation(orientMat.M, mRot);
   mRotQuat.set(mRot);

   // Sensor rotation in Euler format
   OculusVRUtil::convertRotation(orientation, mRotEuler);

   // Sensor rotation as axis
   OculusVRUtil::calculateAxisRotation(mRot, maxAxisRadius, mRotAxis);

   mDataSet = true;
}
 void update() {
   actual = ovrSensorFusion.GetOrientation();
   predicted = ovrSensorFusion.GetPredictedOrientation();
 }
 void update() {
   currentOrientation = Rift::fromOvr(sensorFusion.GetOrientation());
   predictedOrientation = Rift::fromOvr(sensorFusion.GetPredictedOrientation());
 }