本文整理汇总了C++中SensorFusion::GetPredictedOrientation方法的典型用法代码示例。如果您正苦于以下问题:C++ SensorFusion::GetPredictedOrientation方法的具体用法?C++ SensorFusion::GetPredictedOrientation怎么用?C++ SensorFusion::GetPredictedOrientation使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SensorFusion
的用法示例。
在下文中一共展示了SensorFusion::GetPredictedOrientation方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: IN_MotionSensor_Read
void IN_MotionSensor_Read(float &roll, float &pitch, float &yaw)
{
if (SFusion.IsAttachedToSensor()) {
float predictionDelta = in_sensorPrediction.GetFloat() * (1.0f / 1000.0f);
if (SFusion.GetPredictionDelta() != predictionDelta)
{
SFusion.SetPrediction(predictionDelta);
}
Quatf hmdOrient = SFusion.GetPredictedOrientation();
float y = 0.0f, p = 0.0f, r = 0.0f;
hmdOrient.GetEulerAngles<Axis_Y, Axis_X, Axis_Z>(&y, &p, &r);
roll = -RADIANS_TO_DEGREES(r); // ???
pitch = -RADIANS_TO_DEGREES(p); // should be degrees down
yaw = RADIANS_TO_DEGREES(y); // should be degrees left
} else if (hasVR920Tracker && IWRGetTracking) {
LONG y=0, p=0, r=0;
if (IWRGetTracking(&y, &p, &r)==ERROR_SUCCESS) {
yaw = y * 180.0f/32767.0f;
pitch = p * -180.0f/32767.0f;
roll = r * 180.0f/32767.0f;
}
} else {
roll = angles[ROLL];
pitch = angles[PITCH];
yaw = angles[YAW];
}
}
示例2:
JNIEXPORT void JNICALL Java_de_fruitfly_ovr_OculusRift_pollSubsystem(JNIEnv *, jobject) {
if (!Initialized) return;
if (!pSensor) return;
bool isPredictionEnabled = FusionResult.IsPredictionEnabled();
if (isPredictionEnabled)
quaternion = FusionResult.GetPredictedOrientation();
else
quaternion = FusionResult.GetOrientation();
quaternion.GetEulerAngles<Axis_Y, Axis_X, Axis_Z>(&yaw, &pitch, &roll);
}
示例3:
__declspec(dllexport) void get_orientation(float *yaw, float *pitch, float *roll) {
Quatf hmdOrient = SFusion.GetPredictedOrientation();
hmdOrient.GetEulerAngles<Axis_Y, Axis_X, Axis_Z>(yaw, pitch, roll);
}