本文整理汇总了C++中SensorFusion::SetPrediction方法的典型用法代码示例。如果您正苦于以下问题:C++ SensorFusion::SetPrediction方法的具体用法?C++ SensorFusion::SetPrediction怎么用?C++ SensorFusion::SetPrediction使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SensorFusion
的用法示例。
在下文中一共展示了SensorFusion::SetPrediction方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
JNIEXPORT void JNICALL Java_de_fruitfly_ovr_OculusRift__1setPredictionEnabled(JNIEnv *, jobject, jfloat delta, jboolean enable)
{
if (Initialized)
{
FusionResult.SetPrediction(delta, enable);
}
}
示例2: 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];
}
}
示例3: InitRiftApi
extern "C" RIFTAPI_API int InitRiftApi()
{
OVR::System::Init();
pManager = *DeviceManager::Create();
pHMD = *pManager->EnumerateDevices<HMDDevice>().CreateDevice();
if (!pHMD)
{
return 0 ;
}
pSensor = *pHMD->GetSensor();
// Get DisplayDeviceName, ScreenWidth/Height, etc..
pHMD->GetDeviceInfo(&hmdInfo);
if (pSensor)
{
SFusion.AttachToSensor(pSensor);
SFusion.SetPrediction(0.03f);
}
if(pSensor)
{
return 1;
}
return 0;
}