Ejemplo n.º 1
0
        public void Play(RotationOption rotation)
        {
            if (currentFeedbackFileKey != FeedbackFile.Id)
            {
                currentFeedbackFileKey = FeedbackFile.Id;
                player.RegisterTactFileStr(currentFeedbackFileKey, FeedbackFile.Value);
            }

            player.SubmitRegisteredVestRotation(currentFeedbackFileKey, _key,
                                                rotation,
                                                new ScaleOption(Intensity, Duration));
        }
Ejemplo n.º 2
0
    public void SubmitRegisteredVestRotation(string key, RotationOption option)
    {
        var request = new SubmitRequest()
        {
            Key        = key,
            Type       = "key",
            Parameters = new Dictionary <string, object>
            {
                { "rotationOption", option }
            }
        };

        SubmitRequest(request);
    }
Ejemplo n.º 3
0
    public void SubmitRegisteredVestRotation(string key, string altKey, RotationOption rOption, ScaleOption sOption)
    {
        var request = new SubmitRequest()
        {
            Key        = key,
            Type       = "key",
            Parameters = new Dictionary <string, object>
            {
                { "rotationOption", rOption },
                { "scaleOption", sOption },
                { "altKey", altKey }
            }
        };

        SubmitRequest(request);
    }
Ejemplo n.º 4
0
        void ProvideHapticFeedbackThread(float locationAngle, float locationHeight, FeedbackType effect, float intensityMultiplier, bool waitToPlay)
        {
            if (intensityMultiplier < 0.001)
            {
                return;
            }

            if (!systemInitialized || hapticPlayer == null)
            {
                CreateSystem();
            }

            if (hapticPlayer != null)
            {
                if (feedbackMap.ContainsKey(effect))
                {
                    if (feedbackMap[effect].feedbackFileCount > 0)
                    {
                        if (waitToPlay)
                        {
                            if (IsPlayingKeyAll(feedbackMap[effect].prefix, feedbackMap[effect].feedbackFileCount))
                            {
                                return;
                            }
                        }

                        string key = feedbackMap[effect].prefix + (RandomNumber.Between(1, feedbackMap[effect].feedbackFileCount)).ToString();

                        if (locationHeight < -0.5f)
                        {
                            locationHeight = -0.5f;
                        }
                        else if (locationHeight > 0.5f)
                        {
                            locationHeight = 0.5f;
                        }

                        Bhaptics.Tact.RotationOption RotOption = new RotationOption(locationAngle, locationHeight);

                        Bhaptics.Tact.ScaleOption scaleOption = new ScaleOption(intensityMultiplier, 1.0f);

                        //hapticPlayer.SubmitRegistered(key, scaleOption);
                        hapticPlayer.SubmitRegisteredVestRotation(key, RotOption, scaleOption);
                    }
                }
            }
        }
Ejemplo n.º 5
0
        private void PlayReceiveDamageHaptics(float dmg, Vector3 direction)
        {
            if (!VRConfig.configUseBhaptics.Value)
            {
                return;
            }

            var rotationOption = GetRotationOptionFromDirection(direction);

            float intensity   = dmg * 0.3f + 0.3f;
            float duration    = 1f;
            var   scaleOption = new ScaleOption(intensity, duration);

            m_hapticPlayer.SubmitRegisteredVestRotation(VEST_DAMAGE_KEY, "", rotationOption, scaleOption);

            m_lastDamageRotationOption = rotationOption;
        }
Ejemplo n.º 6
0
 public void SubmitRegisteredVestRotation(string key, string altKey, RotationOption option, ScaleOption sOption)
 {
     // nothing to do
 }
Ejemplo n.º 7
0
 public void SubmitRegisteredVestRotation(string key, RotationOption option)
 {
     // nothing to do
 }
Ejemplo n.º 8
0
 public void SubmitRegistered(string key, string altKey, RotationOption rOption, ScaleOption sOption)
 {
     HapticApi.SubmitRegisteredWithOption(key, altKey, sOption.Intensity, sOption.Duration, rOption.OffsetAngleX, rOption.OffsetY);
 }
Ejemplo n.º 9
0
 public void SubmitRegistered(string key, string altKey, RotationOption rOption, ScaleOption sOption)
 {
     SubmitRequest(key, altKey, sOption.Intensity, sOption.Duration, rOption.OffsetAngleX, rOption.OffsetY);
 }
