Skip to content

Commit

Permalink
Version 1.2.3
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronleiby committed Jan 10, 2018
1 parent 5530ef2 commit fad02ab
Show file tree
Hide file tree
Showing 11 changed files with 321 additions and 100 deletions.
2 changes: 1 addition & 1 deletion Assets/SteamVR/Editor/SteamVR_Update.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[InitializeOnLoad]
public class SteamVR_Update : EditorWindow
{
const string currentVersion = "1.2.2";
const string currentVersion = "1.2.3";
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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,19 @@ private ItemPackage GetAttachedItemPackage( Hand hand )
//-------------------------------------------------
private void HandHoverUpdate( Hand hand )
{
if ( takeBackItem && requireTriggerPressToReturn )
{
if ( hand.controller != null && hand.controller.GetHairTriggerDown() )
{
ItemPackage currentAttachedItemPackage = GetAttachedItemPackage( hand );
if ( currentAttachedItemPackage == itemPackage )
{
TakeBackItem( hand );
return; // So that we don't pick up an ItemPackage the same frame that we return it
}
}
}

if ( requireTriggerPressToTake )
{
if ( hand.controller != null && hand.controller.GetHairTriggerDown() )
Expand Down
305 changes: 256 additions & 49 deletions Assets/SteamVR/Plugins/openvr_api.cs

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions Assets/SteamVR/Scripts/SteamVR_Camera.cs
Original file line number Diff line number Diff line change
Expand Up @@ -197,14 +197,14 @@ public void Expand()

while (transform.childCount > 0)
transform.GetChild(0).parent = head;

#if !UNITY_2017_2_OR_NEWER
var guiLayer = GetComponent<GUILayer>();
if (guiLayer != null)
{
DestroyImmediate(guiLayer);
head.gameObject.AddComponent<GUILayer>();
}

#endif
var audioListener = GetComponent<AudioListener>();
if (audioListener != null)
{
Expand All @@ -228,14 +228,14 @@ public void Collapse()
// Move children and components from head back to camera.
while (head.childCount > 0)
head.GetChild(0).parent = transform;

#if !UNITY_2017_2_OR_NEWER
var guiLayer = head.GetComponent<GUILayer>();
if (guiLayer != null)
{
DestroyImmediate(guiLayer);
gameObject.AddComponent<GUILayer>();
}

#endif
if (ears != null)
{
while (ears.childCount > 0)
Expand Down
2 changes: 2 additions & 0 deletions Assets/SteamVR/Scripts/SteamVR_LoadLevel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -403,6 +403,8 @@ IEnumerator LoadLevel()
// Fade out to compositor
SteamVR_Events.LoadingFadeIn.Send(fadeInTime);

// Refresh compositor reference since loading scenes might have invalidated it.
compositor = OpenVR.Compositor;
if (compositor != null)
{
// Fade out foreground color if necessary.
Expand Down
4 changes: 4 additions & 0 deletions Assets/SteamVR/Scripts/SteamVR_Render.cs
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,10 @@ public void UpdatePoses()
#else
void OnCameraPreCull(Camera cam)
{
#if !( UNITY_5_4 )
if (cam.cameraType != CameraType.VR)
return;
#endif
// Only update poses on the first camera per frame.
if (Time.frameCount != lastFrameCount)
{
Expand Down
6 changes: 3 additions & 3 deletions Assets/SteamVR/Scripts/SteamVR_RenderModel.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//======= Copyright (c) Valve Corporation, All rights reserved. ===============
//
// Purpose: Render model of associated tracked object
//
Expand Down Expand Up @@ -255,7 +255,7 @@ IEnumerator SetModelAsync(string renderModelName)

if (loading)
{
yield return new WaitForSeconds(0.1f);
yield return new WaitForSecondsRealtime(0.1f);
}
else
{
Expand Down Expand Up @@ -391,7 +391,7 @@ RenderModel LoadRenderModel(CVRRenderModels renderModels, string renderModelName
if (error == EVRRenderModelError.None)
{
var diffuseTexture = MarshalRenderModel_TextureMap(pDiffuseTexture);
var texture = new Texture2D(diffuseTexture.unWidth, diffuseTexture.unHeight, TextureFormat.ARGB32, false);
var texture = new Texture2D(diffuseTexture.unWidth, diffuseTexture.unHeight, TextureFormat.RGBA32, false);
if (SystemInfo.graphicsDeviceType == UnityEngine.Rendering.GraphicsDeviceType.Direct3D11)
{
texture.Apply();
Expand Down
17 changes: 17 additions & 0 deletions Assets/SteamVR/Scripts/SteamVR_Stats.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,21 @@
//=============================================================================

using UnityEngine;

#if UNITY_2017_2_OR_NEWER

[ExecuteInEditMode]
public class SteamVR_Stats : MonoBehaviour
{
void Awake()
{
Debug.Log("SteamVR_Stats is deprecated in Unity 2017.2 - REMOVING");
DestroyImmediate(this);
}
}

#else

using Valve.VR;

public class SteamVR_Stats : MonoBehaviour
Expand Down Expand Up @@ -66,3 +81,5 @@ void Update()
}
}

#endif

Binary file modified Assets/SteamVR/quickstart.pdf
Binary file not shown.
25 changes: 19 additions & 6 deletions Assets/SteamVR/readme.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,29 @@
SteamVR plugin for Unity - v1.2.2
SteamVR plugin for Unity - v1.2.3
Copyright (c) Valve Corporation, All rights reserved.


Quickstart:
Requirements:

To use, simply add the SteamVR_Camera script to your Camera object(s). Everything else gets set up at
runtime. See the included quickstart guide for more details.
The SteamVR runtime must be installed. This can be found in Steam under Tools.


Requirements:
Changes for v1.2.3:

The SteamVR runtime must be installed. This can be found in Steam under Tools.
* Updated to SteamVR runtime v1515522829 and SDK version 1.0.12.

* Updated quickstart guide.

* [General] Fixed deprecation warnings for GUILayer in Unity version 2017.2 and newer (removed associated functionality).

* [LoadLevel] Fixed a crash when using SteamVR_LoadLevel to load a scene which has no cameras in it.

* [RenderModels] Switched from using TextureFormat.ARGB32 to RGBA32 to fix pink texture issue on Vulkan.

* [RenderModels] Fix for not initializing propery if game is paused on startup.
https://github.com/ValveSoftware/steamvr_unity_plugin/issues/62

* [InteractionSystem] Added implemention for ItemPackageSpawner requireTriggerPressToReturn.
https://github.com/ValveSoftware/steamvr_unity_plugin/pull/17/files


Changes for v1.2.2:
Expand Down
39 changes: 2 additions & 37 deletions ProjectSettings/ProjectSettings.asset
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ PlayerSettings:
singlePassStereoRendering: 0
protectGraphicsMemory: 0
AndroidBundleVersionCode: 1
AndroidMinSdkVersion: 9
AndroidMinSdkVersion: 16
AndroidPreferredInstallLocation: 1
aotOptions:
apiCompatibilityLevel: 2
Expand All @@ -119,7 +119,7 @@ PlayerSettings:
serializedVersion: 2
m_Bits: 238
iPhoneSdkVersion: 988
iPhoneTargetOSVersion: 22
iPhoneTargetOSVersion: 24
tvOSSdkVersion: 0
tvOSTargetOSVersion: 900
uIPrerenderedIcon: 0
Expand Down Expand Up @@ -411,28 +411,8 @@ PlayerSettings:
XboxOneAllowedProductIds: []
XboxOnePersistentLocalStorageSize: 0
intPropertyNames:
- Android::ScriptingBackend
- Metro::ScriptingBackend
- Standalone::ScriptingBackend
- WP8::ScriptingBackend
- WebGL::ScriptingBackend
- WebGL::audioCompressionFormat
- WebGL::exceptionSupport
- WebGL::memorySize
- iOS::Architecture
- iOS::EnableIncrementalBuildSupportForIl2cpp
- iOS::ScriptingBackend
Android::ScriptingBackend: 0
Metro::ScriptingBackend: 2
Standalone::ScriptingBackend: 0
WP8::ScriptingBackend: 2
WebGL::ScriptingBackend: 1
WebGL::audioCompressionFormat: 4
WebGL::exceptionSupport: 0
WebGL::memorySize: 256
iOS::Architecture: 2
iOS::EnableIncrementalBuildSupportForIl2cpp: 0
iOS::ScriptingBackend: 0
boolPropertyNames:
- Android::VR::enable
- Metro::VR::enable
Expand All @@ -445,14 +425,10 @@ PlayerSettings:
- Standalone::VR::enable
- Tizen::VR::enable
- WebGL::VR::enable
- WebGL::analyzeBuildSize
- WebGL::dataCaching
- WebGL::useEmbeddedResources
- WebPlayer::VR::enable
- WiiU::VR::enable
- Xbox360::VR::enable
- XboxOne::VR::enable
- XboxOne::enus
- iOS::VR::enable
- tvOS::VR::enable
Android::VR::enable: 0
Expand All @@ -466,14 +442,10 @@ PlayerSettings:
Standalone::VR::enable: 1
Tizen::VR::enable: 0
WebGL::VR::enable: 0
WebGL::analyzeBuildSize: 0
WebGL::dataCaching: 0
WebGL::useEmbeddedResources: 0
WebPlayer::VR::enable: 0
WiiU::VR::enable: 0
Xbox360::VR::enable: 0
XboxOne::VR::enable: 0
XboxOne::enus: 1
iOS::VR::enable: 0
tvOS::VR::enable: 0
stringPropertyNames:
Expand All @@ -486,9 +458,6 @@ PlayerSettings:
- Purchasing_ServiceEnabled::Purchasing_ServiceEnabled
- UNet_ServiceEnabled::UNet_ServiceEnabled
- Unity_Ads_ServiceEnabled::Unity_Ads_ServiceEnabled
- WebGL::emscriptenArgs
- WebGL::template
- additionalIl2CppArgs::additionalIl2CppArgs
Analytics_ServiceEnabled::Analytics_ServiceEnabled: False
Build_ServiceEnabled::Build_ServiceEnabled: False
Collab_ServiceEnabled::Collab_ServiceEnabled: False
Expand All @@ -498,9 +467,6 @@ PlayerSettings:
Purchasing_ServiceEnabled::Purchasing_ServiceEnabled: False
UNet_ServiceEnabled::UNet_ServiceEnabled: False
Unity_Ads_ServiceEnabled::Unity_Ads_ServiceEnabled: False
WebGL::emscriptenArgs:
WebGL::template: APPLICATION:Default
additionalIl2CppArgs::additionalIl2CppArgs:
vectorPropertyNames:
- Android::VR::enabledDevices
- Metro::VR::enabledDevices
Expand Down Expand Up @@ -530,7 +496,6 @@ PlayerSettings:
PSP2::VR::enabledDevices: []
SamsungTV::VR::enabledDevices: []
Standalone::VR::enabledDevices:
- Oculus
- OpenVR
Tizen::VR::enabledDevices: []
WebGL::VR::enabledDevices: []
Expand Down

1 comment on commit fad02ab

@muqiubai
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When using the latest version of SteamVR in Unity, in the program run the test, will appear to click on the entity's handle when the model in the scene without any corresponding response, need to restart the computer, run unity again when the problem will disappear, but the following will be the problem, how to solve this problem? Thanks in advance!

Please sign in to comment.