コード例 #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;
}
コード例 #2
0
 void update() {
   actual = ovrSensorFusion.GetOrientation();
   predicted = ovrSensorFusion.GetPredictedOrientation();
 }
コード例 #3
0
 void update() {
   currentOrientation = Rift::fromOvr(sensorFusion.GetOrientation());
   predictedOrientation = Rift::fromOvr(sensorFusion.GetPredictedOrientation());
 }