From e5aa13789118ad96a3d7110166ed2d3575fc3c72 Mon Sep 17 00:00:00 2001 From: Rainer Koschke Date: Tue, 27 Aug 2024 21:41:25 +0200 Subject: [PATCH] #733 Better face bone. Better positioning. --- Assets/SEE/Tools/FaceCam/FaceCam.cs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/Assets/SEE/Tools/FaceCam/FaceCam.cs b/Assets/SEE/Tools/FaceCam/FaceCam.cs index 0d392ee83d..c8d13b9bf0 100644 --- a/Assets/SEE/Tools/FaceCam/FaceCam.cs +++ b/Assets/SEE/Tools/FaceCam/FaceCam.cs @@ -121,7 +121,7 @@ public class FaceCam : NetworkBehaviour /// The relative path to the bone of the face/nose of the player. /// This will be used to position the FaceCam. /// - private const string faceCamOrientationBone = "CC_Base_BoneRoot/CC_Base_Hip/CC_Base_Waist/CC_Base_Spine01/CC_Base_Spine02/CC_Base_NeckTwist01/CC_Base_NeckTwist02/CC_Base_Head/CC_Base_FacialBone/CC_Base_R_Eye"; + private const string faceCamOrientationBone = "CC_Base_BoneRoot/CC_Base_Hip/CC_Base_Waist/CC_Base_Spine01/CC_Base_Spine02/CC_Base_NeckTwist01/CC_Base_NeckTwist02/CC_Base_Head"; /// /// The webcam texture to mat helper from the WebCamTextureToMatHelperExample. @@ -621,7 +621,7 @@ private void LateUpdate() /// /// Refresh the position of the FaceCam. - /// The position can be toggled with the Key 'O'. + /// The position can be toggled with . /// This means switching the position between above the avatars face and in front of it. /// private void RefreshFaceCamPosition() @@ -636,20 +636,18 @@ private void RefreshFaceCamPosition() if (playersFace != null) // Sometimes the playersFace seems to be null, i can't find out why. // Seems to have nothing to do with this class. { - // Put it where the players face is. + // Put it where the player's face is. transform.SetPositionAndRotation(playersFace.position, playersFace.rotation); if (faceCamOnFront) { - // Rotate and move it a bit up and a bit forward. - transform.Rotate(0, -90, -90); // To face away from the avatars face. - transform.position += transform.forward * 0.025f; - transform.position += transform.up * 0.03f; + // Move it a bit up and a bit forward. + transform.position += transform.forward * 0.15f; + transform.position += transform.up * 0.06f; } else { - // Rotate and move it a up and a bit forward. - transform.Rotate(0, -90, -90); // To face away from the avatars face. - transform.position -= transform.forward * 0.08f; + // Move it a bit up and a bit forward. + transform.position += transform.forward * 0.1f; transform.position += transform.up * 0.3f; if (!IsOwner) // If this is the owner the FaceCam should just face forward and // not down to the own camera.