From 7425dbca5fa1509af8f7e9e1085ba2534932e6e0 Mon Sep 17 00:00:00 2001 From: Nicholas Ewalt Date: Sat, 23 Jul 2016 04:53:27 -0700 Subject: [PATCH] Fixes for ED Other games too probably. Hopefully this doesn't break anything. --- .../HOTK_TwitchDemoScene.unity | Bin 319220 -> 319220 bytes Assets/HOTK/Twitch/TwitchChatTester.cs | 17 +++++++++++++++++ Assets/SteamVR/Scripts/SteamVR_Render.cs | 3 ++- 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Assets/HOTK/Example Content/HOTK_TwitchDemoScene.unity b/Assets/HOTK/Example Content/HOTK_TwitchDemoScene.unity index 67e2daab5c4adda0990164d1eaaad83ed85afaef..a9268f3a8d0fd2cd9e24caa0efcd7630a2e52595 100644 GIT binary patch delta 12027 zcma)?dsvj!_Q&`8Ld8L&NlhmT8qLc{UNAN1ycXg$M8i?j5DmxjGLhowNt;k{)U1gV z$1E37;dHT3i?CEiN)DwJnbBxokP4^Fnn-C(OC%5e*4ne}jPE{w{CJ-CS|PuO>K->B>GCG(@U3~eMQU1-)MNJ&RdFbT5IYKC4i zC%Jz+&at4T=kybruNRaN$J!hA6UW&{=FI5(8RvLWTd&LKA)#6NLgEL@ju2Ee3TkP*47USiBr=Lwi3s2r<{Aq(#702gj!c@od0kR zPmygBnsETM5+`*4#E(Tz-2k~yeABA_!OI+o{fYks_!I7f-9l>~2)P)qng&4uanc4c zwjKQ<`=ny|q*#25F$-hmXaf8Rb9_Q8w?G4NEQ6tibMBVg=L6yEKrIs)mw3Hy!2cNg zP-r!GL&kl`DH;MfXf;!+oclc?OB;&up=Q8DTR8^@D*mMit!5}x5hpYh>d_`Rhsm6} zw6<+2#sDial=iX5#Y@u&=#zn=X(J#Vtri%;*c<2;;7_>Pj~)4ehq_0~DJ&9N(I_Y( zPW33LBu>n|jJ<-4$fmuOjl3S;Vx_39LEDKx;W840W=Vs%amaC}K@wW68pqc2=oihO zu4#Qb9YV&j)htTX+s3neJ zJTwv~Fdl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U3?n%&{Xx*epHPMu4LYB!oGW^Q~m*%SAi={A9ZRP1f7&d?I1{e3cF*sVp*`A z-ru&GM-Q7pp#_6^$@VJEI~ejYUbhZ`QsM-M@JsCHF^@=2)=-_@41Q6Xa~L!er(_s( zpiLH+aL%ajUY8s{y#5q+d1wva2wsKln|1m+DD0{HDymbOFBNKt z6TrV6CQj{0-t7kE8%C`*?n>Hqeg|4q#^a0xc*RH>ykGak{NRM8qCD&zNso$m}=mopJ zRZF1;GQhS|>r>|$rSs$tvr$-|z#S(}qbd!9tbb9m9SO^h{SPQSFUSA@ diff --git a/Assets/HOTK/Twitch/TwitchChatTester.cs b/Assets/HOTK/Twitch/TwitchChatTester.cs index d8726ef..41ebd77 100644 --- a/Assets/HOTK/Twitch/TwitchChatTester.cs +++ b/Assets/HOTK/Twitch/TwitchChatTester.cs @@ -5,6 +5,7 @@ using System.Diagnostics; using System.Linq; using UnityEngine.UI; +using Valve.VR; using Debug = UnityEngine.Debug; [RequireComponent(typeof(TwitchIRC), typeof(TextMesh))] @@ -77,6 +78,7 @@ public void Awake() public void Start() { ClearViewerCountAndChannelName("Disconnected"); + StartCoroutine("SyncWithSteamVR"); } public void ToggleConnect() @@ -111,9 +113,11 @@ public void ToggleConnect() knownFollowers.Clear(); StopCoroutine("UpdateViews"); StopCoroutine("UpdateFollowers"); + StopCoroutine("SyncWithSteamVR"); gettingInitialFollowers = true; StartCoroutine("UpdateViews"); StartCoroutine("UpdateFollowers"); + StartCoroutine("SyncWithSteamVR"); } else AddSystemNotice("Unable to Connect: Enter a Valid Channel Name!", TwitchIRC.NoticeColor.Red); } @@ -139,6 +143,19 @@ public void ToggleConnect() } } + IEnumerator SyncWithSteamVR() + { + while (Application.isPlaying) + { + var compositor = OpenVR.Compositor; + if (compositor != null) + { + var trackingSpace = compositor.GetTrackingSpace(); + SteamVR_Render.instance.trackingSpace = trackingSpace; + } + yield return new WaitForSeconds(10f); + } + } private Dictionary knownFollowers = new Dictionary(); private bool gettingInitialFollowers; diff --git a/Assets/SteamVR/Scripts/SteamVR_Render.cs b/Assets/SteamVR/Scripts/SteamVR_Render.cs index 6230de7..c24cc47 100644 --- a/Assets/SteamVR/Scripts/SteamVR_Render.cs +++ b/Assets/SteamVR/Scripts/SteamVR_Render.cs @@ -165,7 +165,8 @@ private IEnumerator RenderLoop() if (!compositor.CanRenderScene()) continue; - compositor.SetTrackingSpace(trackingSpace); + trackingSpace = compositor.GetTrackingSpace(); + compositor.SetTrackingSpace(trackingSpace); #if (UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0) if (cameras.Length == 0) continue;