Skip to content

Commit

Permalink
Clarify things
Browse files Browse the repository at this point in the history
  • Loading branch information
nicoco007 committed Dec 4, 2024
1 parent b832c26 commit 2f7d0cd
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions Source/CustomAvatar/Rendering/MainCamera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,37 +171,36 @@ protected void OnPreCull()
_trackedPoseDriver.PerformUpdate();
_camera.ResetWorldToCameraMatrix();
}

UpdateCameraMask();
}

protected void OnPostRender()
{
if (_trackedPoseDriver != null)
{
// the VR camera seems to always be rendered last so we don't need to re-update the camera pose/matrix
_trackedPoseDriver.UseRelativeTransform = false;
}
}

private void OnFocusChanged(bool hasFocus)
private void OnCameraNearClipPlaneChanged(float value)
{
if (_trackedPoseDriver != null)
{
_trackedPoseDriver.originPose = hasFocus ? Pose.identity : new Pose(
Vector3.Project(Quaternion.Euler(0, 180, 0) * -transform.localPosition * 2, Vector3.right) + new Vector3(0, 0, 1.5f),
Quaternion.Euler(0, 180, 0));
}

UpdateCameraMask();
}

private void OnCameraNearClipPlaneChanged(float value)
private void OnFpfcSettingsChanged(IFPFCSettings fpfcSettings)
{
UpdateCameraMask();
}

private void OnFpfcSettingsChanged(IFPFCSettings fpfcSettings)
private void OnFocusChanged(bool hasFocus)
{
if (_trackedPoseDriver != null)
{
_trackedPoseDriver.originPose = hasFocus ? Pose.identity : new Pose(
Vector3.Project(Quaternion.Euler(0, 180, 0) * -transform.localPosition * 2, Vector3.right) + new Vector3(0, 0, 1.5f),
Quaternion.Euler(0, 180, 0));
}

UpdateCameraMask();
}

Expand Down

0 comments on commit 2f7d0cd

Please sign in to comment.