public void GestureControl(GestureEventData gestureEventData) { Debug.Log("light:" + gestureEventData.GestureType); switch (gestureEventData.GestureType) { case GestureType.ToggleOnOff: if (triggered_frame > THRESH) { Debug.Log(triggered_frame); Toggle(); triggered_frame = 0; } break; case GestureType.LeftTurnUp: case GestureType.RightTurnUp: IncreaseIntensity(mappingFuncs[mode](direct_speed, _light.transform.position, player.transform.position)); break; case GestureType.LeftTurnDown: case GestureType.RightTurnDown: DecreaseIntensity(mappingFuncs[mode](direct_speed, _light.transform.position, player.transform.position)); break; } }
// Update is called once per frame void Update() { // Vector3 RightIndexTipPosition = Vector3.zero; // if (HandJointUtils.TryGetJointPose(TrackedHandJoint.IndexTip, Handedness.Right, out MixedRealityPose poseRightIndexTip)) // { // RightIndexTipPosition = poseRightIndexTip.Position; // } // Vector3 LeftIndexTipPosition = Vector3.zero; // if (HandJointUtils.TryGetJointPose(TrackedHandJoint.IndexTip, Handedness.Left, out MixedRealityPose poseLeftIndexTip)) // { // LeftIndexTipPosition = poseLeftIndexTip.Position; // } if (leftGestureDetector.currentGesture.name.Equals("LeftTurnUp")) { //Debug.Log("Gesture: LeftTurnUp"); SensorTrigger(GestureType.LeftTurnUp); leftPreviousGesture = new GestureEventData(GestureType.LeftTurnUp); } if (leftGestureDetector.currentGesture.name.Equals("LeftTurnDown")) { //Debug.Log("Gesture: LeftTurnDown"); SensorTrigger(GestureType.LeftTurnDown); leftPreviousGesture = new GestureEventData(GestureType.LeftTurnDown); } if (leftGestureDetector.currentGesture.name.Equals("ToggleOnOff")) { //Debug.Log("Gesture: toggle"); SensorTrigger(GestureType.ToggleOnOff); leftPreviousGesture = new GestureEventData(GestureType.ToggleOnOff); } if (rightGestureDetector.currentGesture.name.Equals("RightTurnUp")) { //Debug.Log("Gesture: RightTurnUp"); SensorTrigger(GestureType.RightTurnUp); rightPreviousGesture = new GestureEventData(GestureType.RightTurnUp); } if (rightGestureDetector.currentGesture.name.Equals("RightTurnDown")) { //Debug.Log("Gesture: RightTurnDown"); SensorTrigger(GestureType.RightTurnDown); rightPreviousGesture = new GestureEventData(GestureType.RightTurnDown); } if (rightGestureDetector.currentGesture.name.Equals("ToggleOnOff")) { //Debug.Log("Gesture: toggle"); SensorTrigger(GestureType.ToggleOnOff); rightPreviousGesture = new GestureEventData(GestureType.ToggleOnOff); } }
public void UnsetGestureControl(GestureEventData gestureEventData) { }