void FaceUpdated(ARFaceAnchor anchorData) { anchorPrefab.transform.position = UnityARMatrixOps.GetPosition(anchorData.transform); anchorPrefab.transform.rotation = UnityARMatrixOps.GetRotation(anchorData.transform); }
void FaceAdded(ARFaceAnchor anchorData) { isTrackingEnabled = true; currentBlendShapes = anchorData.blendShapes; }
void FaceAdded(ARFaceAnchor anchorData) { anchorPrefab.transform.position = UnityARMatrixOps.GetPosition(anchorData.transform); anchorPrefab.transform.rotation = UnityARMatrixOps.GetRotation(anchorData.transform); anchorPrefab.SetActive(true); }
void FaceUpdated(ARFaceAnchor anchorData) { //on update, we update the old dictionary of values with the current one currentBlendShapes = anchorData.blendShapes; }
void FaceAdded(ARFaceAnchor anchorData) { enabled = true; print("face is enabled"); currentBlendShapes = anchorData.blendShapes; }
void FaceRemoved(ARFaceAnchor anchorData) { meshFilter.mesh = null; faceDebugMesh = null; //Debug.Log("face removed"); }
void FaceRemoved(ARFaceAnchor anchorData) { isTracking = false; anchorPrefab.SetActive(false); }
void FaceRemoved(ARFaceAnchor anchorData) { faceMesh = null; }
protected override void FaceAdded(ARFaceAnchor anchorData) { currentBlendShapes = anchorData.blendShapes; model.transform.localPosition = UnityARMatrixOps.GetPosition(anchorData.transform) + offset; prevRotation = UnityARMatrixOps.GetRotation(anchorData.transform).eulerAngles; }
void FaceUpdated(ARFaceAnchor anchorData) { currentBlendShapes = anchorData.blendShapes; UpdateMesh(anchorData); UpdatePositionAndRotation(anchorData); }
void FaceRemoved(ARFaceAnchor anchorData) { blendShapesEnabled = false; meshFilter.mesh = null; faceMesh = null; }
void FaceRemoved(ARFaceAnchor anchorData) { m_ARFaceActive = false; }
void FaceRemoved(ARFaceAnchor anchorData) { anchorPrefab.SetActive(false); Debug.Log("face removed"); }
void FaceRemoved(ARFaceAnchor anchorData) { isTrackingEnabled = false; }
void FaceRemoved(ARFaceAnchor anchorData) { anchorPrefab.SetActive(false); }
protected override void FaceRemoved(ARFaceAnchor anchorData) { headJoint.localRotation = defaultRotation; prevRotation = Vector3.zero; }
void FaceAdded(ARFaceAnchor anchorData) { gameObject.transform.localPosition = UnityARMatrixOps.GetPosition(anchorData.transform); gameObject.transform.localRotation = UnityARMatrixOps.GetRotation(anchorData.transform); //Debug.Log("face added"); }
protected override void FaceUpdated(ARFaceAnchor anchorData) { currentBlendShapes = anchorData.blendShapes; model.transform.localPosition = UnityARMatrixOps.GetPosition(anchorData.transform) + offset; var rotation = UnityARMatrixOps.GetRotation(anchorData.transform); var rot = new Vector3(rotation.eulerAngles.x - prevRotation.x, rotation.eulerAngles.y - prevRotation.y, rotation.eulerAngles.z - prevRotation.z); rot = new Vector3(rot.x * -1f, rot.y * 1f, rot.z * -1f); headJoint.transform.Rotate(rot); prevRotation = new Vector3(rotation.eulerAngles.x, rotation.eulerAngles.y, rotation.eulerAngles.z); foreach (KeyValuePair <string, float> kvp in currentBlendShapes) { switch (kvp.Key) { case ARBlendShapeLocation.EyeBlinkRight: var rightEyeValue = kvp.Value * 100f; if (rightEyeValue > 70f) { rightEyeValue *= 1.2f; } ref_FACE.SetBlendShapeWeight(14, rightEyeValue); break; case ARBlendShapeLocation.EyeBlinkLeft: var leftEyeValue = kvp.Value * 100f; if (leftEyeValue > 70f) { leftEyeValue *= 1.2f; } ref_FACE.SetBlendShapeWeight(15, leftEyeValue); break; case ARBlendShapeLocation.EyeWideRight: var wideEyeValue = kvp.Value * 100f; ref_FACE.SetBlendShapeWeight(18, wideEyeValue); break; case ARBlendShapeLocation.JawOpen: ref_FACE.SetBlendShapeWeight(23, kvp.Value * 100f); break; case ARBlendShapeLocation.MouthPucker: ref_FACE.SetBlendShapeWeight(25, kvp.Value * 100f); break; case ARBlendShapeLocation.MouthSmileRight: ref_FACE.SetBlendShapeWeight(29, kvp.Value * 100f); break; case ARBlendShapeLocation.MouthShrugLower: ref_FACE.SetBlendShapeWeight(31, kvp.Value * 100f); break; case ARBlendShapeLocation.BrowInnerUp: ref_FACE.SetBlendShapeWeight(9, kvp.Value * 100f); break; case ARBlendShapeLocation.BrowDownRight: ref_FACE.SetBlendShapeWeight(7, kvp.Value * 100f); break; case ARBlendShapeLocation.EyeLookDownRight: ref_EYE_R.localEulerAngles = new Vector3(kvp.Value * 5f, ref_EYE_R.localEulerAngles.y, 0f); break; case ARBlendShapeLocation.EyeLookUpRight: ref_EYE_R.localEulerAngles = new Vector3(kvp.Value * -5f, ref_EYE_R.localEulerAngles.y, 0f); break; case ARBlendShapeLocation.EyeLookInRight: ref_EYE_R.localEulerAngles = new Vector3(ref_EYE_R.localEulerAngles.x, kvp.Value * -10f, 0f); break; case ARBlendShapeLocation.EyeLookOutRight: ref_EYE_R.localEulerAngles = new Vector3(ref_EYE_R.localEulerAngles.x, kvp.Value * 10f, 0f); break; case ARBlendShapeLocation.EyeLookDownLeft: ref_EYE_L.localEulerAngles = new Vector3(kvp.Value * 5f, ref_EYE_L.localEulerAngles.y, 0f); break; case ARBlendShapeLocation.EyeLookUpLeft: ref_EYE_L.localEulerAngles = new Vector3(kvp.Value * -5f, ref_EYE_L.localEulerAngles.y, 0f); break; case ARBlendShapeLocation.EyeLookInLeft: ref_EYE_L.localEulerAngles = new Vector3(ref_EYE_L.localEulerAngles.x, kvp.Value * 10f, 0f); break; case ARBlendShapeLocation.EyeLookOutLeft: ref_EYE_L.localEulerAngles = new Vector3(ref_EYE_L.localEulerAngles.x, kvp.Value * -10f, 0f); break; } } InvokEffector(); }
void FaceRemoved(ARFaceAnchor anchorData) { meshFilter.mesh = null; faceMesh = null; }
private void OnFaceLost(ARFaceAnchor anchorData) { ValidateCustomCondition(true); }
void FaceAdded(ARFaceAnchor anchorData) { shapeEnabled = true; currentBlendShapes = anchorData.blendShapes; }
void FaceRemoved(ARFaceAnchor anchorData) { leftEyeGo.SetActive(false); rightEyeGo.SetActive(false); }
void FaceRemoved(ARFaceAnchor anchorData) { shapeEnabled = false; }
void FaceUpdated(ARFaceAnchor anchorData) { Vector3 pos = UnityARMatrixOps.GetPosition(anchorData.transform); Quaternion rot = UnityARMatrixOps.GetRotation(anchorData.transform); if (camManager.DeviceCamUsed) { headCenter.transform.position = pos; // in device cam viewing mode, don't invert on x because this view is mirrored headCenter.transform.rotation = rot; } else { // invert on x because ARfaceAnchors are inverted on x (to mirror in display) headCenter.transform.position = new Vector3(-pos.x, pos.y, pos.z); headCenter.transform.rotation = new Quaternion(-rot.x, rot.y, rot.z, -rot.w); } currentBlendShapes = anchorData.blendShapes; if (autoEye) { if (currentBlendShapes.ContainsKey("eyeBlink_L")) // of course, eyeBlink_L refers to the RIGHT eye! (mirrored geometry) { rightEyeClosed = currentBlendShapes ["eyeBlink_L"]; } if (currentBlendShapes.ContainsKey("eyeBlink_R")) { leftEyeClosed = currentBlendShapes ["eyeBlink_R"]; } //string str = string.Format ("L={0:#.##} R={1:#.##}", leftEyeClosed, rightEyeClosed); //eyeInfoText = str; // these values seem to be in the 0.2 .. 0.7 range.. // but sometimes, when viewing the phone low in the visual field, they get very high even while open (eyelids almost close) // we'll use a difference metric and if exceeded we select the most open eye if (Mathf.Abs(rightEyeClosed - leftEyeClosed) > 0.2f) { if (rightEyeClosed > leftEyeClosed) { openEye = OpenEye.Left; } else { openEye = OpenEye.Right; } } /* // old method * if (rightEyeClosed > 0.5 && leftEyeClosed < 0.5) * openEye = OpenEye.Left; * * if (rightEyeClosed < 0.5 && leftEyeClosed > 0.5) * openEye = OpenEye.Right;*/ } string str; if (openEye == OpenEye.Left) { str = "Left Eye"; } else { str = "Right Eye"; } if (autoEye) { eyeInfoText = "Auto: " + str; } else { eyeInfoText = str; } }
void FaceUpdated(ARFaceAnchor anchorData) { currentBlendShapes = anchorData.blendShapes; }
void FaceRemoved(ARFaceAnchor anchorData) { Debug.Log("Face Removed"); _positionBuffer.TryDispose(); _tmpPositionMap.TryDestroy(); }