// UpdatePlayerEyeHeight void UpdatePlayerEyeHeight() { if ((UsePlayerEyeHeight == true) && (PrevUsePlayerEyeHeight == false)) { // Calculate neck position to use based on Player configuration float peh = 0.0f; if (OVRDevice.GetPlayerEyeHeight(ref peh) != false) { NeckPosition.y = peh - CameraRootPosition.y - EyeCenterPosition.y; } } PrevUsePlayerEyeHeight = UsePlayerEyeHeight; }
/// <summary> /// Updates the height of the player eye. /// </summary> void UpdatePlayerEyeHeight() { if ((UsePlayerEyeHeight == true) && (PrevUsePlayerEyeHeight == false)) { // Calculate neck position to use based on Player configuration float peh = 0.0f; #if false if (OVRDevice.GetPlayerEyeHeight(ref peh) != false) #else // Match behavior of 0.4 CAPI Desktop plugin. On // O.3 Desktop, false will be returned when the // profile is not present, even though a valid // default eye height is returned. OVRDevice.GetPlayerEyeHeight(ref peh); #endif { NeckPosition.y = peh - CameraRootPosition.y; } } PrevUsePlayerEyeHeight = UsePlayerEyeHeight; }