diff --git a/Assets/SteamVR/Editor/SteamVR_Update.cs b/Assets/SteamVR/Editor/SteamVR_Update.cs index 17eeed2b..903c5d9f 100644 --- a/Assets/SteamVR/Editor/SteamVR_Update.cs +++ b/Assets/SteamVR/Editor/SteamVR_Update.cs @@ -18,10 +18,10 @@ namespace Valve.VR [InitializeOnLoad] public class SteamVR_Update : EditorWindow { - const string currentVersion = "2.1"; - const string versionUrl = "http://media.steampowered.com/apps/steamvr/unitypluginversion.txt"; - const string notesUrl = "http://media.steampowered.com/apps/steamvr/unityplugin-v{0}.txt"; - const string pluginUrl = "http://u3d.as/content/valve-corporation/steam-vr-plugin"; + const string currentVersion = "2.8"; + const string versionUrl = "https://media.steampowered.com/apps/steamvr/unitypluginversion.txt"; + const string notesUrl = "https://media.steampowered.com/apps/steamvr/unityplugin-v{0}.txt"; + const string pluginUrl = "https://u3d.as/content/valve-corporation/steam-vr-plugin"; const string doNotShowKey = "SteamVR.DoNotShow.v{0}"; static bool gotVersion = false; diff --git a/Assets/SteamVR/Input/Editor/SteamVR_CopyExampleInputFiles.cs b/Assets/SteamVR/Input/Editor/SteamVR_CopyExampleInputFiles.cs index 21626652..02d1d8f2 100644 --- a/Assets/SteamVR/Input/Editor/SteamVR_CopyExampleInputFiles.cs +++ b/Assets/SteamVR/Input/Editor/SteamVR_CopyExampleInputFiles.cs @@ -16,7 +16,13 @@ public class SteamVR_CopyExampleInputFiles : Editor [UnityEditor.Callbacks.DidReloadScripts] private static void OnReloadScripts() + { + EditorApplication.update += Update; + } + + private static void Update() { + EditorApplication.update -= Update; SteamVR_Input.CheckOldLocation(); CopyFiles(); } diff --git a/Assets/SteamVR/Input/SteamVR_ActionSet_Manager.cs b/Assets/SteamVR/Input/SteamVR_ActionSet_Manager.cs index 900688a8..400d2b4b 100644 --- a/Assets/SteamVR/Input/SteamVR_ActionSet_Manager.cs +++ b/Assets/SteamVR/Input/SteamVR_ActionSet_Manager.cs @@ -15,16 +15,32 @@ namespace Valve.VR /// public static class SteamVR_ActionSet_Manager { - public static VRActiveActionSet_t[] rawActiveActionSetArray; + public static VRActiveActionSet_t[] rawActiveActionSetArray + { + get + { + if (currentArraySize <= 0) + return null; + else + return poolActiveActionSetArrays[currentArraySize]; + } + } [NonSerialized] private static uint activeActionSetSize; + [NonSerialized] private static bool changed = false; + [NonSerialized] + private static int currentArraySize; + [NonSerialized] + private static Dictionary poolActiveActionSetArrays; + public static void Initialize() { activeActionSetSize = (uint)(Marshal.SizeOf(typeof(VRActiveActionSet_t))); + poolActiveActionSetArrays = new Dictionary(); } /// @@ -74,10 +90,38 @@ public static void SetChanged() changed = true; } + private static int GetNewArraySize() + { + int size = 0; + + SteamVR_Input_Sources[] sources = SteamVR_Input_Source.GetAllSources(); + for (int actionSetIndex = 0; actionSetIndex < SteamVR_Input.actionSets.Length; actionSetIndex++) + { + SteamVR_ActionSet set = SteamVR_Input.actionSets[actionSetIndex]; + + for (int sourceIndex = 0; sourceIndex < sources.Length; sourceIndex++) + { + SteamVR_Input_Sources source = sources[sourceIndex]; + + if (set.ReadRawSetActive(source)) + { + size++; + } + } + } + + return size; + } + private static void UpdateActionSetsArray() { - List activeActionSetsList = new List(); + int newArraySize = GetNewArraySize(); + if (poolActiveActionSetArrays.ContainsKey(newArraySize) == false) + { + poolActiveActionSetArrays[newArraySize] = new VRActiveActionSet_t[newArraySize]; + } + int arrayIndex = 0; SteamVR_Input_Sources[] sources = SteamVR_Input_Source.GetAllSources(); for (int actionSetIndex = 0; actionSetIndex < SteamVR_Input.actionSets.Length; actionSetIndex++) @@ -90,25 +134,17 @@ private static void UpdateActionSetsArray() if (set.ReadRawSetActive(source)) { - VRActiveActionSet_t activeSet = new VRActiveActionSet_t(); - activeSet.ulActionSet = set.handle; - activeSet.nPriority = set.ReadRawSetPriority(source); - activeSet.ulRestrictedToDevice = SteamVR_Input_Source.GetHandle(source); - - int insertionIndex = 0; - for (insertionIndex = 0; insertionIndex < activeActionSetsList.Count; insertionIndex++) - { - if (activeActionSetsList[insertionIndex].nPriority > activeSet.nPriority) - break; - } - activeActionSetsList.Insert(insertionIndex, activeSet); + poolActiveActionSetArrays[newArraySize][arrayIndex].ulActionSet = set.handle; + poolActiveActionSetArrays[newArraySize][arrayIndex].nPriority = set.ReadRawSetPriority(source); + poolActiveActionSetArrays[newArraySize][arrayIndex].ulRestrictedToDevice = SteamVR_Input_Source.GetHandle(source); + + arrayIndex++; } } } changed = false; - - rawActiveActionSetArray = activeActionSetsList.ToArray(); + currentArraySize = newArraySize; if (Application.isEditor || updateDebugTextInBuilds) UpdateDebugText(); diff --git a/Assets/SteamVR/Input/SteamVR_Action_Boolean.cs b/Assets/SteamVR/Input/SteamVR_Action_Boolean.cs index fa09dbc9..9846e991 100644 --- a/Assets/SteamVR/Input/SteamVR_Action_Boolean.cs +++ b/Assets/SteamVR/Input/SteamVR_Action_Boolean.cs @@ -378,6 +378,30 @@ public void RemoveAllListeners() foreach (Delegate existingDelegate in delegates) onState -= (SteamVR_Action_Boolean.StateHandler)existingDelegate; } + + if (onChange != null) + { + delegates = onChange.GetInvocationList(); + if (delegates != null) + foreach (Delegate existingDelegate in delegates) + onChange -= (SteamVR_Action_Boolean.ChangeHandler)existingDelegate; + } + + if (onUpdate != null) + { + delegates = onUpdate.GetInvocationList(); + if (delegates != null) + foreach (Delegate existingDelegate in delegates) + onUpdate -= (SteamVR_Action_Boolean.UpdateHandler)existingDelegate; + } + + if (onActiveChange != null) + { + delegates = onActiveChange.GetInvocationList(); + if (delegates != null) + foreach (Delegate existingDelegate in delegates) + onActiveChange -= (SteamVR_Action_Boolean.ActiveChangeHandler)existingDelegate; + } } /// [Should not be called by user code] diff --git a/Assets/SteamVR/Input/SteamVR_Action_Pose.cs b/Assets/SteamVR/Input/SteamVR_Action_Pose.cs index 7634c6ab..c1d24653 100644 --- a/Assets/SteamVR/Input/SteamVR_Action_Pose.cs +++ b/Assets/SteamVR/Input/SteamVR_Action_Pose.cs @@ -569,6 +569,14 @@ public virtual void RemoveAllListeners() onActiveChange -= (SteamVR_Action_Pose.ActiveChangeHandler)existingDelegate; } + if (onActiveBindingChange != null) + { + delegates = onActiveBindingChange.GetInvocationList(); + if (delegates != null) + foreach (Delegate existingDelegate in delegates) + onActiveBindingChange -= (SteamVR_Action_Pose.ActiveChangeHandler)existingDelegate; + } + if (onChange != null) { delegates = onChange.GetInvocationList(); @@ -618,7 +626,7 @@ public override void UpdateValue() UpdateValue(false); } - public static float framesAhead = 2; + public static float framesAhead = -1; /// [Should not be called by user code] /// Updates the data for this action and this input source. Sends related events. @@ -634,10 +642,10 @@ public virtual void UpdateValue(bool skipStateAndEventUpdates) EVRInputError err; - if (framesAhead == 0) + if (framesAhead == -1) err = OpenVR.Input.GetPoseActionDataForNextFrame(handle, universeOrigin, ref poseActionData, poseActionData_size, inputSourceHandle); else - err = OpenVR.Input.GetPoseActionDataRelativeToNow(handle, universeOrigin, framesAhead * (Time.timeScale / SteamVR.instance.hmd_DisplayFrequency), ref poseActionData, poseActionData_size, inputSourceHandle); + err = OpenVR.Input.GetPoseActionDataRelativeToNow(handle, universeOrigin, framesAhead * (1 / SteamVR.instance.hmd_DisplayFrequency), ref poseActionData, poseActionData_size, inputSourceHandle); if (err != EVRInputError.None) { diff --git a/Assets/SteamVR/Input/SteamVR_Action_Single.cs b/Assets/SteamVR/Input/SteamVR_Action_Single.cs index 3f668d9b..81c46074 100644 --- a/Assets/SteamVR/Input/SteamVR_Action_Single.cs +++ b/Assets/SteamVR/Input/SteamVR_Action_Single.cs @@ -318,6 +318,22 @@ public void RemoveAllListeners() foreach (Delegate existingDelegate in delegates) onChange -= (SteamVR_Action_Single.ChangeHandler)existingDelegate; } + + if (onActiveChange != null) + { + delegates = onActiveChange.GetInvocationList(); + if (delegates != null) + foreach (Delegate existingDelegate in delegates) + onActiveChange -= (SteamVR_Action_Single.ActiveChangeHandler)existingDelegate; + } + + if (onActiveBindingChange != null) + { + delegates = onActiveBindingChange.GetInvocationList(); + if (delegates != null) + foreach (Delegate existingDelegate in delegates) + onActiveBindingChange -= (SteamVR_Action_Single.ActiveChangeHandler)existingDelegate; + } } /// [Should not be called by user code] diff --git a/Assets/SteamVR/Input/SteamVR_Action_Skeleton.cs b/Assets/SteamVR/Input/SteamVR_Action_Skeleton.cs index 85dfee7d..a3613022 100644 --- a/Assets/SteamVR/Input/SteamVR_Action_Skeleton.cs +++ b/Assets/SteamVR/Input/SteamVR_Action_Skeleton.cs @@ -904,6 +904,14 @@ public override void RemoveAllListeners() onActiveChange -= (SteamVR_Action_Skeleton.ActiveChangeHandler)existingDelegate; } + if (onActiveBindingChange != null) + { + delegates = onActiveBindingChange.GetInvocationList(); + if (delegates != null) + foreach (Delegate existingDelegate in delegates) + onActiveBindingChange -= (SteamVR_Action_Skeleton.ActiveChangeHandler)existingDelegate; + } + if (onChange != null) { delegates = onChange.GetInvocationList(); diff --git a/Assets/SteamVR/Input/SteamVR_Action_Vector2.cs b/Assets/SteamVR/Input/SteamVR_Action_Vector2.cs index 6de60efa..098fd2ac 100644 --- a/Assets/SteamVR/Input/SteamVR_Action_Vector2.cs +++ b/Assets/SteamVR/Input/SteamVR_Action_Vector2.cs @@ -327,6 +327,22 @@ public void RemoveAllListeners() foreach (Delegate existingDelegate in delegates) onChange -= (SteamVR_Action_Vector2.ChangeHandler)existingDelegate; } + + if (onActiveChange != null) + { + delegates = onActiveChange.GetInvocationList(); + if (delegates != null) + foreach (Delegate existingDelegate in delegates) + onActiveChange -= (SteamVR_Action_Vector2.ActiveChangeHandler)existingDelegate; + } + + if (onActiveBindingChange != null) + { + delegates = onActiveBindingChange.GetInvocationList(); + if (delegates != null) + foreach (Delegate existingDelegate in delegates) + onActiveBindingChange -= (SteamVR_Action_Vector2.ActiveChangeHandler)existingDelegate; + } } /// [Should not be called by user code] diff --git a/Assets/SteamVR/Input/SteamVR_Action_Vector3.cs b/Assets/SteamVR/Input/SteamVR_Action_Vector3.cs index 8f165bed..3af76fe4 100644 --- a/Assets/SteamVR/Input/SteamVR_Action_Vector3.cs +++ b/Assets/SteamVR/Input/SteamVR_Action_Vector3.cs @@ -323,6 +323,22 @@ public void RemoveAllListeners() foreach (Delegate existingDelegate in delegates) onChange -= (SteamVR_Action_Vector3.ChangeHandler)existingDelegate; } + + if (onActiveChange != null) + { + delegates = onActiveChange.GetInvocationList(); + if (delegates != null) + foreach (Delegate existingDelegate in delegates) + onActiveChange -= (SteamVR_Action_Vector3.ActiveChangeHandler)existingDelegate; + } + + if (onActiveBindingChange != null) + { + delegates = onActiveBindingChange.GetInvocationList(); + if (delegates != null) + foreach (Delegate existingDelegate in delegates) + onActiveBindingChange -= (SteamVR_Action_Vector3.ActiveChangeHandler)existingDelegate; + } } /// [Should not be called by user code] diff --git a/Assets/SteamVR/Input/SteamVR_Action_Vibration.cs b/Assets/SteamVR/Input/SteamVR_Action_Vibration.cs index 478dbf2e..7bff300c 100644 --- a/Assets/SteamVR/Input/SteamVR_Action_Vibration.cs +++ b/Assets/SteamVR/Input/SteamVR_Action_Vibration.cs @@ -100,6 +100,14 @@ public void RemoveOnExecuteListener(ExecuteHandler functionToStopCalling, SteamV sourceMap[inputSource].onExecute -= functionToStopCalling; } + /// + /// Removes all listeners, useful for dispose pattern + /// + public void RemoveAllListeners(SteamVR_Input_Sources input_Sources) + { + sourceMap[input_Sources].RemoveAllListeners(); + } + /// /// Returns the last time this action was executed /// @@ -183,6 +191,38 @@ public override void Preinitialize(SteamVR_Action wrappingAction, SteamVR_Input_ vibrationAction = (SteamVR_Action_Vibration)wrappingAction; } + /// + /// Removes all listeners, useful for dispose pattern + /// + public void RemoveAllListeners() + { + Delegate[] delegates; + + if (onActiveBindingChange != null) + { + delegates = onActiveBindingChange.GetInvocationList(); + if (delegates != null) + foreach (Delegate existingDelegate in delegates) + onActiveBindingChange -= (SteamVR_Action_Vibration.ActiveChangeHandler)existingDelegate; + } + + if (onActiveChange != null) + { + delegates = onActiveChange.GetInvocationList(); + if (delegates != null) + foreach (Delegate existingDelegate in delegates) + onActiveChange -= (SteamVR_Action_Vibration.ActiveChangeHandler)existingDelegate; + } + + if (onExecute != null) + { + delegates = onExecute.GetInvocationList(); + if (delegates != null) + foreach (Delegate existingDelegate in delegates) + onExecute -= (SteamVR_Action_Vibration.ExecuteHandler)existingDelegate; + } + } + /// /// Trigger the haptics at a certain time for a certain length diff --git a/Assets/SteamVR/Input/SteamVR_Input_Sources.cs b/Assets/SteamVR/Input/SteamVR_Input_Sources.cs index 8b61fd88..f9e809c8 100644 --- a/Assets/SteamVR/Input/SteamVR_Input_Sources.cs +++ b/Assets/SteamVR/Input/SteamVR_Input_Sources.cs @@ -10,7 +10,7 @@ namespace Valve.VR { public enum SteamVR_Input_Sources { - [Description("/unrestricted")] //todo: check to see if this gets exported: k_ulInvalidInputHandle + [Description("/unrestricted")] Any, [Description("/user/hand/left")] @@ -51,6 +51,30 @@ public enum SteamVR_Input_Sources [Description("/user/treadmill")] Treadmill, + + [Description("/user/knee/left")] + LeftKnee, + + [Description("/user/knee/right")] + RightKnee, + + [Description("/user/elbow/left")] + LeftElbow, + + [Description("/user/elbow/right")] + RightElbow, + + [Description("/user/wrist/left")] + LeftWrist, + + [Description("/user/wrist/right")] + RightWrist, + + [Description("/user/ankle/left")] + LeftAnkle, + + [Description("/user/ankle/right")] + RightAnkle, } } diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/DebugUI.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/DebugUI.cs index 7fd2a4e4..302af8dd 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/DebugUI.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/DebugUI.cs @@ -5,7 +5,6 @@ //============================================================================= using UnityEngine; -using UnityEngine.UI; using System.Collections; namespace Valve.VR.InteractionSystem diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/Hand.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/Hand.cs index bf74082a..08f1256d 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/Hand.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/Hand.cs @@ -1435,12 +1435,12 @@ public void TriggerHapticPulse(float duration, float frequency, float amplitude) public void ShowGrabHint() { - ControllerButtonHints.ShowButtonHint(this, grabGripAction); //todo: assess + ControllerButtonHints.ShowButtonHint(this, grabGripAction); } public void HideGrabHint() { - ControllerButtonHints.HideButtonHint(this, grabGripAction); //todo: assess + ControllerButtonHints.HideTextHint(this, grabGripAction); } public void ShowGrabHint(string text) diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/HandPhysics.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/HandPhysics.cs index 8713b5c1..2db31547 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/HandPhysics.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/HandPhysics.cs @@ -101,7 +101,7 @@ private void UpdatePositions() if (!collisionsEnabled) { clearanceBuffer[0] = null; - Physics.OverlapSphereNonAlloc(hand.objectAttachmentPoint.position, collisionReenableClearanceRadius, clearanceBuffer); + Physics.OverlapSphereNonAlloc(hand.objectAttachmentPoint.position, collisionReenableClearanceRadius, clearanceBuffer, clearanceCheckMask); // if we don't find anything in the vicinity, reenable collisions! if (clearanceBuffer[0] == null) { diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/InputModule.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/InputModule.cs index 5e905e9f..9f47b967 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/InputModule.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/InputModule.cs @@ -3,7 +3,7 @@ // Purpose: Makes the hand act as an input module for Unity's event system // //============================================================================= - +#if UNITY_UGUI_UI || !UNITY_2019_2_OR_NEWER using UnityEngine; using System.Collections; using UnityEngine.EventSystems; @@ -77,3 +77,7 @@ public override void Process() } } } +#else //if we haven't run the xr install script yet use this +using UnityEngine; +namespace Valve.VR.InteractionSystem { public class InputModule : MonoBehaviour {} } +#endif \ No newline at end of file diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/Interactable.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/Interactable.cs index 1b436f79..ce16efad 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/Interactable.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/Interactable.cs @@ -67,7 +67,7 @@ public class Interactable : MonoBehaviour protected SkinnedMeshRenderer[] existingSkinnedRenderers; protected static Material highlightMat; [Tooltip("An array of child gameObjects to not render a highlight for. Things like transparent parts, vfx, etc.")] - public GameObject[] hideHighlight; + public GameObject[] hideHighlight = new GameObject[] { }; [Tooltip("Higher is better")] public int hoverPriority = 0; diff --git a/Assets/SteamVR/InteractionSystem/Core/Scripts/UIElement.cs b/Assets/SteamVR/InteractionSystem/Core/Scripts/UIElement.cs index 217803f6..b300212a 100644 --- a/Assets/SteamVR/InteractionSystem/Core/Scripts/UIElement.cs +++ b/Assets/SteamVR/InteractionSystem/Core/Scripts/UIElement.cs @@ -4,6 +4,7 @@ // //============================================================================= +#if UNITY_UGUI_UI || !UNITY_2019_2_OR_NEWER using UnityEngine; using UnityEngine.Events; using UnityEngine.UI; @@ -87,3 +88,7 @@ public override void OnInspectorGUI() } #endif } +#else +using UnityEngine; +namespace Valve.VR.InteractionSystem { public class UIElement : MonoBehaviour {} } +#endif \ No newline at end of file diff --git a/Assets/SteamVR/InteractionSystem/Hints/Scripts/ControllerButtonHints.cs b/Assets/SteamVR/InteractionSystem/Hints/Scripts/ControllerButtonHints.cs index a1001e2a..21657d10 100644 --- a/Assets/SteamVR/InteractionSystem/Hints/Scripts/ControllerButtonHints.cs +++ b/Assets/SteamVR/InteractionSystem/Hints/Scripts/ControllerButtonHints.cs @@ -4,6 +4,7 @@ // //============================================================================= +#if UNITY_UGUI_UI || !UNITY_2019_2_OR_NEWER using UnityEngine; using System.Collections; using System.Collections.Generic; @@ -873,3 +874,16 @@ public static string GetActiveHintText( Hand hand, ISteamVR_Action_In_Source act } } } +#else +using UnityEngine; +namespace Valve.VR.InteractionSystem { public class ControllerButtonHints : MonoBehaviour { + public static void ShowButtonHint(Hand hand, params ISteamVR_Action_In_Source[] actions) { } + public static void HideButtonHint(Hand hand, params ISteamVR_Action_In_Source[] actions) { } + public static void HideAllButtonHints(Hand hand) { } + public static bool IsButtonHintActive(Hand hand, ISteamVR_Action_In_Source action) { return false; } + public static void ShowTextHint(Hand hand, ISteamVR_Action_In_Source action, string text, bool highlightButton = true) { } + public static void HideTextHint(Hand hand, ISteamVR_Action_In_Source action) { } + public static void HideAllTextHints(Hand hand) { } + public static string GetActiveHintText(Hand hand, ISteamVR_Action_In_Source action) { return null; } + } } +#endif \ No newline at end of file diff --git a/Assets/SteamVR/InteractionSystem/Longbow/Scripts/Arrow.cs b/Assets/SteamVR/InteractionSystem/Longbow/Scripts/Arrow.cs index 72c71a3f..3992a847 100644 --- a/Assets/SteamVR/InteractionSystem/Longbow/Scripts/Arrow.cs +++ b/Assets/SteamVR/InteractionSystem/Longbow/Scripts/Arrow.cs @@ -37,11 +37,29 @@ public class Arrow : MonoBehaviour private GameObject scaleParentObject = null; + private float initialMass; + private float initialDrag; + private float initialAngularDrag; + private RigidbodyInterpolation initialInterpolation; + private CollisionDetectionMode initialCollisionDetection; + private bool initialUseGravity; - //------------------------------------------------- - void Start() - { - Physics.IgnoreCollision( shaftRB.GetComponent(), Player.instance.headCollider ); + + private void Awake() + { + initialMass = shaftRB.mass; + initialDrag = shaftRB.drag; + initialAngularDrag = shaftRB.angularDrag; + initialInterpolation = shaftRB.interpolation; + initialCollisionDetection = shaftRB.collisionDetectionMode; + initialUseGravity = shaftRB.useGravity; + Destroy(this.GetComponent()); + } + + //------------------------------------------------- + void Start() + { + Physics.IgnoreCollision(this.GetComponent(), Player.instance.headCollider); } @@ -52,17 +70,35 @@ void FixedUpdate() { prevPosition = transform.position; prevRotation = transform.rotation; - prevVelocity = GetComponent().velocity; + prevVelocity = shaftRB.velocity; prevHeadPosition = arrowHeadRB.transform.position; travelledFrames++; } } + public void StartRelease() + { + Rigidbody rb = this.gameObject.AddComponent(); + rb.isKinematic = true; + if (shaftRB == null) + shaftRB = rb; + + shaftRB.mass = initialMass; + shaftRB.drag = initialDrag; + shaftRB.angularDrag = initialAngularDrag; + shaftRB.interpolation = initialInterpolation; + shaftRB.collisionDetectionMode = initialCollisionDetection; + shaftRB.useGravity = initialUseGravity; + + arrowHeadRB.GetComponent().connectedBody = rb; + } + + //------------------------------------------------- public void ArrowReleased( float inputVelocity ) - { - inFlight = true; + { + inFlight = true; released = true; airReleaseSound.Play(); diff --git a/Assets/SteamVR/InteractionSystem/Longbow/Scripts/ArrowHand.cs b/Assets/SteamVR/InteractionSystem/Longbow/Scripts/ArrowHand.cs index 5d3247b6..029bca22 100644 --- a/Assets/SteamVR/InteractionSystem/Longbow/Scripts/ArrowHand.cs +++ b/Assets/SteamVR/InteractionSystem/Longbow/Scripts/ArrowHand.cs @@ -229,7 +229,8 @@ private void FireArrow() currentArrow.transform.parent = null; Arrow arrow = currentArrow.GetComponent(); - arrow.shaftRB.isKinematic = false; + arrow.StartRelease(); + arrow.shaftRB.isKinematic = false; arrow.shaftRB.useGravity = true; arrow.shaftRB.transform.GetComponent().enabled = true; @@ -240,6 +241,9 @@ private void FireArrow() arrow.arrowHeadRB.AddForce( currentArrow.transform.forward * bow.GetArrowVelocity(), ForceMode.VelocityChange ); arrow.arrowHeadRB.AddTorque( currentArrow.transform.forward * 10 ); + arrow.shaftRB.velocity = arrow.arrowHeadRB.velocity; + arrow.shaftRB.angularVelocity = arrow.arrowHeadRB.angularVelocity; + nocked = false; nockedWithType = GrabTypes.None; diff --git a/Assets/SteamVR/InteractionSystem/Samples/BuggyBuddy/BuggyController.cs b/Assets/SteamVR/InteractionSystem/Samples/BuggyBuddy/BuggyController.cs index 6d325f95..17f2e51e 100644 --- a/Assets/SteamVR/InteractionSystem/Samples/BuggyBuddy/BuggyController.cs +++ b/Assets/SteamVR/InteractionSystem/Samples/BuggyBuddy/BuggyController.cs @@ -1,4 +1,11 @@ -using System.Collections; +//======= Copyright (c) Valve Corporation, All rights reserved. =============== +// +// Purpose: UIElement that responds to VR hands and generates UnityEvents +// +//============================================================================= + +#if UNITY_UGUI_UI || !UNITY_2019_2_OR_NEWER +using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; @@ -172,4 +179,8 @@ private IEnumerator DoBuzz() } } } -} \ No newline at end of file +} +#else +using UnityEngine; +namespace Valve.VR.InteractionSystem.Sample { public class BuggyController : MonoBehaviour {} } +#endif \ No newline at end of file diff --git a/Assets/SteamVR/InteractionSystem/Samples/Scripts/RenderModelChangerUI.cs b/Assets/SteamVR/InteractionSystem/Samples/Scripts/RenderModelChangerUI.cs index 183eca59..acebafcf 100644 --- a/Assets/SteamVR/InteractionSystem/Samples/Scripts/RenderModelChangerUI.cs +++ b/Assets/SteamVR/InteractionSystem/Samples/Scripts/RenderModelChangerUI.cs @@ -1,5 +1,6 @@ //======= Copyright (c) Valve Corporation, All rights reserved. =============== +#if UNITY_UGUI_UI || !UNITY_2019_2_OR_NEWER using UnityEngine; using System.Collections; @@ -29,4 +30,11 @@ protected override void OnButtonClick() } } } -} \ No newline at end of file +} +#else +using UnityEngine; +namespace Valve.VR.InteractionSystem.Sample { public class RenderModelChangerUI : MonoBehaviour { + public GameObject leftPrefab; + public GameObject rightPrefab; +} } +#endif \ No newline at end of file diff --git a/Assets/SteamVR/InteractionSystem/Samples/Scripts/TargetMeasurement.cs b/Assets/SteamVR/InteractionSystem/Samples/Scripts/TargetMeasurement.cs index 2cbbf4a1..20f9f749 100644 --- a/Assets/SteamVR/InteractionSystem/Samples/Scripts/TargetMeasurement.cs +++ b/Assets/SteamVR/InteractionSystem/Samples/Scripts/TargetMeasurement.cs @@ -1,5 +1,6 @@ //======= Copyright (c) Valve Corporation, All rights reserved. =============== +#if UNITY_UGUI_UI || !UNITY_2019_2_OR_NEWER using UnityEngine; using System.Collections; using UnityEngine.UI; @@ -50,4 +51,8 @@ private void Update() } } } -} \ No newline at end of file +} +#else +using UnityEngine; +namespace Valve.VR.InteractionSystem.Sample { public class TargetMeasurement : MonoBehaviour { } } +#endif \ No newline at end of file diff --git a/Assets/SteamVR/InteractionSystem/Teleport/Scripts/Teleport.cs b/Assets/SteamVR/InteractionSystem/Teleport/Scripts/Teleport.cs index 71352766..557b881f 100644 --- a/Assets/SteamVR/InteractionSystem/Teleport/Scripts/Teleport.cs +++ b/Assets/SteamVR/InteractionSystem/Teleport/Scripts/Teleport.cs @@ -797,7 +797,7 @@ private void PlayAudioClip( AudioSource source, AudioClip clip ) //------------------------------------------------- private void PlayPointerHaptic( bool validLocation ) { - if ( pointerHand != null ) + if ( pointerHand != null && pointerHand.noSteamVRFallbackCamera == null ) { if ( validLocation ) { @@ -896,9 +896,9 @@ private void TeleportPlayer() Vector3 playerFeetOffset = player.trackingOriginTransform.position - player.feetPositionGuess; player.trackingOriginTransform.position = teleportPosition + playerFeetOffset; - if (player.leftHand.currentAttachedObjectInfo.HasValue) + if (player.leftHand != null && player.leftHand.currentAttachedObjectInfo.HasValue) player.leftHand.ResetAttachedTransform(player.leftHand.currentAttachedObjectInfo.Value); - if (player.rightHand.currentAttachedObjectInfo.HasValue) + if (player.rightHand != null && player.rightHand.currentAttachedObjectInfo.HasValue) player.rightHand.ResetAttachedTransform(player.rightHand.currentAttachedObjectInfo.Value); } else diff --git a/Assets/SteamVR/InteractionSystem/Teleport/Scripts/TeleportPoint.cs b/Assets/SteamVR/InteractionSystem/Teleport/Scripts/TeleportPoint.cs index d3fecfa4..a561da6f 100644 --- a/Assets/SteamVR/InteractionSystem/Teleport/Scripts/TeleportPoint.cs +++ b/Assets/SteamVR/InteractionSystem/Teleport/Scripts/TeleportPoint.cs @@ -4,6 +4,7 @@ // //============================================================================= +#if UNITY_UGUI_UI || !UNITY_2019_2_OR_NEWER using UnityEngine; using UnityEngine.UI; #if UNITY_EDITOR @@ -350,3 +351,19 @@ public override void OnInspectorGUI() } #endif } + +#else +using UnityEngine; +namespace Valve.VR.InteractionSystem { public class TeleportPoint : TeleportMarkerBase { + public override void Highlight(bool highlight) { } + public override void SetAlpha(float tintAlpha, float alphaPercent) { } + public override bool ShouldActivate(Vector3 playerPosition) { return false; } + public override bool ShouldMovePlayer() { return false; } + public override void TeleportPlayer(Vector3 pointedAtPosition) { } + public override void UpdateVisuals() { } + public bool playerSpawnPoint = false; + public enum TeleportPointType { MoveToLocation, SwitchToNewScene }; + public TeleportPointType teleportType = TeleportPointType.MoveToLocation; + public void TeleportToScene() { } + } } +#endif \ No newline at end of file diff --git a/Assets/SteamVR/OpenVRUnityXRPackage/Editor/com.valvesoftware.unity.openvr-1.1.4.tgz b/Assets/SteamVR/OpenVRUnityXRPackage/Editor/com.valvesoftware.unity.openvr-1.2.1.tgz similarity index 59% rename from Assets/SteamVR/OpenVRUnityXRPackage/Editor/com.valvesoftware.unity.openvr-1.1.4.tgz rename to Assets/SteamVR/OpenVRUnityXRPackage/Editor/com.valvesoftware.unity.openvr-1.2.1.tgz index 31299906..b2322fb1 100644 Binary files a/Assets/SteamVR/OpenVRUnityXRPackage/Editor/com.valvesoftware.unity.openvr-1.1.4.tgz and b/Assets/SteamVR/OpenVRUnityXRPackage/Editor/com.valvesoftware.unity.openvr-1.2.1.tgz differ diff --git a/Assets/SteamVR/OpenVRUnityXRPackage/Editor/com.valvesoftware.unity.openvr-1.1.4.tgz.meta b/Assets/SteamVR/OpenVRUnityXRPackage/Editor/com.valvesoftware.unity.openvr-1.2.1.tgz.meta similarity index 53% rename from Assets/SteamVR/OpenVRUnityXRPackage/Editor/com.valvesoftware.unity.openvr-1.1.4.tgz.meta rename to Assets/SteamVR/OpenVRUnityXRPackage/Editor/com.valvesoftware.unity.openvr-1.2.1.tgz.meta index 748ed0bd..46cb40bb 100644 --- a/Assets/SteamVR/OpenVRUnityXRPackage/Editor/com.valvesoftware.unity.openvr-1.1.4.tgz.meta +++ b/Assets/SteamVR/OpenVRUnityXRPackage/Editor/com.valvesoftware.unity.openvr-1.2.1.tgz.meta @@ -1,7 +1,7 @@ fileFormatVersion: 2 -guid: 2fab3fcda6e74e74f9a2be92af13e3d3 -timeCreated: 1610087337 -licenseType: Pro +guid: 9c82398bce8eb28438c2b919280ec0e9 +timeCreated: 1705015006 +licenseType: Free DefaultImporter: userData: assetBundleName: diff --git a/Assets/SteamVR/Plugins/openvr_api.cs b/Assets/SteamVR/Plugins/openvr_api.cs index 178724e9..a6d7cf41 100644 --- a/Assets/SteamVR/Plugins/openvr_api.cs +++ b/Assets/SteamVR/Plugins/openvr_api.cs @@ -731,7 +731,7 @@ public struct IVRCompositor internal _GetCurrentFadeColor GetCurrentFadeColor; [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate void _FadeGrid(float fSeconds, bool bFadeIn); + internal delegate void _FadeGrid(float fSeconds, bool bFadeGridIn); [MarshalAs(UnmanagedType.FunctionPtr)] internal _FadeGrid FadeGrid; @@ -1045,6 +1045,16 @@ public struct IVROverlay [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetOverlayCurvature GetOverlayCurvature; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVROverlayError _SetOverlayPreCurvePitch(ulong ulOverlayHandle, float fRadians); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _SetOverlayPreCurvePitch SetOverlayPreCurvePitch; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVROverlayError _GetOverlayPreCurvePitch(ulong ulOverlayHandle, ref float pfRadians); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _GetOverlayPreCurvePitch GetOverlayPreCurvePitch; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] internal delegate EVROverlayError _SetOverlayTextureColorSpace(ulong ulOverlayHandle, EColorSpace eTextureColorSpace); [MarshalAs(UnmanagedType.FunctionPtr)] @@ -1100,16 +1110,6 @@ public struct IVROverlay [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetOverlayTransformTrackedDeviceComponent GetOverlayTransformTrackedDeviceComponent; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate EVROverlayError _GetOverlayTransformOverlayRelative(ulong ulOverlayHandle, ref ulong ulOverlayHandleParent, ref HmdMatrix34_t pmatParentOverlayToOverlayTransform); - [MarshalAs(UnmanagedType.FunctionPtr)] - internal _GetOverlayTransformOverlayRelative GetOverlayTransformOverlayRelative; - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate EVROverlayError _SetOverlayTransformOverlayRelative(ulong ulOverlayHandle, ulong ulOverlayHandleParent, ref HmdMatrix34_t pmatParentOverlayToOverlayTransform); - [MarshalAs(UnmanagedType.FunctionPtr)] - internal _SetOverlayTransformOverlayRelative SetOverlayTransformOverlayRelative; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] internal delegate EVROverlayError _SetOverlayTransformCursor(ulong ulCursorOverlayHandle, ref HmdVector2_t pvHotspot); [MarshalAs(UnmanagedType.FunctionPtr)] @@ -1120,6 +1120,11 @@ public struct IVROverlay [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetOverlayTransformCursor GetOverlayTransformCursor; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVROverlayError _SetOverlayTransformProjection(ulong ulOverlayHandle, ETrackingUniverseOrigin eTrackingOrigin, ref HmdMatrix34_t pmatTrackingOriginToOverlayTransform, ref VROverlayProjection_t pProjection, EVREye eEye); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _SetOverlayTransformProjection SetOverlayTransformProjection; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] internal delegate EVROverlayError _ShowOverlay(ulong ulOverlayHandle); [MarshalAs(UnmanagedType.FunctionPtr)] @@ -1140,6 +1145,11 @@ public struct IVROverlay [MarshalAs(UnmanagedType.FunctionPtr)] internal _GetTransformForOverlayCoordinates GetTransformForOverlayCoordinates; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + internal delegate EVROverlayError _WaitFrameSync(uint nTimeoutMs); + [MarshalAs(UnmanagedType.FunctionPtr)] + internal _WaitFrameSync WaitFrameSync; + [UnmanagedFunctionPointer(CallingConvention.StdCall)] internal delegate bool _PollNextOverlayEvent(ulong ulOverlayHandle, ref VREvent_t pEvent, uint uncbVREvent); [MarshalAs(UnmanagedType.FunctionPtr)] @@ -1946,7 +1956,7 @@ public struct IVRPaths public struct IVRBlockQueue { [UnmanagedFunctionPointer(CallingConvention.StdCall)] - internal delegate EBlockQueueError _Create(ref ulong pulQueueHandle, IntPtr pchPath, uint unBlockDataSize, uint unBlockHeaderSize, uint unBlockCount); + internal delegate EBlockQueueError _Create(ref ulong pulQueueHandle, IntPtr pchPath, uint unBlockDataSize, uint unBlockHeaderSize, uint unBlockCount, uint unFlags); [MarshalAs(UnmanagedType.FunctionPtr)] internal _Create Create; @@ -2899,9 +2909,9 @@ public HmdColor_t GetCurrentFadeColor(bool bBackground) HmdColor_t result = FnTable.GetCurrentFadeColor(bBackground); return result; } - public void FadeGrid(float fSeconds,bool bFadeIn) + public void FadeGrid(float fSeconds,bool bFadeGridIn) { - FnTable.FadeGrid(fSeconds,bFadeIn); + FnTable.FadeGrid(fSeconds,bFadeGridIn); } public float GetCurrentGridAlpha() { @@ -3230,6 +3240,17 @@ public EVROverlayError GetOverlayCurvature(ulong ulOverlayHandle,ref float pfCur EVROverlayError result = FnTable.GetOverlayCurvature(ulOverlayHandle,ref pfCurvature); return result; } + public EVROverlayError SetOverlayPreCurvePitch(ulong ulOverlayHandle,float fRadians) + { + EVROverlayError result = FnTable.SetOverlayPreCurvePitch(ulOverlayHandle,fRadians); + return result; + } + public EVROverlayError GetOverlayPreCurvePitch(ulong ulOverlayHandle,ref float pfRadians) + { + pfRadians = 0; + EVROverlayError result = FnTable.GetOverlayPreCurvePitch(ulOverlayHandle,ref pfRadians); + return result; + } public EVROverlayError SetOverlayTextureColorSpace(ulong ulOverlayHandle,EColorSpace eTextureColorSpace) { EVROverlayError result = FnTable.SetOverlayTextureColorSpace(ulOverlayHandle,eTextureColorSpace); @@ -3289,17 +3310,6 @@ public EVROverlayError GetOverlayTransformTrackedDeviceComponent(ulong ulOverlay EVROverlayError result = FnTable.GetOverlayTransformTrackedDeviceComponent(ulOverlayHandle,ref punDeviceIndex,pchComponentName,unComponentNameSize); return result; } - public EVROverlayError GetOverlayTransformOverlayRelative(ulong ulOverlayHandle,ref ulong ulOverlayHandleParent,ref HmdMatrix34_t pmatParentOverlayToOverlayTransform) - { - ulOverlayHandleParent = 0; - EVROverlayError result = FnTable.GetOverlayTransformOverlayRelative(ulOverlayHandle,ref ulOverlayHandleParent,ref pmatParentOverlayToOverlayTransform); - return result; - } - public EVROverlayError SetOverlayTransformOverlayRelative(ulong ulOverlayHandle,ulong ulOverlayHandleParent,ref HmdMatrix34_t pmatParentOverlayToOverlayTransform) - { - EVROverlayError result = FnTable.SetOverlayTransformOverlayRelative(ulOverlayHandle,ulOverlayHandleParent,ref pmatParentOverlayToOverlayTransform); - return result; - } public EVROverlayError SetOverlayTransformCursor(ulong ulCursorOverlayHandle,ref HmdVector2_t pvHotspot) { EVROverlayError result = FnTable.SetOverlayTransformCursor(ulCursorOverlayHandle,ref pvHotspot); @@ -3310,6 +3320,11 @@ public EVROverlayError GetOverlayTransformCursor(ulong ulOverlayHandle,ref HmdVe EVROverlayError result = FnTable.GetOverlayTransformCursor(ulOverlayHandle,ref pvHotspot); return result; } + public EVROverlayError SetOverlayTransformProjection(ulong ulOverlayHandle,ETrackingUniverseOrigin eTrackingOrigin,ref HmdMatrix34_t pmatTrackingOriginToOverlayTransform,ref VROverlayProjection_t pProjection,EVREye eEye) + { + EVROverlayError result = FnTable.SetOverlayTransformProjection(ulOverlayHandle,eTrackingOrigin,ref pmatTrackingOriginToOverlayTransform,ref pProjection,eEye); + return result; + } public EVROverlayError ShowOverlay(ulong ulOverlayHandle) { EVROverlayError result = FnTable.ShowOverlay(ulOverlayHandle); @@ -3330,6 +3345,11 @@ public EVROverlayError GetTransformForOverlayCoordinates(ulong ulOverlayHandle,E EVROverlayError result = FnTable.GetTransformForOverlayCoordinates(ulOverlayHandle,eTrackingOrigin,coordinatesInOverlay,ref pmatTransform); return result; } + public EVROverlayError WaitFrameSync(uint nTimeoutMs) + { + EVROverlayError result = FnTable.WaitFrameSync(nTimeoutMs); + return result; + } // This is a terrible hack to workaround the fact that VRControllerState_t and VREvent_t were // originally mis-compiled with the wrong packing for Linux and OSX. [UnmanagedFunctionPointer(CallingConvention.StdCall)] @@ -4415,11 +4435,11 @@ internal CVRBlockQueue(IntPtr pInterface) { FnTable = (IVRBlockQueue)Marshal.PtrToStructure(pInterface, typeof(IVRBlockQueue)); } - public EBlockQueueError Create(ref ulong pulQueueHandle,string pchPath,uint unBlockDataSize,uint unBlockHeaderSize,uint unBlockCount) + public EBlockQueueError Create(ref ulong pulQueueHandle,string pchPath,uint unBlockDataSize,uint unBlockHeaderSize,uint unBlockCount,uint unFlags) { pulQueueHandle = 0; IntPtr pchPathUtf8 = Utils.ToUtf8(pchPath); - EBlockQueueError result = FnTable.Create(ref pulQueueHandle,pchPathUtf8,unBlockDataSize,unBlockHeaderSize,unBlockCount); + EBlockQueueError result = FnTable.Create(ref pulQueueHandle,pchPathUtf8,unBlockDataSize,unBlockHeaderSize,unBlockCount,unFlags); Marshal.FreeHGlobal(pchPathUtf8); return result; } @@ -4515,6 +4535,7 @@ public enum ETextureType DirectX12 = 4, DXGISharedHandle = 5, Metal = 6, + Reserved = 7, } public enum EColorSpace { @@ -4619,6 +4640,9 @@ public enum ETrackedDeviceProperty Prop_ManufacturerSerialNumber_String = 1049, Prop_ComputedSerialNumber_String = 1050, Prop_EstimatedDeviceFirstUseTime_Int32 = 1051, + Prop_DevicePowerUsage_Float = 1052, + Prop_IgnoreMotionForStandby_Bool = 1053, + Prop_ActualTrackingSystemName_String = 1054, Prop_ReportsTimeSinceVSync_Bool = 2000, Prop_SecondsFromVsyncToPhotons_Float = 2001, Prop_DisplayFrequency_Float = 2002, @@ -4704,9 +4728,26 @@ public enum ETrackedDeviceProperty Prop_DisplaySupportsAnalogGain_Bool = 2085, Prop_DisplayMinAnalogGain_Float = 2086, Prop_DisplayMaxAnalogGain_Float = 2087, + Prop_CameraExposureTime_Float = 2088, + Prop_CameraGlobalGain_Float = 2089, Prop_DashboardScale_Float = 2091, + Prop_PeerButtonInfo_String = 2092, + Prop_Hmd_SupportsHDR10_Bool = 2093, + Prop_Hmd_EnableParallelRenderCameras_Bool = 2094, + Prop_DriverProvidedChaperoneJson_String = 2095, Prop_IpdUIRangeMinMeters_Float = 2100, Prop_IpdUIRangeMaxMeters_Float = 2101, + Prop_Hmd_SupportsHDCP14LegacyCompat_Bool = 2102, + Prop_Hmd_SupportsMicMonitoring_Bool = 2103, + Prop_Hmd_SupportsDisplayPortTrainingMode_Bool = 2104, + Prop_Hmd_SupportsRoomViewDirect_Bool = 2105, + Prop_Hmd_SupportsAppThrottling_Bool = 2106, + Prop_Hmd_SupportsGpuBusMonitoring_Bool = 2107, + Prop_DriverDisplaysIPDChanges_Bool = 2108, + Prop_Driver_Reserved_01 = 2109, + Prop_DSCVersion_Int32 = 2110, + Prop_DSCSliceCount_Int32 = 2111, + Prop_DSCBPPx16_Int32 = 2112, Prop_DriverRequestedMuraCorrectionMode_Int32 = 2200, Prop_DriverRequestedMuraFeather_InnerLeft_Int32 = 2201, Prop_DriverRequestedMuraFeather_InnerRight_Int32 = 2202, @@ -4801,6 +4842,10 @@ public enum EVRSubmitFlags Submit_TextureWithDepth = 16, Submit_FrameDiscontinuty = 32, Submit_VulkanTextureWithArrayData = 64, + Submit_GlArrayTexture = 128, + Submit_IsEgl = 256, + Submit_Reserved2 = 32768, + Submit_Reserved3 = 65536, } public enum EVRState { @@ -4831,6 +4876,8 @@ public enum EVREventType VREvent_PropertyChanged = 111, VREvent_WirelessDisconnect = 112, VREvent_WirelessReconnect = 113, + VREvent_Reserved_01 = 114, + VREvent_Reserved_02 = 115, VREvent_ButtonPress = 200, VREvent_ButtonUnpress = 201, VREvent_ButtonTouch = 202, @@ -4851,13 +4898,13 @@ public enum EVREventType VREvent_InputFocusCaptured = 400, VREvent_InputFocusReleased = 401, VREvent_SceneApplicationChanged = 404, - VREvent_SceneFocusChanged = 405, VREvent_InputFocusChanged = 406, VREvent_SceneApplicationUsingWrongGraphicsAdapter = 408, VREvent_ActionBindingReloaded = 409, VREvent_HideRenderModels = 410, VREvent_ShowRenderModels = 411, VREvent_SceneApplicationStateChanged = 412, + VREvent_SceneAppPipeDisconnected = 413, VREvent_ConsoleOpened = 420, VREvent_ConsoleClosed = 421, VREvent_OverlayShown = 500, @@ -4888,6 +4935,10 @@ public enum EVREventType VREvent_ShowDevTools = 529, VREvent_DesktopViewUpdating = 530, VREvent_DesktopViewReady = 531, + VREvent_StartDashboard = 532, + VREvent_ElevatePrism = 533, + VREvent_OverlayClosed = 534, + VREvent_DashboardThumbChanged = 535, VREvent_Notification_Shown = 600, VREvent_Notification_Hidden = 601, VREvent_Notification_BeginInteraction = 602, @@ -4897,6 +4948,7 @@ public enum EVREventType VREvent_QuitAcknowledged = 703, VREvent_DriverRequestedQuit = 704, VREvent_RestartRequested = 705, + VREvent_InvalidateSwapTextureSets = 706, VREvent_ChaperoneDataHasChanged = 800, VREvent_ChaperoneUniverseHasChanged = 801, VREvent_ChaperoneTempDataHasChanged = 802, @@ -4929,6 +4981,7 @@ public enum EVREventType VREvent_GpuSpeedSectionSettingChanged = 869, VREvent_WindowsMRSectionSettingChanged = 870, VREvent_OtherSectionSettingChanged = 871, + VREvent_AnyDriverSettingsChanged = 872, VREvent_StatusUpdate = 900, VREvent_WebInterface_InstallDriverCompleted = 950, VREvent_MCImageUpdated = 1000, @@ -4937,6 +4990,8 @@ public enum EVREventType VREvent_KeyboardClosed = 1200, VREvent_KeyboardCharInput = 1201, VREvent_KeyboardDone = 1202, + VREvent_KeyboardOpened_Global = 1203, + VREvent_KeyboardClosed_Global = 1204, VREvent_ApplicationListUpdated = 1303, VREvent_ApplicationMimeTypeLoad = 1304, VREvent_ProcessConnected = 1306, @@ -4951,6 +5006,7 @@ public enum EVREventType VREvent_Compositor_OutOfVideoMemory = 1417, VREvent_Compositor_DisplayModeNotSupported = 1418, VREvent_Compositor_StageOverrideReady = 1419, + VREvent_Compositor_RequestDisconnectReconnect = 1420, VREvent_TrackedCamera_StartVideoStream = 1500, VREvent_TrackedCamera_StopVideoStream = 1501, VREvent_TrackedCamera_PauseVideoStream = 1502, @@ -5011,6 +5067,8 @@ public enum EVRButtonId k_EButton_IndexController_A = 2, k_EButton_IndexController_B = 1, k_EButton_IndexController_JoyStick = 35, + k_EButton_Reserved0 = 50, + k_EButton_Reserved1 = 51, k_EButton_Max = 64, } public enum EVRMouseButton @@ -5141,6 +5199,7 @@ public enum EVROverlayError TextureAlreadyLocked = 31, TextureLockCapacityReached = 32, TextureNotLocked = 33, + TimedOut = 34, } public enum EVRApplicationType { @@ -5153,8 +5212,12 @@ public enum EVRApplicationType VRApplication_SteamWatchdog = 6, VRApplication_Bootstrapper = 7, VRApplication_WebHelper = 8, - VRApplication_OpenXR = 9, - VRApplication_Max = 10, + VRApplication_OpenXRInstance = 9, + VRApplication_OpenXRScene = 10, + VRApplication_OpenXROverlay = 11, + VRApplication_Prism = 12, + VRApplication_RoomView = 13, + VRApplication_Max = 14, } public enum EVRFirmwareError { @@ -5234,6 +5297,27 @@ public enum EVRInitError Init_FailedForVrMonitor = 144, Init_PropertyManagerInitFailed = 145, Init_WebServerFailed = 146, + Init_IllegalTypeTransition = 147, + Init_MismatchedRuntimes = 148, + Init_InvalidProcessId = 149, + Init_VRServiceStartupFailed = 150, + Init_PrismNeedsNewDrivers = 151, + Init_PrismStartupTimedOut = 152, + Init_CouldNotStartPrism = 153, + Init_PrismClientInitFailed = 154, + Init_PrismClientStartFailed = 155, + Init_PrismExitedUnexpectedly = 156, + Init_BadLuid = 157, + Init_NoServerForAppContainer = 158, + Init_DuplicateBootstrapper = 159, + Init_VRDashboardServicePending = 160, + Init_VRDashboardServiceTimeout = 161, + Init_VRDashboardServiceStopped = 162, + Init_VRDashboardAlreadyStarted = 163, + Init_VRDashboardCopyFailed = 164, + Init_VRDashboardTokenFailure = 165, + Init_VRDashboardEnvironmentFailure = 166, + Init_VRDashboardPathFailure = 167, Driver_Failed = 200, Driver_Unknown = 201, Driver_HmdUnknown = 202, @@ -5247,6 +5331,8 @@ public enum EVRInitError Driver_HmdDriverIdOutOfBounds = 211, Driver_HmdDisplayMirrored = 212, Driver_HmdDisplayNotFoundLaptop = 213, + Driver_PeerDriverNotInstalled = 214, + Driver_WirelessHmdNotConnected = 215, IPC_ServerInitFailed = 300, IPC_ConnectFailed = 301, IPC_SharedStateInitFailed = 302, @@ -5349,8 +5435,18 @@ public enum EVRInitError Compositor_CreateOverlayInvalidCall = 488, Compositor_CreateOverlayAlreadyInitialized = 489, Compositor_FailedToCreateMailbox = 490, + Compositor_WindowInterfaceIsNull = 491, + Compositor_SystemLayerCreateInstance = 492, + Compositor_SystemLayerCreateSession = 493, + Compositor_CreateInverseDistortUVs = 494, + Compositor_CreateBackbufferDepth = 495, + Compositor_CannotDRMLeaseDisplay = 496, + Compositor_CannotConnectToDisplayServer = 497, + Compositor_GnomeNoDRMLeasing = 498, + Compositor_FailedToInitializeEncoder = 499, VendorSpecific_UnableToConnectToOculusRuntime = 1000, VendorSpecific_WindowsNotInDevMode = 1001, + VendorSpecific_OculusLinkNotEnabled = 1002, VendorSpecific_HmdFound_CantOpenDevice = 1101, VendorSpecific_HmdFound_UnableToRequestConfigStart = 1102, VendorSpecific_HmdFound_NoStoredConfig = 1103, @@ -5365,6 +5461,7 @@ public enum EVRInitError VendorSpecific_HmdFound_UserDataError = 1112, VendorSpecific_HmdFound_ConfigFailedSanityCheck = 1113, VendorSpecific_OculusRuntimeBadInstall = 1114, + VendorSpecific_HmdFound_UnexpectedConfiguration_1 = 1115, Steam_SteamInstallationNotFound = 2000, LastError = 2001, } @@ -5466,6 +5563,7 @@ public enum EVRApplicationError PropertyNotSet = 201, UnknownProperty = 202, InvalidParameter = 203, + NotImplemented = 300, } public enum EVRApplicationProperty { @@ -5550,12 +5648,13 @@ public enum VROverlayTransformType VROverlayTransform_Invalid = -1, VROverlayTransform_Absolute = 0, VROverlayTransform_TrackedDeviceRelative = 1, - VROverlayTransform_SystemOverlay = 2, VROverlayTransform_TrackedComponent = 3, VROverlayTransform_Cursor = 4, VROverlayTransform_DashboardTab = 5, VROverlayTransform_DashboardThumb = 6, VROverlayTransform_Mountable = 7, + VROverlayTransform_Projection = 8, + VROverlayTransform_Subview = 9, } public enum VROverlayFlags { @@ -5576,6 +5675,13 @@ public enum VROverlayFlags HideLaserIntersection = 524288, WantsModalBehavior = 1048576, IsPremultiplied = 2097152, + IgnoreTextureAlpha = 4194304, + EnableControlBar = 8388608, + EnableControlBarKeyboard = 16777216, + EnableControlBarClose = 33554432, + Reserved = 67108864, + EnableClickStabilization = 134217728, + MultiCursor = 268435456, } public enum VRMessageOverlayResponse { @@ -5607,6 +5713,8 @@ public enum EKeyboardFlags { KeyboardFlag_Minimal = 1, KeyboardFlag_Modal = 2, + KeyboardFlag_ShowArrowKeys = 4, + KeyboardFlag_HideDoneKey = 8, } public enum EDeviceType { @@ -5643,6 +5751,7 @@ public enum EVRRenderModelTextureFormat BC4 = 2, BC7 = 3, BC7_SRGB = 4, + RGBA16_FLOAT = 5, } public enum EVRNotificationType { @@ -5769,6 +5878,10 @@ public enum EBlockQueueReadType BlockQueueRead_New = 1, BlockQueueRead_Next = 2, } +public enum EBlockQueueCreationFlag +{ + BlockQueueFlag_OwnerIsReader = 1, +} [StructLayout(LayoutKind.Explicit)] public struct VREvent_Data_t { @@ -5949,6 +6062,11 @@ private static void _copysign(ref float sizeval, float signval) public HmdVector2_t vTopLeft; public HmdVector2_t vBottomRight; } +[StructLayout(LayoutKind.Sequential)] public struct VRBoneTransform_t +{ + public HmdVector4_t position; + public HmdQuaternionf_t orientation; +} [StructLayout(LayoutKind.Sequential)] public struct DistortionCoordinates_t { public float rfRed0; //float[2] @@ -5964,17 +6082,6 @@ private static void _copysign(ref float sizeval, float signval) public ETextureType eType; public EColorSpace eColorSpace; } -[StructLayout(LayoutKind.Sequential)] public struct TrackedDevicePose_t -{ - public HmdMatrix34_t mDeviceToAbsoluteTracking; - public HmdVector3_t vVelocity; - public HmdVector3_t vAngularVelocity; - public ETrackingResult eTrackingResult; - [MarshalAs(UnmanagedType.I1)] - public bool bPoseIsValid; - [MarshalAs(UnmanagedType.I1)] - public bool bDeviceIsConnected; -} [StructLayout(LayoutKind.Sequential)] public struct VRTextureBounds_t { public float uMin; @@ -6010,6 +6117,17 @@ private static void _copysign(ref float sizeval, float signval) public HmdMatrix34_t mDeviceToAbsoluteTracking; public VRTextureDepthInfo_t depth; } +[StructLayout(LayoutKind.Sequential)] public struct TrackedDevicePose_t +{ + public HmdMatrix34_t mDeviceToAbsoluteTracking; + public HmdVector3_t vVelocity; + public HmdVector3_t vAngularVelocity; + public ETrackingResult eTrackingResult; + [MarshalAs(UnmanagedType.I1)] + public bool bPoseIsValid; + [MarshalAs(UnmanagedType.I1)] + public bool bDeviceIsConnected; +} [StructLayout(LayoutKind.Sequential)] public struct VRVulkanTextureData_t { public ulong m_nImage; @@ -6043,6 +6161,7 @@ private static void _copysign(ref float sizeval, float signval) public float x; public float y; public uint button; + public uint cursorIndex; } [StructLayout(LayoutKind.Sequential)] public struct VREvent_Scroll_t { @@ -6050,6 +6169,7 @@ private static void _copysign(ref float sizeval, float signval) public float ydelta; public uint unused; public float viewportscale; + public uint cursorIndex; } [StructLayout(LayoutKind.Sequential)] public struct VREvent_TouchPadMove_t { @@ -6079,6 +6199,8 @@ private static void _copysign(ref float sizeval, float signval) { public ulong overlayHandle; public ulong devicePath; + public ulong memoryBlockId; + public uint cursorIndex; } [StructLayout(LayoutKind.Sequential)] public struct VREvent_Status_t { @@ -6104,6 +6226,7 @@ public string cNewInput } } public ulong uUserValue; + public ulong overlayHandle; } [StructLayout(LayoutKind.Sequential)] public struct VREvent_Ipd_t { @@ -6301,11 +6424,6 @@ public void Unpack(ref VRControllerState_t unpacked) unpacked.rAxis4 = this.rAxis4; } } -[StructLayout(LayoutKind.Sequential)] public struct VRBoneTransform_t -{ - public HmdVector4_t position; - public HmdQuaternionf_t orientation; -} [StructLayout(LayoutKind.Sequential)] public struct CameraVideoStreamFrameHeader_t { public EVRTrackedCameraFrameType eFrameType; @@ -6387,6 +6505,13 @@ public void Unpack(ref VRControllerState_t unpacked) public uint m_nNumFramePresentsTimedOut; public uint m_nNumDroppedFramesTimedOut; public uint m_nNumReprojectedFramesTimedOut; + public uint m_nNumFrameSubmits; + public double m_flSumCompositorCPUTimeMS; + public double m_flSumCompositorGPUTimeMS; + public double m_flSumTargetFrameTimes; + public double m_flSumApplicationCPUTimeMS; + public double m_flSumApplicationGPUTimeMS; + public uint m_nNumFramesWithDepth; } [StructLayout(LayoutKind.Sequential)] public struct Compositor_StageRenderSettings { @@ -6433,6 +6558,13 @@ public void Unpack(ref VRControllerState_t unpacked) public EVROverlayIntersectionMaskPrimitiveType m_nPrimitiveType; public VROverlayIntersectionMaskPrimitive_Data_t m_Primitive; } +[StructLayout(LayoutKind.Sequential)] public struct VROverlayProjection_t +{ + public float fLeft; + public float fRight; + public float fTop; + public float fBottom; +} [StructLayout(LayoutKind.Sequential)] public struct VROverlayView_t { public ulong overlayHandle; @@ -6465,6 +6597,7 @@ public void Unpack(ref VRControllerState_t unpacked) public ushort unHeight; public IntPtr rubTextureMapData; // const uint8_t * public EVRRenderModelTextureFormat format; + public ushort unMipLevels; } // This structure is for backwards binary compatibility on Linux and OSX only [StructLayout(LayoutKind.Sequential, Pack = 4)] public struct RenderModel_TextureMap_t_Packed @@ -6473,12 +6606,14 @@ public void Unpack(ref VRControllerState_t unpacked) public ushort unHeight; public IntPtr rubTextureMapData; // const uint8_t * public EVRRenderModelTextureFormat format; + public ushort unMipLevels; public RenderModel_TextureMap_t_Packed(RenderModel_TextureMap_t unpacked) { this.unWidth = unpacked.unWidth; this.unHeight = unpacked.unHeight; this.rubTextureMapData = unpacked.rubTextureMapData; this.format = unpacked.format; + this.unMipLevels = unpacked.unMipLevels; } public void Unpack(ref RenderModel_TextureMap_t unpacked) { @@ -6486,6 +6621,7 @@ public void Unpack(ref RenderModel_TextureMap_t unpacked) unpacked.unHeight = this.unHeight; unpacked.rubTextureMapData = this.rubTextureMapData; unpacked.format = this.format; + unpacked.unMipLevels = this.unMipLevels; } } [StructLayout(LayoutKind.Sequential)] public struct RenderModel_t @@ -7519,12 +7655,12 @@ public static uint GetInitToken() public const string IVRApplications_Version = "IVRApplications_007"; public const string IVRChaperone_Version = "IVRChaperone_004"; public const string IVRChaperoneSetup_Version = "IVRChaperoneSetup_006"; - public const string IVRCompositor_Version = "IVRCompositor_026"; + public const string IVRCompositor_Version = "IVRCompositor_027"; public const uint k_unVROverlayMaxKeyLength = 128; public const uint k_unVROverlayMaxNameLength = 128; public const uint k_unMaxOverlayCount = 128; public const uint k_unMaxOverlayIntersectionMaskPrimitivesCount = 32; - public const string IVROverlay_Version = "IVROverlay_024"; + public const string IVROverlay_Version = "IVROverlay_027"; public const string IVROverlayView_Version = "IVROverlayView_003"; public const uint k_unHeadsetViewMaxWidth = 3840; public const uint k_unHeadsetViewMaxHeight = 2160; @@ -7533,7 +7669,10 @@ public static uint GetInitToken() public const string k_pch_Controller_Component_GDC2015 = "gdc2015"; public const string k_pch_Controller_Component_Base = "base"; public const string k_pch_Controller_Component_Tip = "tip"; + public const string k_pch_Controller_Component_OpenXR_Aim = "openxr_aim"; public const string k_pch_Controller_Component_HandGrip = "handgrip"; + public const string k_pch_Controller_Component_OpenXR_Grip = "openxr_grip"; + public const string k_pch_Controller_Component_OpenXR_HandModel = "openxr_handmodel"; public const string k_pch_Controller_Component_Status = "status"; public const string IVRRenderModels_Version = "IVRRenderModels_006"; public const uint k_unNotificationTextMaxSize = 256; @@ -7559,6 +7698,7 @@ public static uint GetInitToken() public const string k_pch_SteamVR_PlayAreaColor_String = "playAreaColor"; public const string k_pch_SteamVR_TrackingLossColor_String = "trackingLossColor"; public const string k_pch_SteamVR_ShowStage_Bool = "showStage"; + public const string k_pch_SteamVR_DrawTrackingReferences_Bool = "drawTrackingReferences"; public const string k_pch_SteamVR_ActivateMultipleDrivers_Bool = "activateMultipleDrivers"; public const string k_pch_SteamVR_UsingSpeakers_Bool = "usingSpeakers"; public const string k_pch_SteamVR_SpeakersForwardYawOffsetDegrees_Float = "speakersForwardYawOffsetDegrees"; @@ -7569,6 +7709,10 @@ public static uint GetInitToken() public const string k_pch_SteamVR_MaxRecommendedResolution_Int32 = "maxRecommendedResolution"; public const string k_pch_SteamVR_MotionSmoothing_Bool = "motionSmoothing"; public const string k_pch_SteamVR_MotionSmoothingOverride_Int32 = "motionSmoothingOverride"; + public const string k_pch_SteamVR_FramesToThrottle_Int32 = "framesToThrottle"; + public const string k_pch_SteamVR_AdditionalFramesToPredict_Int32 = "additionalFramesToPredict"; + public const string k_pch_SteamVR_WorldScale_Float = "worldScale"; + public const string k_pch_SteamVR_FovScale_Int32 = "fovScale"; public const string k_pch_SteamVR_DisableAsyncReprojection_Bool = "disableAsync"; public const string k_pch_SteamVR_ForceFadeOnBadTracking_Bool = "forceFadeOnBadTracking"; public const string k_pch_SteamVR_DefaultMirrorView_Int32 = "mirrorView"; @@ -7595,7 +7739,6 @@ public static uint GetInitToken() public const string k_pch_SteamVR_ForceWindows32bitVRMonitor = "forceWindows32BitVRMonitor"; public const string k_pch_SteamVR_DebugInputBinding = "debugInputBinding"; public const string k_pch_SteamVR_DoNotFadeToGrid = "doNotFadeToGrid"; - public const string k_pch_SteamVR_RenderCameraMode = "renderCameraMode"; public const string k_pch_SteamVR_EnableSharedResourceJournaling = "enableSharedResourceJournaling"; public const string k_pch_SteamVR_EnableSafeMode = "enableSafeMode"; public const string k_pch_SteamVR_PreferredRefreshRate = "preferredRefreshRate"; @@ -7611,6 +7754,10 @@ public static uint GetInitToken() public const string k_pch_SteamVR_OverlayRenderQuality = "overlayRenderQuality_2"; public const string k_pch_SteamVR_BlockOculusSDKOnOpenVRLaunchOption_Bool = "blockOculusSDKOnOpenVRLaunchOption"; public const string k_pch_SteamVR_BlockOculusSDKOnAllLaunches_Bool = "blockOculusSDKOnAllLaunches"; + public const string k_pch_SteamVR_HDCPLegacyCompatibility_Bool = "hdcp14legacyCompatibility"; + public const string k_pch_SteamVR_DisplayPortTrainingMode_Int = "displayPortTrainingMode"; + public const string k_pch_SteamVR_UsePrism_Bool = "usePrism"; + public const string k_pch_SteamVR_AllowFallbackMirrorWindowLinux_Bool = "allowFallbackMirrorWindowLinux"; public const string k_pch_DirectMode_Section = "direct_mode"; public const string k_pch_DirectMode_Enable_Bool = "enable"; public const string k_pch_DirectMode_Count_Int32 = "count"; @@ -7662,6 +7809,7 @@ public static uint GetInitToken() public const string k_pch_Perf_SaveTimingsOnExit_Bool = "saveTimingsOnExit"; public const string k_pch_Perf_TestData_Float = "perfTestData"; public const string k_pch_Perf_GPUProfiling_Bool = "GPUProfiling"; + public const string k_pch_Perf_GpuBusMonitoring_Bool = "gpuBusMonitoring"; public const string k_pch_CollisionBounds_Section = "collisionBounds"; public const string k_pch_CollisionBounds_Style_Int32 = "CollisionBoundsStyle"; public const string k_pch_CollisionBounds_GroundPerimeterOn_Bool = "CollisionBoundsGroundPerimeterOn"; @@ -7703,6 +7851,7 @@ public static uint GetInitToken() public const string k_pch_audio_LastHmdPlaybackDeviceId_String = "lastHmdPlaybackDeviceId"; public const string k_pch_audio_VIVEHDMIGain = "viveHDMIGain"; public const string k_pch_audio_DualSpeakerAndJackOutput_Bool = "dualSpeakerAndJackOutput"; + public const string k_pch_audio_MuteMicMonitor_Bool = "muteMicMonitor"; public const string k_pch_Power_Section = "power"; public const string k_pch_Power_PowerOffOnExit_Bool = "powerOffOnExit"; public const string k_pch_Power_TurnOffScreensTimeout_Float = "turnOffScreensTimeout"; @@ -7716,6 +7865,12 @@ public static uint GetInitToken() public const string k_pch_Dashboard_Position = "position"; public const string k_pch_Dashboard_DesktopScale = "desktopScale"; public const string k_pch_Dashboard_DashboardScale = "dashboardScale"; + public const string k_pch_Dashboard_UseStandaloneSystemLayer = "standaloneSystemLayer"; + public const string k_pch_Dashboard_StickyDashboard = "stickyDashboard"; + public const string k_pch_Dashboard_AllowSteamOverlays_Bool = "allowSteamOverlays"; + public const string k_pch_Dashboard_AllowVRGamepadUI_Bool = "allowVRGamepadUI"; + public const string k_pch_Dashboard_AllowDesktopBPMWithVRGamepadUI_Bool = "allowDesktopBPMWithVRGamepadUI"; + public const string k_pch_Dashboard_SteamMatchesHMDFramerate = "steamMatchesHMDFramerate"; public const string k_pch_modelskin_Section = "modelskins"; public const string k_pch_Driver_Enable_Bool = "enable"; public const string k_pch_Driver_BlockedBySafemode_Bool = "blocked_by_safe_mode"; @@ -7728,6 +7883,7 @@ public static uint GetInitToken() public const string k_pch_App_BindingAutosaveURLSuffix_String = "AutosaveURL"; public const string k_pch_App_BindingLegacyAPISuffix_String = "_legacy"; public const string k_pch_App_BindingSteamVRInputAPISuffix_String = "_steamvrinput"; + public const string k_pch_App_BindingOpenXRAPISuffix_String = "_openxr"; public const string k_pch_App_BindingCurrentURLSuffix_String = "CurrentURL"; public const string k_pch_App_BindingPreviousURLSuffix_String = "PreviousURL"; public const string k_pch_App_NeedToUpdateAutosaveSuffix_Bool = "NeedToUpdateAutosave"; @@ -7738,6 +7894,7 @@ public static uint GetInitToken() public const string k_pch_LastKnown_Section = "LastKnown"; public const string k_pch_LastKnown_HMDManufacturer_String = "HMDManufacturer"; public const string k_pch_LastKnown_HMDModel_String = "HMDModel"; + public const string k_pch_LastKnown_ActualHMDDriver_String = "ActualHMDDriver"; public const string k_pch_DismissedWarnings_Section = "DismissedWarnings"; public const string k_pch_Input_Section = "input"; public const string k_pch_Input_LeftThumbstickRotation_Float = "leftThumbstickRotation"; @@ -7795,6 +7952,10 @@ public static uint GetInitToken() public const string k_pchPathUserElbowRight = "/user/elbow/right"; public const string k_pchPathUserKneeLeft = "/user/knee/left"; public const string k_pchPathUserKneeRight = "/user/knee/right"; + public const string k_pchPathUserWristLeft = "/user/wrist/left"; + public const string k_pchPathUserWristRight = "/user/wrist/right"; + public const string k_pchPathUserAnkleLeft = "/user/ankle/left"; + public const string k_pchPathUserAnkleRight = "/user/ankle/right"; public const string k_pchPathUserWaist = "/user/waist"; public const string k_pchPathUserChest = "/user/chest"; public const string k_pchPathUserCamera = "/user/camera"; @@ -7802,7 +7963,7 @@ public static uint GetInitToken() public const string k_pchPathClientAppKey = "/client_info/app_key"; public const ulong k_ulInvalidPathHandle = 0; public const string IVRPaths_Version = "IVRPaths_001"; - public const string IVRBlockQueue_Version = "IVRBlockQueue_004"; + public const string IVRBlockQueue_Version = "IVRBlockQueue_005"; static uint VRToken { get; set; } diff --git a/Assets/SteamVR/Scripts/SteamVR.cs b/Assets/SteamVR/Scripts/SteamVR.cs index f80dc407..16a90dc2 100644 --- a/Assets/SteamVR/Scripts/SteamVR.cs +++ b/Assets/SteamVR/Scripts/SteamVR.cs @@ -24,20 +24,39 @@ public class SteamVR : System.IDisposable // to activate it in the process. public static bool active { get { return _instance != null; } } + private static bool? isSupported = null; + // Set this to false to keep from auto-initializing when calling SteamVR.instance. private static bool _enabled = true; public static bool enabled { get { + if (_enabled) + { #if UNITY_2020_1_OR_NEWER || OPENVR_XR_API - if (XRSettings.supportedDevices.Length == 0) - enabled = false; + if (isSupported == null) + { + string[] supportedDevices = XRSettings.supportedDevices; + for (int index = 0; index < supportedDevices.Length; index++) + { + if (supportedDevices[index].Contains("OpenVR")) + { + isSupported = true; + } + } + if (isSupported == null) + { + isSupported = false; + } + } + return isSupported.Value; #else - if (!XRSettings.enabled) - enabled = false; + return XRSettings.enabled; #endif - return _enabled; + } + + return false; } set { diff --git a/Assets/SteamVR/Scripts/SteamVR_RingBuffer.cs b/Assets/SteamVR/Scripts/SteamVR_RingBuffer.cs index 9d6bae69..f76a2246 100644 --- a/Assets/SteamVR/Scripts/SteamVR_RingBuffer.cs +++ b/Assets/SteamVR/Scripts/SteamVR_RingBuffer.cs @@ -7,6 +7,8 @@ namespace Valve.VR { public class SteamVR_RingBuffer { + public static bool UseDateTimeForTicks = false; + protected T[] buffer; protected int currentIndex; protected T lastElement; @@ -95,7 +97,17 @@ public void Update(Vector3 position, Quaternion rotation, Vector3 velocity, Vect buffer[currentIndex].rotation = rotation; buffer[currentIndex].velocity = velocity; buffer[currentIndex].angularVelocity = angularVelocity; - buffer[currentIndex].timeInTicks = System.DateTime.Now.Ticks; + + if (UseDateTimeForTicks) + buffer[currentIndex].timeInTicks = System.DateTime.Now.Ticks; + else + { +#if UNITY_2020_2_OR_NEWER + buffer[currentIndex].timeInTicks = (long)(Time.realtimeSinceStartupAsDouble * 1000); +#else + buffer[currentIndex].timeInTicks = (long)(Time.realtimeSinceStartup * 1000); +#endif + } StepForward(); } diff --git a/Assets/SteamVR/SteamVR.asmdef b/Assets/SteamVR/SteamVR.asmdef index d95c0978..4d73eca3 100644 --- a/Assets/SteamVR/SteamVR.asmdef +++ b/Assets/SteamVR/SteamVR.asmdef @@ -1,5 +1,6 @@ { "name": "SteamVR", + "rootNamespace": "", "references": [ "SteamVR_Windows_EditorHelper", "Unity.XR.OpenVR", @@ -29,6 +30,11 @@ "name": "com.unity.render-pipelines.universal", "expression": "", "define": "UNITY_URP" + }, + { + "name": "com.unity.ugui", + "expression": "", + "define": "UNITY_UGUI_UI" } ], "noEngineReferences": false diff --git a/Assets/SteamVR/readme.txt b/Assets/SteamVR/readme.txt index cdfc4ff7..a082ecaa 100644 --- a/Assets/SteamVR/readme.txt +++ b/Assets/SteamVR/readme.txt @@ -1,4 +1,4 @@ -# SteamVR Unity Plugin - v2.7.3 (sdk 1.14.15) +# SteamVR Unity Plugin - v2.8.0 (sdk 2.0.10) Copyright (c) Valve Corporation, All rights reserved. @@ -35,6 +35,51 @@ Input and Steam: If you publish your game to steam you can let users change their input bindings while the game is not running by setting the location of your action manifest. On the steamworks partner site go to the Application settings, and the Virtual Reality Section. At the bottom you'll see a radio button to designate your title as a SteamVR Input application. You then can set the location of your action manifest. In older versions of the plugin this was next to the executable. In versions 2.3.3 and above this is in [GameName]_Data/StreamingAssets/SteamVR/actions.json. + +Changes for 2.8.0 + + * Updating OpenVR sdk to 2.0.10 + + * Added knee, elbow, ankle, and wrist input sources. + + * Updated urls to sidestep log spam in Unity 2022 + + * Fixed compiler errors in some plugin update scenarios. + + * Fixed the interaction system not being able to create interactables at runtime + + * Fixed reimports erasing openvr settings on some machines + + * Fixed the interaction system not respecting the hand clearance mask + + * Fixed the interaction system teleport example not working while using the 2d fallback + + * Fixed RemoveAllListeners not removing all listeners + + * Various performance and garbage collection fixes + + * Fix for multipass breaking under scriptable render pipelines. + + * Fix for unnecessary preinit that was breaking some startup scenarios + + * Fix for incorrect reporting of eye position + + * Fix for broken depth textures in some situations + + * Fixed some scenarios where OpenGL wouldn't work. + + * Fix for projects that use binary serialization. (Settings file gets output on build now) + + * Better support for unicode app names and keys + + * Fix for some projects in linux not loading manifests properly. + + * Fixed a localization issue preventing some projects with unicode characters in the path from working. + + * Fixed the interaction system not handling the bow and arrow correctly under newer physics simulations + + * Fixed the interaction system not dismissing hand grab hints properly. + Changes for 2.7.3 * Legacy VR Mode fix. #908 #901 diff --git a/Library/ScriptAssemblies/BuiltinAssemblies.stamp b/Library/ScriptAssemblies/BuiltinAssemblies.stamp new file mode 100644 index 00000000..23df646c --- /dev/null +++ b/Library/ScriptAssemblies/BuiltinAssemblies.stamp @@ -0,0 +1,2 @@ +0000.5c7401e8.0000 +0000.5c740200.0000 \ No newline at end of file