/// <summary> /// <para>Toggles the Oculus Axis defined by the <strong>axisMask</strong> parameter so as to associate the Input Axis with an Oculus Touch Raw Input Axis.</para> /// <innovasys:widget type="Caution Box" layout="block" xmlns:innovasys="http://www.innovasys.com/widgets"> /// <innovasys:widgetproperty layout="block" name="Content"> /// <strong>Be careful!</strong> Oculus devices do not use virtual inputs or virtual mappings managed /// through the <see cref="!:https://docs.unity3d.com/Manual/class-InputManager.html">Unity Input Manager</see>. Instead, they are accessed directly through the %Oculus /// Utilities for Unity:https://developer.oculus.com/downloads/game-engines/1.5.0/Oculus_Utilities_for_Unity_5/%.</innovasys:widgetproperty> /// </innovasys:widget> /// </summary> /// <param name="axisMask">An <see cref="OVRInput.RawAxis1D" /> enum value which represents a bitmask corresponding to one of the hard-coded 1-dimensional raw input axes supported by Oculus devices.</param> public void toggleRawAxis2D(OVRInput.RawAxis2D axisMask) { if (axisMask != OVRInput.RawAxis2D.None) { _previousRawAxis2D = this.rawAxis2D; _previousRawAxis1D = this.rawAxis1D; _rawAxis1D = OVRInput.RawAxis1D.None; _rawAxis2D = axisMask; } else { _previousRawAxis2D = this.rawAxis2D; _rawAxis2D = OVRInput.RawAxis2D.None; _rawAxis1D = this._previousRawAxis1D; } }
public VRController(string handAnchorName, OVRInput.RawAxis2D stick, Stick2DMap stickMap, Stick3DMap positionMover, float scale, float speed, bool onHeadSet) { this.handAnchor = GameObject.Find(handAnchorName); this.stick = stick; this.stickMap = stickMap; this.positionMover = positionMover; this.speed = speed; this.onHeadSet = onHeadSet; if (!onHeadSet) { this.cube = GameObject.CreatePrimitive(PrimitiveType.Cube); this.cube.transform.position = this.position; this.cube.transform.localScale = new Vector3(1, 1, 1) * scale; } }
public PhysicalOculusTouchStick(OVRInput.RawAxis2D stick) { this.stick = stick; }