Ejemplo n.º 10
0
    public override void OnInspectorGUI()
    {
        //base.OnInspectorGUI();

        serializedObject.Update();

        var titleStyle = new GUIStyle(GUI.skin.label)
        {
            alignment = TextAnchor.MiddleCenter, fontSize = 15, clipping = TextClipping.Overflow
        };

        titleStyle.normal.textColor = Color.blue;
        RectOffset bdr;

        bdr = titleStyle.border;
        GUI.Label(new Rect(bdr.horizontal, bdr.vertical, 100, 30), "AA");
        //Create Title
        EditorGUILayout.LabelField("Tool for wave on wall animation", titleStyle);
        EditorGUILayout.Space();
        EditorGUILayout.Space();

        //Simple float assign
        EditorGUILayout.Slider(TimeWave, 0.4f, 2, new GUIContent("Time during wave:"));
        EditorGUILayout.Space();
        EditorGUILayout.Slider(Latence, 0, 1, new GUIContent("Latence to ComeBack"));
        EditorGUILayout.Space();

        //Get Value Amplitude
        minAmp = AmplitudeWaveMin.floatValue;
        maxAmp = AmplitudeWaveMax.floatValue;

        //Create Style center text
        //Create Title
        EditorGUILayout.LabelField("Movement Amplitude of Wave", titleStyle);
        EditorGUILayout.Space();
        EditorGUILayout.Space();

        //Show Value Amplitude
        minAmp = EditorGUILayout.FloatField("Minimum Amplitude Wave", minAmp);
        maxAmp = EditorGUILayout.FloatField("Maximum Amplitude Wave", maxAmp);

        //Show MinMaxSlider
        EditorGUILayout.MinMaxSlider(ref minAmp, ref maxAmp, 1, 5);

        //Set Value changed
        AmplitudeWaveMin.floatValue = minAmp;
        AmplitudeWaveMax.floatValue = maxAmp;

        EditorGUILayout.LabelField("Effect Add on Climax Wave:", titleStyle);
        EditorGUILayout.Space();
        EditorGUILayout.Space();
        var BareHori = new GUIStyle(GUI.skin.horizontalSlider)
        {
        };

        EditorGUILayout.LabelField("", BareHori);
        //Section Rotation
        rot = ChangeRotation.boolValue;
        rot = EditorGUILayout.ToggleLeft("Rotation Animation ", rot);
        ChangeRotation.boolValue = rot;


        if (rot)
        {
            EditorGUILayout.Slider(TimeRotation, 0.1f, 1, new GUIContent("Rotation time:"));
            switch (DegreeRotation.floatValue)
            {
            case 180:
                RotOp = RotationOption.Rot180;
                break;

            case 360:
                RotOp = RotationOption.Rot360;
                break;

            default:
                break;
            }
            RotOp = (RotationOption)EditorGUILayout.EnumPopup("Angle Rotation:", RotOp);
            switch (RotOp)
            {
            case RotationOption.Rot180:
                DegreeRotation.floatValue = 180;
                break;

            case RotationOption.Rot360:
                DegreeRotation.floatValue = 360;
                break;

            default:
                break;
            }
        }
        EditorGUILayout.Space();
        EditorGUILayout.LabelField("", BareHori);
        //Section Material
        switchMat = SwitchMaterial.boolValue;
        switchMat = EditorGUILayout.ToggleLeft("Switch Material ", switchMat);
        SwitchMaterial.boolValue = switchMat;

        if (switchMat)
        {
            EditorGUILayout.PropertyField(allMaterial, true);
        }

        // SectionTexture
        EditorGUILayout.Space();
        EditorGUILayout.LabelField("", BareHori);
        switchTex = SwitchTexture.boolValue;
        switchTex = EditorGUILayout.ToggleLeft("Switch Texture ", switchTex);
        SwitchTexture.boolValue = switchTex;

        if (switchTex)
        {
            EditorGUILayout.PropertyField(allTexture, true);
            EditorGUILayout.Slider(speedSwitchTexture, 0.1f, 0.6f, new GUIContent("Time transition texture"));
        }

        EditorGUILayout.Space();
        EditorGUILayout.LabelField("", BareHori);
        //Section Shaking

        shakeScale           = ShakeScale.boolValue;
        shakeScale           = EditorGUILayout.ToggleLeft("Shake Scale Animation ", shakeScale);
        ShakeScale.boolValue = shakeScale;

        if (shakeScale)
        {
            EditorGUILayout.Slider(forceShake, 30, 200, new GUIContent("Force of Shaking:"));
        }


        BlockWallAnimation Block = (BlockWallAnimation)target;

        EditorGUILayout.LabelField("", BareHori);
        if (GUILayout.Button("Play Wave Animation"))
        {
            //Block.CreateAnimationBlock();
        }

        serializedObject.ApplyModifiedProperties();
    }
Ejemplo n.º 11
0
 public void SubmitRegisteredVestRotation(string key, string altKey, RotationOption option)
 {
     SubmitRegisteredVestRotation(key, altKey, option, new ScaleOption(1f, 1f));
 }
Ejemplo n.º 12
0
 public void SubmitRegisteredVestRotation(string key, RotationOption option)
 {
     HapticApi.SubmitRegisteredWithOption(key, key, 1f, 1f, option.OffsetAngleX, option.OffsetY);
 }