当前位置: 首页>>代码示例>>C++>>正文


C++ Profile::SetIntValue方法代码示例

本文整理汇总了C++中Profile::SetIntValue方法的典型用法代码示例。如果您正苦于以下问题:C++ Profile::SetIntValue方法的具体用法?C++ Profile::SetIntValue怎么用?C++ Profile::SetIntValue使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Profile的用法示例。


在下文中一共展示了Profile::SetIntValue方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: GetDefaultProfile

// Returns a profile with all system default values
Profile* ProfileManager::GetDefaultProfile(HmdTypeEnum device)
{
    // In the absence of any data, set some reasonable profile defaults.
    // However, this is not future proof and developers should still
    // provide reasonable default values for queried fields.
    
    // Biometric data
    Profile* profile = CreateProfile();
    profile->SetValue(OVR_KEY_USER,               "default");
    profile->SetValue(OVR_KEY_NAME,               "Default");
    profile->SetValue(OVR_KEY_GENDER,             OVR_DEFAULT_GENDER);
    profile->SetFloatValue(OVR_KEY_PLAYER_HEIGHT, OVR_DEFAULT_PLAYER_HEIGHT);
    profile->SetFloatValue(OVR_KEY_EYE_HEIGHT,    OVR_DEFAULT_EYE_HEIGHT);
    profile->SetFloatValue(OVR_KEY_IPD,           OVR_DEFAULT_IPD);
    float half_ipd[2] = { OVR_DEFAULT_IPD / 2, OVR_DEFAULT_IPD / 2 };
    profile->SetFloatValues(OVR_KEY_EYE_TO_NOSE_DISTANCE, half_ipd, 2);
    float dist[2] = {OVR_DEFAULT_NECK_TO_EYE_HORIZONTAL, OVR_DEFAULT_NECK_TO_EYE_VERTICAL};
    profile->SetFloatValues(OVR_KEY_NECK_TO_EYE_DISTANCE, dist, 2);
    
    // Device specific data
    if (device != HmdType_None)
    {
        if (device == HmdType_CrystalCoveProto || device == HmdType_DK2)
        {
            profile->SetValue("EyeCup", "A");
            profile->SetIntValue(OVR_KEY_EYE_RELIEF_DIAL, OVR_DEFAULT_EYE_RELIEF_DIAL);

            // TODO: These defaults are a little bogus and designed for continuity with 0.3
            // eye-relief values.  We need better measurement-based numbers in future releases
            float max_eye_plate[2] = { 0.01965f + 0.017f, 0.01965f + 0.017f };
            profile->SetFloatValues(OVR_KEY_MAX_EYE_TO_PLATE_DISTANCE, max_eye_plate, 2);
        }
        else
        {   // DK1 and DKHD variants
            profile->SetValue("EyeCup", "A");
            profile->SetIntValue(OVR_KEY_EYE_RELIEF_DIAL, OVR_DEFAULT_EYE_RELIEF_DIAL);

            // TODO: These defaults are a little bogus and designed for continuity with 0.3
            // DK1 distortion.  We need better measurement-based numbers in future releases
            float max_eye_plate[2] = { 0.02357f + 0.017f, 0.02357f + 0.017f };
            profile->SetFloatValues(OVR_KEY_MAX_EYE_TO_PLATE_DISTANCE, max_eye_plate, 2);
        }
    }

    return profile;
}
开发者ID:ReallyRad,项目名称:ofxOculusDK2,代码行数:47,代码来源:OVR_Profile.cpp


注:本文中的Profile::SetIntValue方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。