private void setGesture(PointingState[] fingers) { Thumb = fingers[0]; Index = fingers[1]; Middle = fingers[2]; Ring = fingers[3]; Pinky = fingers[4]; }
// Use this for initialization void Start() { Instance = this; weight = new AttractorWeight(3.5f, 0, 0, 0, 0, 0, 0, 100, 0); systemState |= SystemState.LOAD; #region システム if ((systemState & SystemState.LOAD) == SystemState.LOAD) { //カメラ状態設定 cameraState |= CameraState.ORTHOGRAPHIC | CameraState.ZOOM_OUT; zoomEnabled = false; interactiveEnabled = false; //初期設定読み込み LoadSettingFlies lsf = GetComponent <LoadSettingFlies>(); lsf.Load(); //Wall設定 AutoDisplayAdjuster wall = GetComponent <AutoDisplayAdjuster>(); wall.Load(); //GUI処理 GUIManager gui = GetComponent <GUIManager>(); gui.Initialize(); } #endregion #region ポインティング pointingState |= PointingState.POINTING; #endregion #region アトラクター attractorState = attractorState | AttractorState.AVOID | AttractorState.AVOID_SCALE | AttractorState.SCALE_UP | AttractorState.FRAME; if ((pointingState & PointingState.POINTING) == PointingState.POINTING) { attractorState |= AttractorState.SCALE_UP_MOUSE; } else if ((pointingState & PointingState.VENN) == PointingState.VENN) { //attractorState |= AttractorState.FRAME; } zAxisDirection = true; #endregion systemState = ~SystemState.LOAD & systemState; systemState |= SystemState.MAIN; }
public void LedPier(PointingState sideOfPier) { this.Invoke((MethodInvoker) delegate { if (sideOfPier == PointingState.Normal) { //ToDO /*ledPierEast.Status = TrafficLight.Green; * ledPierEast.Visible = true; * ledPierWest.Visible = false;*/ } else { //ToDo /*ledPierWest.Status = TrafficLight.Red; * ledPierWest.Visible = true; * ledPierEast.Visible = false;*/ } }); }
private bool matchFingerState(Finger finger, PointingState requiredState) { return((requiredState == PointingState.Either) || (requiredState == PointingState.Extended && finger.IsExtended) || (requiredState == PointingState.NotExtended && !finger.IsExtended)); }
public void Update() { float normTime; float weight; switch (state) { case PointingState.INACTIVE: break; case PointingState.RAISING_ARM: currAnimTime += Time.deltaTime; if (currAnimTime > maxTime) { currAnimTime = maxTime; weight = 1; state = PointingState.HOLDING; } else { normTime = currAnimTime / maxTime; weight = Mathf.Sin(normTime * Mathf.PI / 2); } this.effector.positionWeight = weight; break; case PointingState.HOLDING: holdTime += Time.deltaTime; if (holdTime > maxHoldTime) { holdTime = 0; state = PointingState.LOWERING_ARM; } break; case PointingState.LOWERING_ARM: currAnimTime -= Time.deltaTime; if (currAnimTime < 0) { currAnimTime = 0; weight = 0; state = PointingState.INACTIVE; } else { normTime = currAnimTime / maxTime; weight = Mathf.Sin(normTime * Mathf.PI / 2); } this.effector.positionWeight = weight; break; } }
public void Point(Transform player, Transform target, bool useRightHand) { if(!isActive()) { this.target = target; if (useRightHand) this.effector = ikSecondary.solver.rightHandEffector; else this.effector = ikSecondary.solver.leftHandEffector; this.effector.position = calculateHandPosition(player, target, useRightHand); state = PointingState.RAISING_ARM; ikSecondary.solver.spineStiffness = 10f; } }
public PointIKController(CrossfadeFBBIK[] iks) { this.ikSecondary = iks[1]; this.state = PointingState.INACTIVE; this.currAnimTime = 0.0f; this.maxTime = 0.6f; this.holdTime = 0.0f; this.maxHoldTime = 1.0f; }
private bool matchFingerState (Finger finger, PointingState requiredState) { return (requiredState == PointingState.Either) || (requiredState == PointingState.Extended && finger.IsExtended) || (requiredState == PointingState.NotExtended && !finger.IsExtended); }
private void applySettings(List <string> settings, string side) { string[] separators = { ": " }; foreach (string setting in settings) { Debug.Log(setting); string[] split = setting.Split(separators, StringSplitOptions.RemoveEmptyEntries); if (split.Length == 0) { continue; } else { if (split[0] == "SliderControls") { if (side == "Left") { if (split[1] == "0") { leftSlider.enabled = false; } else { leftSlider.enabled = true; } } else { if (split[1] == "0") { rightSlider.enabled = false; } else { rightSlider.enabled = true; } } } else if (split[0] == "SliderThumb") { PointingState state = getPointingState(split[1]); if (side == "Left") { leftSlider.Thumb = state; } else { rightSlider.Thumb = state; } } else if (split[0] == "SliderIndex") { PointingState state = getPointingState(split[1]); if (side == "Left") { leftSlider.Index = state; } else { rightSlider.Index = state; } } else if (split[0] == "SliderMiddle") { PointingState state = getPointingState(split[1]); if (side == "Left") { leftSlider.Middle = state; } else { rightSlider.Middle = state; } } else if (split[0] == "SliderRing") { PointingState state = getPointingState(split[1]); if (side == "Left") { leftSlider.Ring = state; } else { rightSlider.Ring = state; } } else if (split[0] == "SliderPinky") { PointingState state = getPointingState(split[1]); if (side == "Left") { leftSlider.Pinky = state; } else { rightSlider.Pinky = state; } } else if (split[0] == "ButtonControls") { if (side == "Left") { if (split[1] == "0") { leftButton.enabled = false; } else { leftButton.enabled = true; } } else { if (split[1] == "0") { rightButton.enabled = false; } else { rightButton.enabled = true; } } } else if (split[0] == "ButtonThumb") { PointingState state = getPointingState(split[1]); if (side == "Left") { leftButton.Thumb = state; } else { rightButton.Thumb = state; } } else if (split[0] == "ButtonIndex") { PointingState state = getPointingState(split[1]); if (side == "Left") { leftButton.Index = state; } else { rightButton.Index = state; } } else if (split[0] == "ButtonMiddle") { PointingState state = getPointingState(split[1]); if (side == "Left") { leftButton.Middle = state; } else { rightButton.Middle = state; } } else if (split[0] == "ButtonRing") { PointingState state = getPointingState(split[1]); if (side == "Left") { leftButton.Ring = state; } else { rightButton.Ring = state; } } else if (split[0] == "ButtonPinky") { PointingState state = getPointingState(split[1]); if (side == "Left") { leftButton.Pinky = state; } else { rightButton.Pinky = state; } } else if (split[0] == "PinchClose") { if (side == "Left") { leftPinch.setPinchClose(float.Parse(split[1])); } else { rightPinch.setPinchClose(float.Parse(split[1])); } } else if (split[0] == "PinchOpen") { if (side == "Left") { leftPinch.setPinchOpen(float.Parse(split[1])); } else { rightPinch.setPinchOpen(float.Parse(split[1])); } } else { Debug.Log("Error"); } } } if (side == "Left") { leftSlider.OnValidate(); leftButton.OnValidate(); repairSettings(leftSlider); repairSettings(leftButton); } else { rightSlider.OnValidate(); rightButton.OnValidate(); repairSettings(rightSlider); repairSettings(rightButton); } }