示例#1
0
        public Device(SteamVR_TrackedObject controller)
        {
            this.controller = controller;

            // TODO: Add Runtime Configuration of ChordingButton's used
            mask = new ChordMask(new ChordButtonID[] {
                ChordButtonID.Pie_0_0,
                ChordButtonID.Pie_0_1,
                ChordButtonID.Pie_0_2,
                ChordButtonID.Pie_1_0,
                ChordButtonID.Pie_1_1,
                ChordButtonID.Pie_1_2,
            });

            ControllerHand hand = HandForName(controller.name);

            //trigger = (hand == ControllerHand.L ? ChordButtonID.Trigger_0 : ChordButtonID.Trigger_1);

            // TODO: Factor out index calculation
            touches  = new List <Vector2>();
            touchpad = new TouchpadButtonMask4((int)hand);

            Debug.Log("Mask Config: " + mask.StringFor(mask.All));
            Debug.Log(string.Join("\n", new[] {
                controller.name + " setup as " + hand.ToString(),
                //"Trigger  => " + trigger.ToString(),
                "Touchpad => " + mask.StringFor(touchpad.All),
            }));
        }
示例#2
0
        /// <summary>
        /// The GetControllerDefaultColliderPath returns the path to the prefab that contains the collider objects for the default controller of this SDK.
        /// </summary>
        /// <param name="hand">The controller hand to check for</param>
        /// <returns>A path to the resource that contains the collider GameObject.</returns>
        public override string GetControllerDefaultColliderPath(ControllerHand hand)
        {
            if (HasAvatar())
            {
                return("ControllerColliders/OculusTouch_" + hand.ToString());
            }

            return("ControllerColliders/Fallback");
        }