├── .gitignore ├── Assets ├── Focal Point VR.meta ├── Focal Point VR │ ├── Demo 1 - Throwing a Ball.meta │ ├── Demo 1 - Throwing a Ball │ │ ├── Demo 1 - Throwing a Ball.unity │ │ ├── Demo 1 - Throwing a Ball.unity.meta │ │ ├── Demo1RestartWhenDropped.cs │ │ ├── Demo1RestartWhenDropped.cs.meta │ │ ├── Red.mat │ │ ├── Red.mat.meta │ │ ├── tile.png │ │ ├── tile.png.meta │ │ ├── wall.prefab │ │ └── wall.prefab.meta │ ├── Demo 2 - Pill Fountain.meta │ ├── Demo 2 - Pill Fountain │ │ ├── Demo 2 - Pill Fountain.unity │ │ ├── Demo 2 - Pill Fountain.unity.meta │ │ ├── Demo Capsule.prefab │ │ ├── Demo Capsule.prefab.meta │ │ ├── FocalPointVR_SteamVRAdapterDemo2.cs │ │ ├── FocalPointVR_SteamVRAdapterDemo2.cs.meta │ │ ├── FocalPointVR_SteamVRControllerAdapterDemo2.cs │ │ ├── FocalPointVR_SteamVRControllerAdapterDemo2.cs.meta │ │ ├── GenerateCapsules.cs │ │ ├── GenerateCapsules.cs.meta │ │ ├── RelativeMass.cs │ │ ├── RelativeMass.cs.meta │ │ ├── TimeToLive.cs │ │ └── TimeToLive.cs.meta │ ├── Demo 3 - Moving in a Room.meta │ ├── Demo 3 - Moving in a Room │ │ ├── Demo 3 - Moving in a Room.unity │ │ ├── Demo 3 - Moving in a Room.unity.meta │ │ ├── FocalPointVR_InteractionManagerDemo3and4.cs │ │ ├── FocalPointVR_InteractionManagerDemo3and4.cs.meta │ │ ├── FocalPointVR_SteamVRAdapterDemo3and4.cs │ │ ├── FocalPointVR_SteamVRAdapterDemo3and4.cs.meta │ │ ├── FocalPointVR_SteamVRControllerAdapterDemo3and4.cs │ │ ├── FocalPointVR_SteamVRControllerAdapterDemo3and4.cs.meta │ │ ├── Materials.meta │ │ └── Materials │ │ │ ├── bluish.mat │ │ │ ├── bluish.mat.meta │ │ │ ├── default_features.mat │ │ │ ├── default_features.mat.meta │ │ │ ├── greenish.mat │ │ │ ├── greenish.mat.meta │ │ │ ├── reddish.mat │ │ │ ├── reddish.mat.meta │ │ │ ├── tile.mat │ │ │ ├── tile.mat.meta │ │ │ ├── tile.png │ │ │ └── tile.png.meta │ ├── Demo 4 - Moving in a World.meta │ ├── Demo 4 - Moving in a World │ │ ├── Demo 4 - Moving in a World.unity │ │ ├── Demo 4 - Moving in a World.unity.meta │ │ ├── tile.mat │ │ ├── tile.mat.meta │ │ ├── tile.png │ │ └── tile.png.meta │ ├── Prefabs.meta │ ├── Prefabs │ │ ├── Hands.prefab │ │ ├── Hands.prefab.meta │ │ ├── Path Sprite.prefab │ │ ├── Path Sprite.prefab.meta │ │ ├── Standard SteamVR Adapter.prefab │ │ └── Standard SteamVR Adapter.prefab.meta │ ├── README.pdf │ ├── README.pdf.meta │ ├── Resources.meta │ ├── Resources │ │ ├── Materials.meta │ │ ├── Materials │ │ │ ├── tile.mat │ │ │ └── tile.mat.meta │ │ ├── Tiled.mat │ │ ├── Tiled.mat.meta │ │ ├── hand-closed.gif │ │ ├── hand-closed.gif.meta │ │ ├── hand-opened.gif │ │ ├── hand-opened.gif.meta │ │ ├── hand-pointer.gif │ │ ├── hand-pointer.gif.meta │ │ ├── laser-blue.png │ │ ├── laser-blue.png.meta │ │ ├── laser-faint.png │ │ ├── laser-faint.png.meta │ │ ├── laser-red.png │ │ ├── laser-red.png.meta │ │ ├── telescope.png │ │ └── telescope.png.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── FocalPointVR_InteractionManager.cs │ │ ├── FocalPointVR_InteractionManager.cs.meta │ │ ├── FocalPointVR_ManipulationHandler.cs │ │ ├── FocalPointVR_ManipulationHandler.cs.meta │ │ ├── FocalPointVR_PointGenerator.cs │ │ ├── FocalPointVR_PointGenerator.cs.meta │ │ ├── FocalPointVR_SteamVRAdapter.cs │ │ ├── FocalPointVR_SteamVRAdapter.cs.meta │ │ ├── FocalPointVR_SteamVRControllerAdapter.cs │ │ └── FocalPointVR_SteamVRControllerAdapter.cs.meta ├── Plugins.meta ├── Plugins │ ├── openvr_api.bundle.meta │ ├── openvr_api.bundle │ │ ├── Contents.meta │ │ └── Contents │ │ │ ├── Info.plist │ │ │ ├── Info.plist.meta │ │ │ ├── MacOS.meta │ │ │ └── MacOS │ │ │ ├── openvr_api │ │ │ └── openvr_api.meta │ ├── openvr_api.cs │ ├── openvr_api.cs.meta │ ├── x86.meta │ ├── x86 │ │ ├── openvr_api.dll │ │ └── openvr_api.dll.meta │ ├── x86_64.meta │ └── x86_64 │ │ ├── openvr_api.dll │ │ └── openvr_api.dll.meta ├── SteamVR.meta └── SteamVR │ ├── Editor.meta │ ├── Editor │ ├── SteamVR_Editor.cs │ ├── SteamVR_Editor.cs.meta │ ├── SteamVR_RenderModelEditor.cs │ ├── SteamVR_RenderModelEditor.cs.meta │ ├── SteamVR_Settings.cs │ ├── SteamVR_Settings.cs.meta │ ├── SteamVR_SkyboxEditor.cs │ ├── SteamVR_SkyboxEditor.cs.meta │ ├── SteamVR_Update.cs │ └── SteamVR_Update.cs.meta │ ├── Extras.meta │ ├── Extras │ ├── SteamVR_GazeTracker.cs │ ├── SteamVR_GazeTracker.cs.meta │ ├── SteamVR_LaserPointer.cs │ ├── SteamVR_LaserPointer.cs.meta │ ├── SteamVR_Teleporter.cs │ ├── SteamVR_Teleporter.cs.meta │ ├── SteamVR_TestIK.unity │ ├── SteamVR_TestIK.unity.meta │ ├── SteamVR_TestThrow.cs │ ├── SteamVR_TestThrow.cs.meta │ ├── SteamVR_TestThrow.unity │ ├── SteamVR_TestThrow.unity.meta │ ├── SteamVR_TrackedController.cs │ └── SteamVR_TrackedController.cs.meta │ ├── Materials.meta │ ├── Materials │ ├── portalworkshop.mat │ └── portalworkshop.mat.meta │ ├── Prefabs.meta │ ├── Prefabs │ ├── [CameraRig].prefab │ ├── [CameraRig].prefab.meta │ ├── [Status].prefab │ ├── [Status].prefab.meta │ ├── [SteamVR].prefab │ └── [SteamVR].prefab.meta │ ├── Resources.meta │ ├── Resources │ ├── SteamVR_AlphaOut.shader │ ├── SteamVR_AlphaOut.shader.meta │ ├── SteamVR_Blit.shader │ ├── SteamVR_Blit.shader.meta │ ├── SteamVR_BlitFlip.shader │ ├── SteamVR_BlitFlip.shader.meta │ ├── SteamVR_ClearAll.shader │ ├── SteamVR_ClearAll.shader.meta │ ├── SteamVR_ColorOut.shader │ ├── SteamVR_ColorOut.shader.meta │ ├── SteamVR_ExternalCamera.prefab │ ├── SteamVR_ExternalCamera.prefab.meta │ ├── SteamVR_Fade.shader │ ├── SteamVR_Fade.shader.meta │ ├── SteamVR_HiddenArea.shader │ ├── SteamVR_HiddenArea.shader.meta │ ├── SteamVR_Overlay.shader │ └── SteamVR_Overlay.shader.meta │ ├── Scenes.meta │ ├── Scenes │ ├── example.unity │ └── example.unity.meta │ ├── Scripts.meta │ ├── Scripts │ ├── SteamVR.cs │ ├── SteamVR.cs.meta │ ├── SteamVR_Camera.cs │ ├── SteamVR_Camera.cs.meta │ ├── SteamVR_CameraFlip.cs │ ├── SteamVR_CameraFlip.cs.meta │ ├── SteamVR_CameraMask.cs │ ├── SteamVR_CameraMask.cs.meta │ ├── SteamVR_Controller.cs │ ├── SteamVR_Controller.cs.meta │ ├── SteamVR_ControllerManager.cs │ ├── SteamVR_ControllerManager.cs.meta │ ├── SteamVR_Ears.cs │ ├── SteamVR_Ears.cs.meta │ ├── SteamVR_ExternalCamera.cs │ ├── SteamVR_ExternalCamera.cs.meta │ ├── SteamVR_Fade.cs │ ├── SteamVR_Fade.cs.meta │ ├── SteamVR_Frustum.cs │ ├── SteamVR_Frustum.cs.meta │ ├── SteamVR_GameView.cs │ ├── SteamVR_GameView.cs.meta │ ├── SteamVR_IK.cs │ ├── SteamVR_IK.cs.meta │ ├── SteamVR_LoadLevel.cs │ ├── SteamVR_LoadLevel.cs.meta │ ├── SteamVR_Menu.cs │ ├── SteamVR_Menu.cs.meta │ ├── SteamVR_Overlay.cs │ ├── SteamVR_Overlay.cs.meta │ ├── SteamVR_PlayArea.cs │ ├── SteamVR_PlayArea.cs.meta │ ├── SteamVR_Render.cs │ ├── SteamVR_Render.cs.meta │ ├── SteamVR_RenderModel.cs │ ├── SteamVR_RenderModel.cs.meta │ ├── SteamVR_Skybox.cs │ ├── SteamVR_Skybox.cs.meta │ ├── SteamVR_Stats.cs │ ├── SteamVR_Stats.cs.meta │ ├── SteamVR_Status.cs │ ├── SteamVR_Status.cs.meta │ ├── SteamVR_StatusText.cs │ ├── SteamVR_StatusText.cs.meta │ ├── SteamVR_TestController.cs │ ├── SteamVR_TestController.cs.meta │ ├── SteamVR_TrackedObject.cs │ ├── SteamVR_TrackedObject.cs.meta │ ├── SteamVR_UpdatePoses.cs │ ├── SteamVR_UpdatePoses.cs.meta │ ├── SteamVR_Utils.cs │ └── SteamVR_Utils.cs.meta │ ├── Textures.meta │ ├── Textures │ ├── arrow.png │ ├── arrow.png.meta │ ├── background.png │ ├── background.png.meta │ ├── logo.png │ ├── logo.png.meta │ ├── overlay.renderTexture │ ├── overlay.renderTexture.meta │ ├── portalworkshop.png │ └── portalworkshop.png.meta │ ├── quickstart.pdf │ ├── quickstart.pdf.meta │ ├── readme.txt │ └── readme.txt.meta ├── LICENSE ├── Notes ├── General.md ├── Technical Architecture.txt └── User Stories.txt ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── Physics2DSettings.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityAdsSettings.asset └── UnityConnectSettings.asset └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # =============== # 2 | # Unity generated # 3 | # =============== # 4 | [Tt]emp/ 5 | [Oo]bj/ 6 | [Bb]uild 7 | [Ll]ibrary/ 8 | sysinfo.txt 9 | *.stackdump 10 | 11 | # ===================================== # 12 | # Visual Studio / MonoDevelop generated # 13 | # ===================================== # 14 | [Ee]xported[Oo]bj/ 15 | .vs/ 16 | /*.userprefs 17 | /*.csproj 18 | /*.pidb 19 | /*.suo 20 | /*.sln* 21 | /*.user 22 | /*.unityproj 23 | /*.booproj 24 | 25 | # ============ # 26 | # OS generated # 27 | # ============ # 28 | .DS_Store* 29 | ._* 30 | .Spotlight-V100 31 | .Trashes 32 | Icon? 33 | ehthumbs.db 34 | [Tt]humbs.db 35 | -------------------------------------------------------------------------------- /Assets/Focal Point VR.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e79f6bed4483272479d3965f28c98ace 3 | folderAsset: yes 4 | timeCreated: 1459188422 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 1 - Throwing a Ball.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b9fb675c4566f3649b89169f9626a74e 3 | folderAsset: yes 4 | timeCreated: 1459181995 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 1 - Throwing a Ball/Demo 1 - Throwing a Ball.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Demo 1 - Throwing a Ball/Demo 1 - Throwing a Ball.unity -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 1 - Throwing a Ball/Demo 1 - Throwing a Ball.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce07b2d62a911a74d86903c3d7d98efc 3 | timeCreated: 1459180605 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 1 - Throwing a Ball/Demo1RestartWhenDropped.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class Demo1RestartWhenDropped : MonoBehaviour { 5 | public GameObject wallPrefab; 6 | private GameObject toDestroy; 7 | private Vector3 initialWallLocation; 8 | private Vector3 initialLocation; 9 | private Rigidbody rbody; 10 | 11 | void Start () { 12 | toDestroy = GameObject.Find("wall"); 13 | initialWallLocation = toDestroy.transform.position; 14 | initialLocation = transform.position; 15 | rbody = GetComponent(); 16 | } 17 | 18 | void Update () { 19 | if (transform.position.y < -50.0f) { 20 | transform.position = initialLocation; 21 | rbody.velocity = Vector3.zero; 22 | rbody.freezeRotation = true; 23 | if (Mathf.Abs(transform.localScale.x) > 5.0f) { 24 | transform.localScale = new Vector3 (5, 5, 5); 25 | } 26 | Destroy (toDestroy.gameObject); 27 | toDestroy = Instantiate (wallPrefab, initialWallLocation, Quaternion.identity) as GameObject; 28 | } else { 29 | rbody.freezeRotation = false; 30 | } 31 | } 32 | } 33 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 1 - Throwing a Ball/Demo1RestartWhenDropped.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 77d7324da2c7c8a409efde8bf0b449f0 3 | timeCreated: 1459188760 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 1 - Throwing a Ball/Red.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Demo 1 - Throwing a Ball/Red.mat -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 1 - Throwing a Ball/Red.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e50212a0cde454a868a97930ad166bc8 3 | timeCreated: 1458869269 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 1 - Throwing a Ball/tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Demo 1 - Throwing a Ball/tile.png -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 1 - Throwing a Ball/tile.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e29a6675fd4f4f4a84bffa72aed364e 3 | timeCreated: 1459271868 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 0 49 | textureType: -1 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 1 - Throwing a Ball/wall.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Demo 1 - Throwing a Ball/wall.prefab -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 1 - Throwing a Ball/wall.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bdb037da643df7f4680b49dbcfc03b04 3 | timeCreated: 1459188981 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 2 - Pill Fountain.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5ad5be072ed9414e9dc0d844e2c2928 3 | folderAsset: yes 4 | timeCreated: 1459188449 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 2 - Pill Fountain/Demo 2 - Pill Fountain.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Demo 2 - Pill Fountain/Demo 2 - Pill Fountain.unity -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 2 - Pill Fountain/Demo 2 - Pill Fountain.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a751d3840fd294145b63ec586e5244a4 3 | timeCreated: 1459189151 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 2 - Pill Fountain/Demo Capsule.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Demo 2 - Pill Fountain/Demo Capsule.prefab -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 2 - Pill Fountain/Demo Capsule.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4df5eb7b710494898b41c4006364be66 3 | timeCreated: 1458869699 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 2 - Pill Fountain/FocalPointVR_SteamVRAdapterDemo2.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class FocalPointVR_SteamVRAdapterDemo2 : MonoBehaviour { 5 | public bool enablePinnedMode; 6 | public GameObject handPrefab; 7 | private GameObject[] controllers = new GameObject[2]; 8 | private FocalPointVR_InteractionManager ixdManager; 9 | public GameObject pathSpritePrefab; 10 | 11 | void Start() { 12 | controllers[0] = transform.parent.FindChild("Controller (left)").gameObject; 13 | controllers[1] = transform.parent.FindChild("Controller (right)").gameObject; 14 | ixdManager = GetComponent(); 15 | foreach (GameObject controller in controllers) { 16 | FocalPointVR_SteamVRControllerAdapterDemo2 adapter = controller.AddComponent(); 17 | adapter.ixdManager = ixdManager; 18 | GameObject newHand = Instantiate(handPrefab, new Vector3(0, 0, 0), Quaternion.Euler(new Vector3(0, 0, 0))) as GameObject; 19 | newHand.transform.parent = controller.transform; 20 | GameObject pathSpriteContainer = Instantiate(pathSpritePrefab, new Vector3(0, 0, 0), Quaternion.Euler(new Vector3(0, -90, 0))) as GameObject; 21 | pathSpriteContainer.transform.parent = controller.transform; 22 | // TODO: there's got to be a better way to do this... 23 | adapter.pathSpriteComponents = new GameObject[] { 24 | controller.transform.Find("Path Sprite(Clone)/LaserMode1").gameObject, 25 | controller.transform.Find("Path Sprite(Clone)/LaserMode2").gameObject, 26 | controller.transform.Find("Path Sprite(Clone)/Telescope1").gameObject, 27 | controller.transform.Find("Path Sprite(Clone)/Telescope2").gameObject, 28 | controller.transform.Find("Path Sprite(Clone)/Selection1").gameObject, 29 | controller.transform.Find("Path Sprite(Clone)/Selection2").gameObject 30 | }; 31 | } 32 | } 33 | 34 | void Update() { 35 | foreach (GameObject controller in controllers) { 36 | FocalPointVR_SteamVRControllerAdapterDemo2 adapter = controller.GetComponent(); 37 | adapter.syndromeMode = enablePinnedMode; 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 2 - Pill Fountain/FocalPointVR_SteamVRAdapterDemo2.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 04d3cc3b2a5c7fc418bf323919994b83 3 | timeCreated: 1459190113 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 2 - Pill Fountain/FocalPointVR_SteamVRControllerAdapterDemo2.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class FocalPointVR_SteamVRControllerAdapterDemo2 : MonoBehaviour { 5 | private FocalPointVR_PointGenerator pointGenerator; 6 | private int controllerIndex; 7 | 8 | public FocalPointVR_InteractionManager ixdManager { get; set; } 9 | private SteamVR_TrackedObject steamTrackedObj; 10 | 11 | public GameObject[] pathSpriteComponents { get; set; } 12 | private bool selectionMode; 13 | private GameObject hoveredSubject; 14 | public bool syndromeMode { get; set; } 15 | 16 | void Start() { 17 | pointGenerator = GetComponentInChildren(); 18 | ixdManager.registerPointGenerator(pointGenerator); 19 | steamTrackedObj = GetComponent(); 20 | controllerIndex = GetComponent().index.GetHashCode(); 21 | } 22 | 23 | void Update() { 24 | // TODO -- this is quite inefficient -- would be interested in a better implementation 25 | controllerIndex = steamTrackedObj.index.GetHashCode(); 26 | if (SteamVR_Controller.Input(controllerIndex).GetPressDown(SteamVR_Controller.ButtonMask.Grip)) { 27 | if (syndromeMode) { 28 | pointGenerator.ClosePlate(); 29 | } else { 30 | pointGenerator.ClosePincer(); 31 | } 32 | } 33 | if (SteamVR_Controller.Input(controllerIndex).GetPressUp(SteamVR_Controller.ButtonMask.Grip)) { 34 | if (syndromeMode) { 35 | pointGenerator.OpenPlate(); 36 | } else { 37 | pointGenerator.OpenPincer(); 38 | } 39 | } 40 | if (SteamVR_Controller.Input(controllerIndex).GetHairTriggerDown()) { 41 | setSelectionMode(true); 42 | } 43 | if (SteamVR_Controller.Input(controllerIndex).GetHairTriggerUp()) { 44 | setSelectionMode(false); 45 | } 46 | if (selectionMode) { 47 | Ray selectionRay = new Ray(transform.position, transform.forward); 48 | RaycastHit[] hits; 49 | hits = Physics.RaycastAll(selectionRay); 50 | float closestDistance = 999999999.9f; 51 | hoveredSubject = null; 52 | foreach (RaycastHit hit in hits) { 53 | // TODO: there has to be a better way... 54 | if (hit.distance < closestDistance) { 55 | FocalPointVR_ManipulationHandler manipHandler = hit.collider.gameObject.GetComponent(); 56 | if (manipHandler != null && manipHandler.isSelectable) { 57 | closestDistance = hit.distance; 58 | hoveredSubject = hit.collider.gameObject; 59 | } 60 | } 61 | } 62 | } 63 | if (SteamVR_Controller.Input(controllerIndex).GetAxis(Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger).x > 0.999f) { 64 | if (ixdManager.subject != hoveredSubject && hoveredSubject != null) { 65 | ixdManager.changeSubject(hoveredSubject); 66 | } 67 | } 68 | } 69 | 70 | void setSelectionMode(bool state) { 71 | displayPathSprite(state ? 4 : -99); 72 | selectionMode = state; 73 | } 74 | 75 | void displayPathSprite(int index) { 76 | for (int i = 0; i < pathSpriteComponents.Length; i++) { 77 | pathSpriteComponents[i].SetActive(index == i || index + 1 == i); 78 | } 79 | } 80 | } 81 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 2 - Pill Fountain/FocalPointVR_SteamVRControllerAdapterDemo2.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2e20ba52a23cea45952f9eb9579daa4 3 | timeCreated: 1459190710 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 2 - Pill Fountain/GenerateCapsules.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class GenerateCapsules : MonoBehaviour { 5 | public GameObject prefab; 6 | public float delay = 0.1f; 7 | 8 | private float lastGeneration = 0; 9 | 10 | void Update () { 11 | if (Time.time > lastGeneration + delay) { 12 | Quaternion startRotation = Quaternion.Euler (Random.Range (0, 360), Random.Range (0, 360), Random.Range (0, 360)); 13 | GameObject newObj = Instantiate(prefab, Vector3.zero, startRotation) as GameObject; 14 | newObj.transform.SetParent(transform, false); 15 | lastGeneration = Time.time; 16 | } 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 2 - Pill Fountain/GenerateCapsules.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 67f978a7051134197b1e1db4d0f59b86 3 | timeCreated: 1458869748 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 2 - Pill Fountain/RelativeMass.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class RelativeMass : MonoBehaviour { 5 | private Collider col; 6 | private Rigidbody rbody; 7 | private FocalPointVR_ManipulationHandler manipHandler; 8 | 9 | void Start () { 10 | col = GetComponent(); 11 | rbody = GetComponent(); 12 | manipHandler = GetComponent(); 13 | } 14 | 15 | void Update () { 16 | if (manipHandler.isCaptured) { 17 | rbody.mass = col.bounds.extents.magnitude; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 2 - Pill Fountain/RelativeMass.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8b01981f22a860d4d903e6e47c0f1198 3 | timeCreated: 1458944884 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 2 - Pill Fountain/TimeToLive.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class TimeToLive : MonoBehaviour { 5 | public float timeToLive = 15.0f; 6 | private float initializationTime; 7 | private FocalPointVR_ManipulationHandler manipHandler; 8 | 9 | // Use this for initialization 10 | void Start () { 11 | initializationTime = Time.time; 12 | manipHandler = GetComponent(); 13 | } 14 | 15 | // Update is called once per frame 16 | void Update () { 17 | if (manipHandler.isCaptured) { 18 | initializationTime = Time.time; 19 | } 20 | if (Time.time > initializationTime + timeToLive) { 21 | Destroy (this.gameObject); 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 2 - Pill Fountain/TimeToLive.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4fa946eb3d77426fbff569caaf65fce 3 | timeCreated: 1458870043 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b89fc4102cb91f04980fb2c11dbfefb2 3 | folderAsset: yes 4 | timeCreated: 1459198841 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room/Demo 3 - Moving in a Room.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Demo 3 - Moving in a Room/Demo 3 - Moving in a Room.unity -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room/Demo 3 - Moving in a Room.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7fcbb5e6d03b82d4e964a01b24d5e669 3 | timeCreated: 1459198857 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room/FocalPointVR_InteractionManagerDemo3and4.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 56d911e17644c49579d8c46a724f422c 3 | timeCreated: 1459219440 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room/FocalPointVR_SteamVRAdapterDemo3and4.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class FocalPointVR_SteamVRAdapterDemo3and4 : MonoBehaviour { 5 | public GameObject handPrefab; 6 | private GameObject[] controllers = new GameObject[2]; 7 | private FocalPointVR_InteractionManagerDemo3and4 ixdManager; 8 | public GameObject pathSpritePrefab; 9 | public float laserDistanceMax = 7; 10 | private FocalPointVR_SteamVRControllerAdapterDemo3and4[] adapters = new FocalPointVR_SteamVRControllerAdapterDemo3and4[2]; 11 | 12 | void Start() { 13 | controllers[0] = transform.parent.FindChild("Controller (left)").gameObject; 14 | controllers[1] = transform.parent.FindChild("Controller (right)").gameObject; 15 | ixdManager = GetComponent(); 16 | for (int i = 0; i < controllers.Length; i++) { 17 | adapters[i] = controllers[i].AddComponent(); 18 | adapters[i].ixdManager = ixdManager; 19 | adapters[i].laserDistanceMax = laserDistanceMax; 20 | GameObject newHand = Instantiate(handPrefab, new Vector3(0, 0, 0), Quaternion.Euler(new Vector3(0, 0, 0))) as GameObject; 21 | newHand.transform.parent = controllers[i].transform; 22 | GameObject pathSpriteContainer = Instantiate(pathSpritePrefab, new Vector3(0, 0, 0), Quaternion.Euler(new Vector3(0, -90, 0))) as GameObject; 23 | pathSpriteContainer.transform.parent = controllers[i].transform; 24 | // TODO: there's got to be a better way to do this... 25 | adapters[i].pathSpriteComponents = new GameObject[] { 26 | controllers[i].transform.Find("Path Sprite(Clone)/LaserMode1").gameObject, 27 | controllers[i].transform.Find("Path Sprite(Clone)/LaserMode2").gameObject, 28 | controllers[i].transform.Find("Path Sprite(Clone)/Telescope1").gameObject, 29 | controllers[i].transform.Find("Path Sprite(Clone)/Telescope2").gameObject, 30 | controllers[i].transform.Find("Path Sprite(Clone)/Selection1").gameObject, 31 | controllers[i].transform.Find("Path Sprite(Clone)/Selection2").gameObject 32 | }; 33 | } 34 | } 35 | 36 | void Update() { 37 | foreach (FocalPointVR_SteamVRControllerAdapterDemo3and4 adapter in adapters) { 38 | adapter.laserDistanceMax = laserDistanceMax; 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room/FocalPointVR_SteamVRAdapterDemo3and4.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c28abab0c6a55984a9fc1f8275b329a5 3 | timeCreated: 1459262819 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room/FocalPointVR_SteamVRControllerAdapterDemo3and4.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class FocalPointVR_SteamVRControllerAdapterDemo3and4 : MonoBehaviour { 5 | private FocalPointVR_PointGenerator pointGenerator; 6 | private int controllerIndex; 7 | 8 | public FocalPointVR_InteractionManagerDemo3and4 ixdManager { get; set; } 9 | private SteamVR_TrackedObject steamTrackedObj; 10 | 11 | public GameObject[] pathSpriteComponents { get; set; } 12 | private GameObject hoveredSubject; 13 | private GameObject otherController; 14 | 15 | private bool laserPressed = false; 16 | private bool laserMode = false; 17 | private Plane laserPlane; 18 | private float laserDistance = 0; 19 | public float laserDistanceMax = 7; 20 | 21 | void Start() { 22 | laserPlane = new Plane(Vector3.up, Vector3.zero); 23 | pointGenerator = GetComponentInChildren(); 24 | ixdManager.registerPointGenerator(pointGenerator); 25 | steamTrackedObj = GetComponent(); 26 | controllerIndex = GetComponent().index.GetHashCode(); 27 | } 28 | 29 | void Update() { 30 | // TODO -- this is quite inefficient -- would be interested in a better implementation 31 | controllerIndex = steamTrackedObj.index.GetHashCode(); 32 | 33 | if (laserMode) { 34 | Ray laserRay = new Ray(transform.position, transform.forward); 35 | if (laserPlane.Raycast(laserRay, out laserDistance) && laserDistance < laserDistanceMax) { 36 | pointGenerator.transform.localPosition = Vector3.forward * laserDistance; 37 | } else { 38 | setLaserMode(false); 39 | } 40 | } 41 | if (SteamVR_Controller.Input(controllerIndex).GetPressDown(SteamVR_Controller.ButtonMask.Grip)) { 42 | pointGenerator.ClosePincer(); 43 | } 44 | if (SteamVR_Controller.Input(controllerIndex).GetPressUp(SteamVR_Controller.ButtonMask.Grip)) { 45 | pointGenerator.OpenPincer(); 46 | } 47 | if (SteamVR_Controller.Input(controllerIndex).GetHairTriggerDown()) { 48 | setLaserMode(true); 49 | } 50 | if (SteamVR_Controller.Input(controllerIndex).GetHairTriggerUp()) { 51 | setLaserMode(false); 52 | } 53 | // workaround: SteamVR onTriggerDown / Up seems to be buggy (or I just didn't get it) 54 | if (SteamVR_Controller.Input(controllerIndex).GetAxis(Valve.VR.EVRButtonId.k_EButton_SteamVR_Trigger).x > 0.999f) { 55 | if (!laserPressed) { 56 | Ray laserRay = new Ray(transform.position, transform.forward); 57 | if (laserPlane.Raycast(laserRay, out laserDistance) && laserDistance < laserDistanceMax) { 58 | pointGenerator.transform.localPosition = Vector3.forward * laserDistance; 59 | pointGenerator.ClosePincer(); 60 | } 61 | } 62 | laserPressed = true; 63 | } else { 64 | if (laserPressed) { 65 | pointGenerator.OpenPincer(); 66 | pointGenerator.transform.localPosition = Vector3.zero; 67 | } 68 | laserPressed = false; 69 | } 70 | } 71 | 72 | void setLaserMode(bool state) { 73 | if (state) { 74 | displayPathSprite(0); 75 | } else { 76 | displayPathSprite(-99); 77 | pointGenerator.OpenPincer(); 78 | pointGenerator.transform.localPosition = Vector3.zero; 79 | } 80 | laserMode = state; 81 | } 82 | 83 | void displayPathSprite(int index) { 84 | for (int i = 0; i < pathSpriteComponents.Length; i++) { 85 | pathSpriteComponents[i].SetActive(index == i || index + 1 == i); 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room/FocalPointVR_SteamVRControllerAdapterDemo3and4.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 31908610919869747b74e439837b9075 3 | timeCreated: 1459263004 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84a840bcd29bb34479fc7c37feaaca57 3 | folderAsset: yes 4 | timeCreated: 1459271968 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room/Materials/bluish.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Demo 3 - Moving in a Room/Materials/bluish.mat -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room/Materials/bluish.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a926285c63bd99048a4c882cfb576d15 3 | timeCreated: 1459201294 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room/Materials/default_features.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Demo 3 - Moving in a Room/Materials/default_features.mat -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room/Materials/default_features.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba50c1f164ec9c0438b8116d8bc9b448 3 | timeCreated: 1459199477 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room/Materials/greenish.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Demo 3 - Moving in a Room/Materials/greenish.mat -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room/Materials/greenish.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 946b77ad4e4714c4cbfb775b1b92a13a 3 | timeCreated: 1459201303 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room/Materials/reddish.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Demo 3 - Moving in a Room/Materials/reddish.mat -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room/Materials/reddish.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e0c48f8bbc7c1e241a3c1f6bbf484a5e 3 | timeCreated: 1459201013 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room/Materials/tile.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Demo 3 - Moving in a Room/Materials/tile.mat -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room/Materials/tile.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c0dc22f753b80a341a7617134283fce2 3 | timeCreated: 1459271968 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room/Materials/tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Demo 3 - Moving in a Room/Materials/tile.png -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 3 - Moving in a Room/Materials/tile.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: edc02bb84cdff6a4c99b5e53c5167fd3 3 | timeCreated: 1459271868 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 0 49 | textureType: -1 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 4 - Moving in a World.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce040fd585e1b47b4a0ea5e5c29a0098 3 | folderAsset: yes 4 | timeCreated: 1459250152 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 4 - Moving in a World/Demo 4 - Moving in a World.unity: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Demo 4 - Moving in a World/Demo 4 - Moving in a World.unity -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 4 - Moving in a World/Demo 4 - Moving in a World.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ab53d403e063a4bd3a0056a837a3d083 3 | timeCreated: 1459250174 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 4 - Moving in a World/tile.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Demo 4 - Moving in a World/tile.mat -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 4 - Moving in a World/tile.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 492dca7e159d840458c1098b69016eb8 3 | timeCreated: 1459271872 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 4 - Moving in a World/tile.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Demo 4 - Moving in a World/tile.png -------------------------------------------------------------------------------- /Assets/Focal Point VR/Demo 4 - Moving in a World/tile.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6c9a230d4592b814493f17a6e692a5ff 3 | timeCreated: 1459271951 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapMode: -1 36 | nPOTScale: 1 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 0 49 | textureType: -1 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f4c1ff5d763ebd34cb11f1aef1955bd5 3 | folderAsset: yes 4 | timeCreated: 1459270932 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Prefabs/Hands.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Prefabs/Hands.prefab -------------------------------------------------------------------------------- /Assets/Focal Point VR/Prefabs/Hands.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3ea19cf42b2949847909e17dcb8bab3d 3 | timeCreated: 1459182511 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Prefabs/Path Sprite.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Prefabs/Path Sprite.prefab -------------------------------------------------------------------------------- /Assets/Focal Point VR/Prefabs/Path Sprite.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dd56fa851f46072448f9ce69240c75cd 3 | timeCreated: 1459191260 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Prefabs/Standard SteamVR Adapter.prefab: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Prefabs/Standard SteamVR Adapter.prefab -------------------------------------------------------------------------------- /Assets/Focal Point VR/Prefabs/Standard SteamVR Adapter.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 30740e9205010bf43aa933b92af38cf6 3 | timeCreated: 1459273852 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/README.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/README.pdf -------------------------------------------------------------------------------- /Assets/Focal Point VR/README.pdf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 180855f2c599c44ada0810795688778e 3 | timeCreated: 1459475908 4 | licenseType: Free 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 447861765e1ab4a409351c66ffb1fc22 3 | folderAsset: yes 4 | timeCreated: 1459270894 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Resources/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71dcfc50c752aee428c0b8f828fae569 3 | folderAsset: yes 4 | timeCreated: 1459271124 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Resources/Materials/tile.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Resources/Materials/tile.mat -------------------------------------------------------------------------------- /Assets/Focal Point VR/Resources/Materials/tile.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 235d31ea39f097a4cb8fd642f1e83ad2 3 | timeCreated: 1459271124 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Resources/Tiled.mat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Resources/Tiled.mat -------------------------------------------------------------------------------- /Assets/Focal Point VR/Resources/Tiled.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f0aebd690bea3d4ba5c980144435d4f 3 | timeCreated: 1459271097 4 | licenseType: Free 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Resources/hand-closed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Resources/hand-closed.gif -------------------------------------------------------------------------------- /Assets/Focal Point VR/Resources/hand-closed.gif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d7f91a23e2d6a488d8aa9d7f08dea3fe 3 | timeCreated: 1458665108 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: 0 33 | aniso: 16 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 1 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 7 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 8 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Resources/hand-opened.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Resources/hand-opened.gif -------------------------------------------------------------------------------- /Assets/Focal Point VR/Resources/hand-opened.gif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 525ae68697d374ae5b2db1d652d58b3f 3 | timeCreated: 1458665108 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: 0 33 | aniso: 16 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 1 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 7 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 8 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Resources/hand-pointer.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Resources/hand-pointer.gif -------------------------------------------------------------------------------- /Assets/Focal Point VR/Resources/hand-pointer.gif.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e22c38c2a442fc48bce2add87b1f51f 3 | timeCreated: 1458755352 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: 0 33 | aniso: 16 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 1 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 7 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 8 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Resources/laser-blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Resources/laser-blue.png -------------------------------------------------------------------------------- /Assets/Focal Point VR/Resources/laser-blue.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 17b9fcd35eb624140bee860bcfcd5214 3 | timeCreated: 1458540183 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: 1 33 | aniso: 16 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 1 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 4 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 8 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Resources/laser-faint.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Resources/laser-faint.png -------------------------------------------------------------------------------- /Assets/Focal Point VR/Resources/laser-faint.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: eb4421e1a830a9d4fb44b34e21185049 3 | timeCreated: 1458942786 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 16 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 1 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 4 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 8 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Resources/laser-red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Resources/laser-red.png -------------------------------------------------------------------------------- /Assets/Focal Point VR/Resources/laser-red.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c22b5f4427a654556b672defb3b799cf 3 | timeCreated: 1458929564 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 16 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 1 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 4 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 8 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Resources/telescope.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Focal Point VR/Resources/telescope.png -------------------------------------------------------------------------------- /Assets/Focal Point VR/Resources/telescope.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5021a6dbe7a5644279f044d5a1236f2c 3 | timeCreated: 1458570750 4 | licenseType: Free 5 | TextureImporter: 6 | fileIDToRecycleName: {} 7 | serializedVersion: 2 8 | mipmaps: 9 | mipMapMode: 0 10 | enableMipMap: 1 11 | linearTexture: 0 12 | correctGamma: 0 13 | fadeOut: 0 14 | borderMipMap: 0 15 | mipMapFadeDistanceStart: 1 16 | mipMapFadeDistanceEnd: 3 17 | bumpmap: 18 | convertToNormalMap: 0 19 | externalNormalMap: 0 20 | heightScale: 0.25 21 | normalMapFilter: 0 22 | isReadable: 0 23 | grayScaleToAlpha: 0 24 | generateCubemap: 0 25 | cubemapConvolution: 0 26 | cubemapConvolutionSteps: 7 27 | cubemapConvolutionExponent: 1.5 28 | seamlessCubemap: 0 29 | textureFormat: -1 30 | maxTextureSize: 2048 31 | textureSettings: 32 | filterMode: -1 33 | aniso: 16 34 | mipBias: -1 35 | wrapMode: 1 36 | nPOTScale: 0 37 | lightmap: 0 38 | rGBM: 0 39 | compressionQuality: 50 40 | allowsAlphaSplitting: 0 41 | spriteMode: 1 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 4 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 47 | spritePixelsToUnits: 100 48 | alphaIsTransparency: 1 49 | textureType: 8 50 | buildTargetSettings: [] 51 | spriteSheet: 52 | sprites: [] 53 | outline: [] 54 | spritePackingTag: 55 | userData: 56 | assetBundleName: 57 | assetBundleVariant: 58 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46d20181fe558ca42991d165de794966 3 | folderAsset: yes 4 | timeCreated: 1459270883 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Scripts/FocalPointVR_InteractionManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9133fc9fd5326254f805878607a87ffc 3 | timeCreated: 1459180719 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Scripts/FocalPointVR_ManipulationHandler.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | //[RequireComponent()] 4 | 5 | public class FocalPointVR_ManipulationHandler : MonoBehaviour { 6 | 7 | public bool lockTranslation; 8 | public bool lockRotation; 9 | public bool lockScale; 10 | [Header("Please review README for these settings")] 11 | public bool translationInertiaOnRelease = true; 12 | public float translationInertiaThreshold = 8f; 13 | public bool rotationInertiaOnRelease = true; 14 | public float rotationInertiaThreshold = 5f; 15 | public float flickAnimationLength = 0.3f; 16 | public bool isSelectable = true; 17 | 18 | public Vector3 thisFramePosition { get; set; } 19 | public Quaternion thisFrameRotation { get; set; } 20 | public Vector3 thisFrameScale { get; set; } 21 | public float thisFrameTimeStamp { get; set; } 22 | 23 | public Vector3 lastFramePosition { get; set; } 24 | public Quaternion lastFrameRotation { get; set; } 25 | public Vector3 lastFrameScale { get; set; } 26 | public float lastFrameTimeStamp { get; set; } 27 | 28 | private bool isPhysicsBased; 29 | private Rigidbody rbody; 30 | private bool prevKinematicState; 31 | 32 | private float timeOfRelease = -99999; 33 | private Vector3 translationInertiaVelocity; 34 | private Quaternion rotationInertiaDelta; 35 | 36 | public bool isCaptured { get; set; } 37 | 38 | void Start() { 39 | rbody = GetComponent(); 40 | isPhysicsBased = (rbody != null && !rbody.isKinematic); 41 | } 42 | 43 | void Update() { 44 | if ((Time.time - timeOfRelease) < flickAnimationLength) { 45 | float portionOfAnimationLeft = 1 - ((Time.time - timeOfRelease) / flickAnimationLength); 46 | if (translationInertiaOnRelease) { 47 | transform.position += translationInertiaVelocity * Time.deltaTime * portionOfAnimationLeft; 48 | } 49 | if (rotationInertiaOnRelease) { 50 | float angle = 0.0F; 51 | Vector3 axis = Vector3.zero; 52 | rotationInertiaDelta.ToAngleAxis(out angle, out axis); 53 | angle *= portionOfAnimationLeft; 54 | transform.Rotate(axis, angle); 55 | } 56 | } 57 | } 58 | 59 | public void capture() { 60 | isCaptured = true; 61 | timeOfRelease = -99999; 62 | if (isPhysicsBased) { 63 | prevKinematicState = rbody.isKinematic; 64 | rbody.isKinematic = true; 65 | } 66 | } 67 | 68 | public void release() { 69 | isCaptured = false; 70 | float timeDelta = thisFrameTimeStamp - lastFrameTimeStamp; 71 | if (isPhysicsBased) { 72 | rbody.isKinematic = prevKinematicState; 73 | if (translationInertiaOnRelease) { 74 | rbody.velocity = (thisFramePosition - lastFramePosition) / timeDelta; 75 | } 76 | if (rotationInertiaOnRelease) { 77 | float angle = 0.0F; 78 | Vector3 axis = Vector3.zero; 79 | Quaternion delta = Quaternion.Inverse(lastFrameRotation) * thisFrameRotation; 80 | delta.ToAngleAxis(out angle, out axis); 81 | rbody.AddRelativeTorque(axis.normalized * angle / timeDelta); 82 | } 83 | } else { 84 | timeOfRelease = Time.time; 85 | if (translationInertiaOnRelease) { 86 | Vector3 potentialVel = (thisFramePosition - lastFramePosition) / timeDelta; 87 | if (potentialVel.magnitude > translationInertiaThreshold) { 88 | translationInertiaVelocity = potentialVel; 89 | } else { 90 | translationInertiaVelocity = Vector3.zero; 91 | } 92 | } 93 | if (rotationInertiaOnRelease) { 94 | Quaternion potentialRot = Quaternion.Inverse(lastFrameRotation) * thisFrameRotation; 95 | float potentialAngle; 96 | Vector3 trashAngle; 97 | potentialRot.ToAngleAxis(out potentialAngle, out trashAngle); 98 | if (potentialAngle > rotationInertiaThreshold) { 99 | rotationInertiaDelta = Quaternion.Inverse(lastFrameRotation) * thisFrameRotation; 100 | } else { 101 | rotationInertiaDelta = Quaternion.identity; 102 | } 103 | } 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Scripts/FocalPointVR_ManipulationHandler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bdab7130a7480f148a9ed3a6812c45ac 3 | timeCreated: 1459183705 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Scripts/FocalPointVR_PointGenerator.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | public class FocalPointVR_PointGenerator : MonoBehaviour { 6 | private Vector3 pincerDifference = new Vector3(0, 0, 0.09f); 7 | 8 | public bool isClosed { get; set; } 9 | public bool samePointsAsLastFrame { get; set; } 10 | 11 | private GameObject[] handSprites = new GameObject[3]; 12 | 13 | public void Start() { 14 | samePointsAsLastFrame = true; 15 | handSprites[0] = transform.Find("open").gameObject; 16 | handSprites[1] = transform.Find("closed").gameObject; 17 | handSprites[2] = transform.Find("pointer").gameObject; 18 | if (transform.parent.gameObject.name == "Controller (left)") { 19 | foreach (GameObject handSprite in handSprites) { 20 | handSprite.transform.Rotate(Vector3.up, 180); 21 | } 22 | } 23 | displayHandSprite(0); 24 | } 25 | 26 | void Update() { 27 | if (isClosed) { 28 | displayHandSprite(1); 29 | } else { 30 | displayHandSprite(0); 31 | } 32 | } 33 | 34 | public void ClosePincer() { 35 | if (!isClosed) { 36 | addFocalPoint(Vector3.zero); 37 | samePointsAsLastFrame = false; 38 | isClosed = true; 39 | } 40 | } 41 | 42 | public void ClosePlate() { 43 | if (!isClosed) { 44 | addFocalPoint(Vector3.zero); 45 | addFocalPoint(Vector3.forward); 46 | addFocalPoint(Vector3.up); 47 | samePointsAsLastFrame = false; 48 | 49 | isClosed = true; 50 | } 51 | } 52 | 53 | public void OpenPincer() { 54 | if (isClosed) { 55 | removeAllFocalPoints(); 56 | samePointsAsLastFrame = false; 57 | isClosed = false; 58 | } 59 | } 60 | 61 | public void OpenPlate() { 62 | OpenPincer(); 63 | } 64 | 65 | public void addFocalPoint(Vector3 localLocation) { 66 | GameObject focalPoint = new GameObject("FocalPoint"); 67 | focalPoint.transform.localPosition = pincerDifference + localLocation; 68 | focalPoint.transform.SetParent(transform, false); 69 | } 70 | 71 | public void removeAllFocalPoints() { 72 | foreach (Transform child in transform) { 73 | if (child.name == "FocalPoint") { 74 | Destroy(child.gameObject); 75 | } 76 | } 77 | } 78 | 79 | public bool CheckIfPointsHaveUpdated() { 80 | bool returnValue = !samePointsAsLastFrame; 81 | samePointsAsLastFrame = true; 82 | return returnValue; 83 | } 84 | 85 | void displayHandSprite(int index) { 86 | for (int i = 0; i < handSprites.Length; i++) { 87 | handSprites[i].SetActive(index == i); 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Scripts/FocalPointVR_PointGenerator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9a466e51d3afc274a88349a7bc5aca9a 3 | timeCreated: 1459182584 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Scripts/FocalPointVR_SteamVRAdapter.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class FocalPointVR_SteamVRAdapter : MonoBehaviour { 5 | public GameObject handPrefab; 6 | private GameObject[] controllers = new GameObject[2]; 7 | private FocalPointVR_InteractionManager ixdManager; 8 | 9 | void Start() { 10 | controllers[0] = transform.parent.FindChild("Controller (left)").gameObject; 11 | controllers[1] = transform.parent.FindChild("Controller (right)").gameObject; 12 | ixdManager = GetComponent(); 13 | foreach (GameObject controller in controllers) { 14 | FocalPointVR_SteamVRControllerAdapter adapter = controller.AddComponent(); 15 | adapter.ixdManager = ixdManager; 16 | GameObject newHand = Instantiate(handPrefab, new Vector3(0, 0, 0), Quaternion.Euler(new Vector3(0, 0, 0))) as GameObject; 17 | newHand.transform.parent = controller.transform; 18 | } 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Scripts/FocalPointVR_SteamVRAdapter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4ee376e323f7a342a2eda3432b17f1f 3 | timeCreated: 1459189499 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Scripts/FocalPointVR_SteamVRControllerAdapter.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class FocalPointVR_SteamVRControllerAdapter : MonoBehaviour { 5 | private FocalPointVR_PointGenerator pointGenerator; 6 | private int controllerIndex; 7 | 8 | public FocalPointVR_InteractionManager ixdManager { get; set; } 9 | private SteamVR_TrackedObject steamTrackedObj; 10 | 11 | void Start() { 12 | pointGenerator = GetComponentInChildren(); 13 | if (ixdManager == null) { 14 | ixdManager = GameObject.FindObjectOfType (); 15 | } 16 | ixdManager.registerPointGenerator(pointGenerator); 17 | steamTrackedObj = GetComponent(); 18 | controllerIndex = GetComponent().index.GetHashCode(); 19 | } 20 | 21 | void Update() { 22 | // TODO -- this is quite inefficient -- would be interested in a better implementation 23 | controllerIndex = steamTrackedObj.index.GetHashCode(); 24 | if (SteamVR_Controller.Input(controllerIndex).GetPressDown(SteamVR_Controller.ButtonMask.Grip)) { 25 | pointGenerator.ClosePincer(); 26 | } 27 | if (SteamVR_Controller.Input(controllerIndex).GetPressUp(SteamVR_Controller.ButtonMask.Grip)) { 28 | pointGenerator.OpenPincer(); 29 | } 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Assets/Focal Point VR/Scripts/FocalPointVR_SteamVRControllerAdapter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62f38069c21c4064eaba28d5096f6c5e 3 | timeCreated: 1459184599 4 | licenseType: Free 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 044676ff5cc7346439a8b9ecb42f460c 3 | folderAsset: yes 4 | timeCreated: 1458326221 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/openvr_api.bundle.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2bb816223e2316840932be84abe8f801 3 | folderAsset: yes 4 | timeCreated: 1458326221 5 | licenseType: Free 6 | PluginImporter: 7 | serializedVersion: 1 8 | iconMap: {} 9 | executionOrder: {} 10 | isPreloaded: 0 11 | platformData: 12 | Any: 13 | enabled: 1 14 | settings: {} 15 | userData: 16 | assetBundleName: 17 | assetBundleVariant: 18 | -------------------------------------------------------------------------------- /Assets/Plugins/openvr_api.bundle/Contents.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 584978b6e97bc174781d2b2d6cc2c43a 3 | folderAsset: yes 4 | timeCreated: 1458326221 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/openvr_api.bundle/Contents/Info.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | BuildMachineOSBuild 6 | 13F1077 7 | CFBundleDevelopmentRegion 8 | en 9 | CFBundleExecutable 10 | openvr_api 11 | CFBundleIdentifier 12 | com.valvesoftware.openvr-api 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | openvr_api 17 | CFBundlePackageType 18 | BNDL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleSignature 22 | ???? 23 | CFBundleVersion 24 | 1 25 | DTCompiler 26 | com.apple.compilers.llvm.clang.1_0 27 | DTPlatformBuild 28 | 6A1052d 29 | DTPlatformVersion 30 | GM 31 | DTSDKBuild 32 | 14A382 33 | DTSDKName 34 | macosx10.10 35 | DTXcode 36 | 0610 37 | DTXcodeBuild 38 | 6A1052d 39 | NSHumanReadableCopyright 40 | Copyright © 2015 Valve Corporation. All rights reserved. 41 | 42 | 43 | -------------------------------------------------------------------------------- /Assets/Plugins/openvr_api.bundle/Contents/Info.plist.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7312850033767144bb8b56eac9e62164 3 | timeCreated: 1438824914 4 | licenseType: Store 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/openvr_api.bundle/Contents/MacOS.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b4e881738062e24a8ed54961deb338c 3 | folderAsset: yes 4 | timeCreated: 1458326221 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/openvr_api.bundle/Contents/MacOS/openvr_api: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Plugins/openvr_api.bundle/Contents/MacOS/openvr_api -------------------------------------------------------------------------------- /Assets/Plugins/openvr_api.bundle/Contents/MacOS/openvr_api.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4336b0f89b9f24808bfc781a1e52b6f0 3 | timeCreated: 1438825138 4 | licenseType: Store 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/openvr_api.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8d26b9eddedb33d48be044bb268a57c7 3 | timeCreated: 1429123043 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/Plugins/x86.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f42cb9c903ff2134fb514fddbc6df05c 3 | folderAsset: yes 4 | timeCreated: 1458326221 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/x86/openvr_api.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Plugins/x86/openvr_api.dll -------------------------------------------------------------------------------- /Assets/Plugins/x86/openvr_api.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73d5d79effb76f84491567f3c473b810 3 | timeCreated: 1429123045 4 | licenseType: Store 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 1 13 | settings: {} 14 | userData: 15 | assetBundleName: 16 | assetBundleVariant: 17 | -------------------------------------------------------------------------------- /Assets/Plugins/x86_64.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13cec283b1a06d24d8745b7bc7e89d02 3 | folderAsset: yes 4 | timeCreated: 1458326221 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/Plugins/x86_64/openvr_api.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/Plugins/x86_64/openvr_api.dll -------------------------------------------------------------------------------- /Assets/Plugins/x86_64/openvr_api.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d42e4d46d897b648a1d6ed58a18e8a6 3 | timeCreated: 1429123045 4 | licenseType: Store 5 | PluginImporter: 6 | serializedVersion: 1 7 | iconMap: {} 8 | executionOrder: {} 9 | isPreloaded: 0 10 | platformData: 11 | Any: 12 | enabled: 1 13 | settings: {} 14 | userData: 15 | assetBundleName: 16 | assetBundleVariant: 17 | -------------------------------------------------------------------------------- /Assets/SteamVR.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 236d1097704272848874b51378c6fea0 3 | folderAsset: yes 4 | timeCreated: 1458326221 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: db9d9819ab2094844b67053bc629bcb7 3 | folderAsset: yes 4 | timeCreated: 1458326221 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Editor/SteamVR_Editor.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2014, Valve Corporation, All rights reserved. =========== 2 | // 3 | // Purpose: Custom inspector display for SteamVR_Camera 4 | // 5 | //============================================================================= 6 | 7 | using UnityEngine; 8 | using UnityEditor; 9 | using System.IO; 10 | 11 | [CustomEditor(typeof(SteamVR_Camera)), CanEditMultipleObjects] 12 | public class SteamVR_Editor : Editor 13 | { 14 | int bannerHeight = 150; 15 | Texture logo; 16 | 17 | SerializedProperty script, wireframe; 18 | 19 | string GetResourcePath() 20 | { 21 | var ms = MonoScript.FromScriptableObject(this); 22 | var path = AssetDatabase.GetAssetPath(ms); 23 | path = Path.GetDirectoryName(path); 24 | return path.Substring(0, path.Length - "Editor".Length) + "Textures/"; 25 | } 26 | 27 | void OnEnable() 28 | { 29 | var resourcePath = GetResourcePath(); 30 | #if UNITY_5_0 31 | logo = Resources.LoadAssetAtPath(resourcePath + "logo.png"); 32 | #else 33 | logo = AssetDatabase.LoadAssetAtPath(resourcePath + "logo.png"); 34 | #endif 35 | script = serializedObject.FindProperty("m_Script"); 36 | 37 | wireframe = serializedObject.FindProperty("wireframe"); 38 | 39 | foreach (SteamVR_Camera target in targets) 40 | target.ForceLast(); 41 | } 42 | 43 | public override void OnInspectorGUI() 44 | { 45 | serializedObject.Update(); 46 | 47 | var rect = GUILayoutUtility.GetRect(Screen.width - 38, bannerHeight, GUI.skin.box); 48 | if (logo) 49 | GUI.DrawTexture(rect, logo, ScaleMode.ScaleToFit); 50 | 51 | if (!Application.isPlaying) 52 | { 53 | var expand = false; 54 | var collapse = false; 55 | foreach (SteamVR_Camera target in targets) 56 | { 57 | if (AssetDatabase.Contains(target)) 58 | continue; 59 | if (target.isExpanded) 60 | collapse = true; 61 | else 62 | expand = true; 63 | } 64 | 65 | if (expand) 66 | { 67 | GUILayout.BeginHorizontal(); 68 | if (GUILayout.Button("Expand")) 69 | { 70 | foreach (SteamVR_Camera target in targets) 71 | { 72 | if (AssetDatabase.Contains(target)) 73 | continue; 74 | if (!target.isExpanded) 75 | { 76 | target.Expand(); 77 | EditorUtility.SetDirty(target); 78 | } 79 | } 80 | } 81 | GUILayout.Space(18); 82 | GUILayout.EndHorizontal(); 83 | } 84 | 85 | if (collapse) 86 | { 87 | GUILayout.BeginHorizontal(); 88 | if (GUILayout.Button("Collapse")) 89 | { 90 | foreach (SteamVR_Camera target in targets) 91 | { 92 | if (AssetDatabase.Contains(target)) 93 | continue; 94 | if (target.isExpanded) 95 | { 96 | target.Collapse(); 97 | EditorUtility.SetDirty(target); 98 | } 99 | } 100 | } 101 | GUILayout.Space(18); 102 | GUILayout.EndHorizontal(); 103 | } 104 | } 105 | 106 | EditorGUILayout.PropertyField(script); 107 | EditorGUILayout.PropertyField(wireframe); 108 | 109 | serializedObject.ApplyModifiedProperties(); 110 | } 111 | 112 | public static void ExportPackage() 113 | { 114 | AssetDatabase.ExportPackage(new string[] { 115 | "Assets/SteamVR", 116 | "Assets/Plugins/openvr_api.cs", 117 | "Assets/Plugins/openvr_api.bundle", 118 | "Assets/Plugins/x86/openvr_api.dll", 119 | "Assets/Plugins/x86/steam_api.dll", 120 | "Assets/Plugins/x86/libsteam_api.so", 121 | "Assets/Plugins/x86_64/openvr_api.dll", 122 | "Assets/Plugins/x86_64/steam_api.dll", 123 | "Assets/Plugins/x86_64/libsteam_api.so", 124 | }, "steamvr.unitypackage", ExportPackageOptions.Recurse); 125 | EditorApplication.Exit(0); 126 | } 127 | } 128 | 129 | -------------------------------------------------------------------------------- /Assets/SteamVR/Editor/SteamVR_Editor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ba22c80948c94e44a82b9fd1b3abd0d 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Editor/SteamVR_RenderModelEditor.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2014, Valve Corporation, All rights reserved. =========== 2 | // 3 | // Purpose: Custom inspector display for SteamVR_RenderModel 4 | // 5 | //============================================================================= 6 | 7 | using UnityEngine; 8 | using UnityEditor; 9 | using System.Text; 10 | using System.Collections.Generic; 11 | using Valve.VR; 12 | 13 | [CustomEditor(typeof(SteamVR_RenderModel)), CanEditMultipleObjects] 14 | public class SteamVR_RenderModelEditor : Editor 15 | { 16 | SerializedProperty script, index, modelOverride, shader, verbose, createComponents, updateDynamically; 17 | 18 | static string[] renderModelNames; 19 | int renderModelIndex; 20 | 21 | void OnEnable() 22 | { 23 | script = serializedObject.FindProperty("m_Script"); 24 | index = serializedObject.FindProperty("index"); 25 | modelOverride = serializedObject.FindProperty("modelOverride"); 26 | shader = serializedObject.FindProperty("shader"); 27 | verbose = serializedObject.FindProperty("verbose"); 28 | createComponents = serializedObject.FindProperty("createComponents"); 29 | updateDynamically = serializedObject.FindProperty("updateDynamically"); 30 | 31 | // Load render model names if necessary. 32 | if (renderModelNames == null) 33 | { 34 | renderModelNames = LoadRenderModelNames(); 35 | } 36 | 37 | // Update renderModelIndex based on current modelOverride value. 38 | if (modelOverride.stringValue != "") 39 | { 40 | for (int i = 0; i < renderModelNames.Length; i++) 41 | { 42 | if (modelOverride.stringValue == renderModelNames[i]) 43 | { 44 | renderModelIndex = i; 45 | break; 46 | } 47 | } 48 | } 49 | } 50 | 51 | static string[] LoadRenderModelNames() 52 | { 53 | var results = new List(); 54 | results.Add("None"); 55 | 56 | using (var holder = new SteamVR_RenderModel.RenderModelInterfaceHolder()) 57 | { 58 | var renderModels = holder.instance; 59 | if (renderModels != null) 60 | { 61 | uint count = renderModels.GetRenderModelCount(); 62 | for (uint i = 0; i < count; i++) 63 | { 64 | var buffer = new StringBuilder(); 65 | var requiredSize = renderModels.GetRenderModelName(i, buffer, 0); 66 | if (requiredSize == 0) 67 | continue; 68 | 69 | buffer.EnsureCapacity((int)requiredSize); 70 | renderModels.GetRenderModelName(i, buffer, requiredSize); 71 | results.Add(buffer.ToString()); 72 | } 73 | } 74 | } 75 | 76 | return results.ToArray(); 77 | } 78 | 79 | public override void OnInspectorGUI() 80 | { 81 | serializedObject.Update(); 82 | 83 | EditorGUILayout.PropertyField(script); 84 | EditorGUILayout.PropertyField(index); 85 | //EditorGUILayout.PropertyField(modelOverride); 86 | 87 | GUILayout.BeginHorizontal(); 88 | GUILayout.Label("Model Override"); 89 | var selected = EditorGUILayout.Popup(renderModelIndex, renderModelNames); 90 | if (selected != renderModelIndex) 91 | { 92 | renderModelIndex = selected; 93 | modelOverride.stringValue = (selected > 0) ? renderModelNames[selected] : ""; 94 | } 95 | GUILayout.EndHorizontal(); 96 | 97 | EditorGUILayout.PropertyField(shader); 98 | EditorGUILayout.PropertyField(verbose); 99 | EditorGUILayout.PropertyField(createComponents); 100 | EditorGUILayout.PropertyField(updateDynamically); 101 | 102 | serializedObject.ApplyModifiedProperties(); 103 | } 104 | } 105 | 106 | -------------------------------------------------------------------------------- /Assets/SteamVR/Editor/SteamVR_RenderModelEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 67867a20919f7db45a2e7034fda1c28e 3 | timeCreated: 1433373945 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Editor/SteamVR_Settings.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2244eee8a3a4784fb40d1123ff69301 3 | timeCreated: 1438809573 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Editor/SteamVR_SkyboxEditor.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2014, Valve Corporation, All rights reserved. =========== 2 | // 3 | // Purpose: Custom inspector display for SteamVR_Skybox 4 | // 5 | //============================================================================= 6 | 7 | using UnityEngine; 8 | using UnityEditor; 9 | using System.Text; 10 | using System.Collections.Generic; 11 | using Valve.VR; 12 | using System.IO; 13 | 14 | [CustomEditor(typeof(SteamVR_Skybox)), CanEditMultipleObjects] 15 | public class SteamVR_SkyboxEditor : Editor 16 | { 17 | private const string nameFormat = "{0}/{1}-{2}.png"; 18 | private const string helpText = "Take snapshot will use the current " + 19 | "position and rotation to capture six directional screenshots to use as this " + 20 | "skybox's textures. Note: This skybox is only used to override what shows up " + 21 | "in the compositor (e.g. when loading levels). Add a Camera component to this " + 22 | "object to override default settings like which layers to render. Additionally, " + 23 | "by specifying your own targetTexture, you can control the size of the textures " + 24 | "and other properties like antialiasing. Don't forget to disable the camera."; 25 | 26 | public override void OnInspectorGUI() 27 | { 28 | DrawDefaultInspector(); 29 | #if !(UNITY_5_0 || UNITY_5_1) 30 | EditorGUILayout.HelpBox(helpText, MessageType.Info); 31 | 32 | if (GUILayout.Button("Take snapshot")) 33 | { 34 | #if (UNITY_5_2) 35 | var sceneName = Path.GetFileNameWithoutExtension(EditorApplication.currentScene); 36 | var scenePath = Path.GetDirectoryName(EditorApplication.currentScene); 37 | var assetPath = scenePath +"/" + sceneName; 38 | if (!AssetDatabase.IsValidFolder(assetPath)) 39 | { 40 | var guid = AssetDatabase.CreateFolder(scenePath, sceneName); 41 | assetPath = AssetDatabase.GUIDToAssetPath(guid); 42 | } 43 | #endif 44 | var directions = new Quaternion[] { 45 | Quaternion.LookRotation(Vector3.forward), 46 | Quaternion.LookRotation(Vector3.back), 47 | Quaternion.LookRotation(Vector3.left), 48 | Quaternion.LookRotation(Vector3.right), 49 | Quaternion.LookRotation(Vector3.up, Vector3.back), 50 | Quaternion.LookRotation(Vector3.down, Vector3.forward) 51 | }; 52 | 53 | Camera tempCamera = null; 54 | foreach (SteamVR_Skybox target in targets) 55 | { 56 | #if !(UNITY_5_2) 57 | var targetScene = target.gameObject.scene; 58 | var sceneName = Path.GetFileNameWithoutExtension(targetScene.name); 59 | var scenePath = Path.GetDirectoryName(targetScene.name); 60 | var assetPath = scenePath + "/" + sceneName; 61 | if (!AssetDatabase.IsValidFolder(assetPath)) 62 | { 63 | var guid = AssetDatabase.CreateFolder(scenePath, sceneName); 64 | assetPath = AssetDatabase.GUIDToAssetPath(guid); 65 | } 66 | #endif 67 | var camera = target.GetComponent(); 68 | if (camera == null) 69 | { 70 | if (tempCamera == null) 71 | tempCamera = new GameObject().AddComponent(); 72 | camera = tempCamera; 73 | } 74 | 75 | var targetTexture = camera.targetTexture; 76 | if (camera.targetTexture == null) 77 | { 78 | targetTexture = new RenderTexture(1024, 1024, 24); 79 | targetTexture.antiAliasing = 8; 80 | camera.targetTexture = targetTexture; 81 | } 82 | 83 | var oldPosition = target.transform.localPosition; 84 | var oldRotation = target.transform.localRotation; 85 | var baseRotation = target.transform.rotation; 86 | 87 | var t = camera.transform; 88 | t.position = target.transform.position; 89 | camera.orthographic = false; 90 | camera.fieldOfView = 90; 91 | 92 | for (int i = 0; i < directions.Length; i++) 93 | { 94 | t.rotation = baseRotation * directions[i]; 95 | camera.Render(); 96 | 97 | // Copy to texture and save to disk. 98 | RenderTexture.active = targetTexture; 99 | var texture = new Texture2D(targetTexture.width, targetTexture.height, TextureFormat.ARGB32, false); 100 | texture.ReadPixels(new Rect(0, 0, texture.width, texture.height), 0, 0); 101 | texture.Apply(); 102 | RenderTexture.active = null; 103 | 104 | var assetName = string.Format(nameFormat, assetPath, target.name, i); 105 | System.IO.File.WriteAllBytes(assetName, texture.EncodeToPNG()); 106 | } 107 | 108 | if (camera != tempCamera) 109 | { 110 | target.transform.localPosition = oldPosition; 111 | target.transform.localRotation = oldRotation; 112 | } 113 | } 114 | 115 | if (tempCamera != null) 116 | { 117 | Object.DestroyImmediate(tempCamera.gameObject); 118 | } 119 | 120 | // Now that everything has be written out, reload the associated assets and assign them. 121 | AssetDatabase.Refresh(); 122 | foreach (SteamVR_Skybox target in targets) 123 | { 124 | #if !(UNITY_5_2) 125 | var targetScene = target.gameObject.scene; 126 | var sceneName = Path.GetFileNameWithoutExtension(targetScene.name); 127 | var scenePath = Path.GetDirectoryName(targetScene.name); 128 | var assetPath = scenePath + "/" + sceneName; 129 | #endif 130 | for (int i = 0; i < directions.Length; i++) 131 | { 132 | var assetName = string.Format(nameFormat, assetPath, target.name, i); 133 | var importer = AssetImporter.GetAtPath(assetName) as TextureImporter; 134 | importer.textureFormat = TextureImporterFormat.ARGB32; 135 | importer.wrapMode = TextureWrapMode.Clamp; 136 | importer.SaveAndReimport(); 137 | 138 | var texture = AssetDatabase.LoadAssetAtPath(assetName); 139 | target.SetTextureByIndex(i, texture); 140 | } 141 | } 142 | } 143 | #endif 144 | } 145 | } 146 | 147 | -------------------------------------------------------------------------------- /Assets/SteamVR/Editor/SteamVR_SkyboxEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 80087fbbf7bf93a46bb4aea276b19568 3 | timeCreated: 1446765449 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Editor/SteamVR_Update.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2015, Valve Corporation, All rights reserved. =========== 2 | // 3 | // Purpose: Notify developers when a new version of the plugin is available. 4 | // 5 | //============================================================================= 6 | 7 | using UnityEngine; 8 | using UnityEditor; 9 | using System.IO; 10 | using System.Text.RegularExpressions; 11 | 12 | [InitializeOnLoad] 13 | public class SteamVR_Update : EditorWindow 14 | { 15 | const string currentVersion = "1.0.8"; 16 | const string versionUrl = "http://media.steampowered.com/apps/steamvr/unitypluginversion.txt"; 17 | const string notesUrl = "http://media.steampowered.com/apps/steamvr/unityplugin-v{0}.txt"; 18 | const string pluginUrl = "http://u3d.as/content/valve-corporation/steam-vr-plugin"; 19 | const string doNotShowKey = "SteamVR.DoNotShow.v{0}"; 20 | 21 | static WWW wwwVersion, wwwNotes; 22 | static string version, notes; 23 | static SteamVR_Update window; 24 | 25 | static SteamVR_Update() 26 | { 27 | wwwVersion = new WWW(versionUrl); 28 | EditorApplication.update += Update; 29 | } 30 | 31 | static void Update() 32 | { 33 | if (wwwVersion != null) 34 | { 35 | if (!wwwVersion.isDone) 36 | return; 37 | 38 | if (UrlSuccess(wwwVersion)) 39 | version = wwwVersion.text; 40 | 41 | wwwVersion = null; 42 | 43 | if (ShouldDisplay()) 44 | { 45 | var url = string.Format(notesUrl, version); 46 | wwwNotes = new WWW(url); 47 | 48 | window = GetWindow(true); 49 | window.minSize = new Vector2(320, 440); 50 | //window.title = "SteamVR"; 51 | } 52 | } 53 | 54 | if (wwwNotes != null) 55 | { 56 | if (!wwwNotes.isDone) 57 | return; 58 | 59 | if (UrlSuccess(wwwNotes)) 60 | notes = wwwNotes.text; 61 | 62 | wwwNotes = null; 63 | 64 | if (notes != "") 65 | window.Repaint(); 66 | } 67 | 68 | EditorApplication.update -= Update; 69 | } 70 | 71 | static bool UrlSuccess(WWW www) 72 | { 73 | if (!string.IsNullOrEmpty(www.error)) 74 | return false; 75 | if (Regex.IsMatch(www.text, "404 not found", RegexOptions.IgnoreCase)) 76 | return false; 77 | return true; 78 | } 79 | 80 | static bool ShouldDisplay() 81 | { 82 | if (string.IsNullOrEmpty(version)) 83 | return false; 84 | if (version == currentVersion) 85 | return false; 86 | if (EditorPrefs.HasKey(string.Format(doNotShowKey, version))) 87 | return false; 88 | 89 | // parse to see if newer (e.g. 1.0.4 vs 1.0.3) 90 | var versionSplit = version.Split('.'); 91 | var currentVersionSplit = currentVersion.Split('.'); 92 | for (int i = 0; i < versionSplit.Length && i < currentVersionSplit.Length; i++) 93 | { 94 | int versionValue, currentVersionValue; 95 | if (int.TryParse(versionSplit[i], out versionValue) && 96 | int.TryParse(currentVersionSplit[i], out currentVersionValue)) 97 | { 98 | if (versionValue > currentVersionValue) 99 | return true; 100 | if (versionValue < currentVersionValue) 101 | return false; 102 | } 103 | } 104 | 105 | // same up to this point, now differentiate based on number of sub values (e.g. 1.0.4.1 vs 1.0.4) 106 | if (versionSplit.Length <= currentVersionSplit.Length) 107 | return false; 108 | 109 | return true; 110 | } 111 | 112 | Vector2 scrollPosition; 113 | bool toggleState; 114 | 115 | string GetResourcePath() 116 | { 117 | var ms = MonoScript.FromScriptableObject(this); 118 | var path = AssetDatabase.GetAssetPath(ms); 119 | path = Path.GetDirectoryName(path); 120 | return path.Substring(0, path.Length - "Editor".Length) + "Textures/"; 121 | } 122 | 123 | public void OnGUI() 124 | { 125 | EditorGUILayout.HelpBox("A new version of the SteamVR plugin is available!", MessageType.Warning); 126 | 127 | var resourcePath = GetResourcePath(); 128 | #if UNITY_5_0 129 | var logo = Resources.LoadAssetAtPath(resourcePath + "logo.png"); 130 | #else 131 | var logo = AssetDatabase.LoadAssetAtPath(resourcePath + "logo.png"); 132 | #endif 133 | var rect = GUILayoutUtility.GetRect(position.width, 150, GUI.skin.box); 134 | if (logo) 135 | GUI.DrawTexture(rect, logo, ScaleMode.ScaleToFit); 136 | 137 | scrollPosition = GUILayout.BeginScrollView(scrollPosition); 138 | 139 | GUILayout.Label("Current version: " + currentVersion); 140 | GUILayout.Label("New version: " + version); 141 | 142 | if (notes != "") 143 | { 144 | GUILayout.Label("Release notes:"); 145 | EditorGUILayout.HelpBox(notes, MessageType.Info); 146 | } 147 | 148 | GUILayout.EndScrollView(); 149 | 150 | GUILayout.FlexibleSpace(); 151 | 152 | if (GUILayout.Button("Get Latest Version")) 153 | { 154 | Application.OpenURL(pluginUrl); 155 | } 156 | 157 | EditorGUI.BeginChangeCheck(); 158 | var doNotShow = GUILayout.Toggle(toggleState, "Do not prompt for this version again."); 159 | if (EditorGUI.EndChangeCheck()) 160 | { 161 | toggleState = doNotShow; 162 | var key = string.Format(doNotShowKey, version); 163 | if (doNotShow) 164 | EditorPrefs.SetBool(key, true); 165 | else 166 | EditorPrefs.DeleteKey(key); 167 | } 168 | } 169 | } 170 | 171 | -------------------------------------------------------------------------------- /Assets/SteamVR/Editor/SteamVR_Update.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 73a0556bda803bf4e898751dcfcf21a8 3 | timeCreated: 1433880062 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Extras.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b81bf19ba1ca4c34593876a38c36a2d6 3 | folderAsset: yes 4 | timeCreated: 1458326221 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Extras/SteamVR_GazeTracker.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public struct GazeEventArgs 5 | { 6 | public float distance; 7 | } 8 | 9 | public delegate void GazeEventHandler(object sender, GazeEventArgs e); 10 | 11 | public class SteamVR_GazeTracker : MonoBehaviour 12 | { 13 | public bool isInGaze = false; 14 | public event GazeEventHandler GazeOn; 15 | public event GazeEventHandler GazeOff; 16 | public float gazeInCutoff = 0.15f; 17 | public float gazeOutCutoff = 0.4f; 18 | 19 | // Contains a HMD tracked object that we can use to find the user's gaze 20 | Transform hmdTrackedObject = null; 21 | 22 | // Use this for initialization 23 | void Start () 24 | { 25 | 26 | } 27 | 28 | public virtual void OnGazeOn(GazeEventArgs e) 29 | { 30 | if (GazeOn != null) 31 | GazeOn(this, e); 32 | } 33 | 34 | public virtual void OnGazeOff(GazeEventArgs e) 35 | { 36 | if (GazeOff != null) 37 | GazeOff(this, e); 38 | } 39 | 40 | // Update is called once per frame 41 | void Update () 42 | { 43 | // If we haven't set up hmdTrackedObject find what the user is looking at 44 | if (hmdTrackedObject == null) 45 | { 46 | SteamVR_TrackedObject[] trackedObjects = FindObjectsOfType(); 47 | foreach (SteamVR_TrackedObject tracked in trackedObjects) 48 | { 49 | if (tracked.index == SteamVR_TrackedObject.EIndex.Hmd) 50 | { 51 | hmdTrackedObject = tracked.transform; 52 | break; 53 | } 54 | } 55 | } 56 | 57 | if (hmdTrackedObject) 58 | { 59 | Ray r = new Ray(hmdTrackedObject.position, hmdTrackedObject.forward); 60 | Plane p = new Plane(hmdTrackedObject.forward, transform.position); 61 | 62 | float enter = 0.0f; 63 | if (p.Raycast(r, out enter)) 64 | { 65 | Vector3 intersect = hmdTrackedObject.position + hmdTrackedObject.forward * enter; 66 | float dist = Vector3.Distance(intersect, transform.position); 67 | //Debug.Log("Gaze dist = " + dist); 68 | if (dist < gazeInCutoff && !isInGaze) 69 | { 70 | isInGaze = true; 71 | GazeEventArgs e; 72 | e.distance = dist; 73 | OnGazeOn(e); 74 | } 75 | else if (dist >= gazeOutCutoff && isInGaze) 76 | { 77 | isInGaze = false; 78 | GazeEventArgs e; 79 | e.distance = dist; 80 | OnGazeOff(e); 81 | } 82 | } 83 | 84 | } 85 | 86 | } 87 | } 88 | -------------------------------------------------------------------------------- /Assets/SteamVR/Extras/SteamVR_GazeTracker.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 501eb8b744f73714fbe7dbdd5e3ef66e 3 | timeCreated: 1426193800 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Extras/SteamVR_LaserPointer.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public struct PointerEventArgs 5 | { 6 | public uint controllerIndex; 7 | public uint flags; 8 | public float distance; 9 | public Transform target; 10 | } 11 | 12 | public delegate void PointerEventHandler(object sender, PointerEventArgs e); 13 | 14 | 15 | public class SteamVR_LaserPointer : MonoBehaviour 16 | { 17 | public bool active = true; 18 | public Color color; 19 | public float thickness = 0.002f; 20 | public GameObject holder; 21 | public GameObject pointer; 22 | bool isActive = false; 23 | public bool addRigidBody = false; 24 | public Transform reference; 25 | public event PointerEventHandler PointerIn; 26 | public event PointerEventHandler PointerOut; 27 | 28 | Transform previousContact = null; 29 | 30 | // Use this for initialization 31 | void Start () 32 | { 33 | holder = new GameObject(); 34 | holder.transform.parent = this.transform; 35 | holder.transform.localPosition = Vector3.zero; 36 | 37 | pointer = GameObject.CreatePrimitive(PrimitiveType.Cube); 38 | pointer.transform.parent = holder.transform; 39 | pointer.transform.localScale = new Vector3(thickness, thickness, 100f); 40 | pointer.transform.localPosition = new Vector3(0f, 0f, 50f); 41 | BoxCollider collider = pointer.GetComponent(); 42 | if (addRigidBody) 43 | { 44 | if (collider) 45 | { 46 | collider.isTrigger = true; 47 | } 48 | Rigidbody rigidBody = pointer.AddComponent(); 49 | rigidBody.isKinematic = true; 50 | } 51 | else 52 | { 53 | if(collider) 54 | { 55 | Object.Destroy(collider); 56 | } 57 | } 58 | Material newMaterial = new Material(Shader.Find("Unlit/Color")); 59 | newMaterial.SetColor("_Color", color); 60 | pointer.GetComponent().material = newMaterial; 61 | } 62 | 63 | public virtual void OnPointerIn(PointerEventArgs e) 64 | { 65 | if (PointerIn != null) 66 | PointerIn(this, e); 67 | } 68 | 69 | public virtual void OnPointerOut(PointerEventArgs e) 70 | { 71 | if (PointerOut != null) 72 | PointerOut(this, e); 73 | } 74 | 75 | 76 | // Update is called once per frame 77 | void Update () 78 | { 79 | if (!isActive) 80 | { 81 | isActive = true; 82 | this.transform.GetChild(0).gameObject.SetActive(true); 83 | } 84 | 85 | float dist = 100f; 86 | 87 | SteamVR_TrackedController controller = GetComponent(); 88 | 89 | Ray raycast = new Ray(transform.position, transform.forward); 90 | RaycastHit hit; 91 | bool bHit = Physics.Raycast(raycast, out hit); 92 | 93 | if(previousContact && previousContact != hit.transform) 94 | { 95 | PointerEventArgs args = new PointerEventArgs(); 96 | if (controller != null) 97 | { 98 | args.controllerIndex = controller.controllerIndex; 99 | } 100 | args.distance = 0f; 101 | args.flags = 0; 102 | args.target = previousContact; 103 | OnPointerOut(args); 104 | previousContact = null; 105 | } 106 | if(bHit && previousContact != hit.transform) 107 | { 108 | PointerEventArgs argsIn = new PointerEventArgs(); 109 | if (controller != null) 110 | { 111 | argsIn.controllerIndex = controller.controllerIndex; 112 | } 113 | argsIn.distance = hit.distance; 114 | argsIn.flags = 0; 115 | argsIn.target = hit.transform; 116 | OnPointerIn(argsIn); 117 | previousContact = hit.transform; 118 | } 119 | if(!bHit) 120 | { 121 | previousContact = null; 122 | } 123 | if (bHit && hit.distance < 100f) 124 | { 125 | dist = hit.distance; 126 | } 127 | 128 | if (controller != null && controller.triggerPressed) 129 | { 130 | pointer.transform.localScale = new Vector3(thickness * 5f, thickness * 5f, dist); 131 | } 132 | else 133 | { 134 | pointer.transform.localScale = new Vector3(thickness, thickness, dist); 135 | } 136 | pointer.transform.localPosition = new Vector3(0f, 0f, dist/2f); 137 | } 138 | } 139 | -------------------------------------------------------------------------------- /Assets/SteamVR/Extras/SteamVR_LaserPointer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d4e8a839a7c5b7e4580c59e305fb5f01 3 | timeCreated: 1430337756 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Extras/SteamVR_Teleporter.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | public class SteamVR_Teleporter : MonoBehaviour 5 | { 6 | public enum TeleportType 7 | { 8 | TeleportTypeUseTerrain, 9 | TeleportTypeUseCollider, 10 | TeleportTypeUseZeroY 11 | } 12 | 13 | public bool teleportOnClick = false; 14 | public TeleportType teleportType = TeleportType.TeleportTypeUseZeroY; 15 | Transform reference; 16 | 17 | // Use this for initialization 18 | void Start () 19 | { 20 | Transform eyeCamera = GameObject.FindObjectOfType().GetComponent(); 21 | // The referece point for the camera is two levels up from the SteamVR_Camera 22 | reference = eyeCamera.parent.parent; 23 | 24 | if (GetComponent() == null) 25 | { 26 | Debug.LogError("SteamVR_Teleporter must be on a SteamVR_TrackedController"); 27 | return; 28 | } 29 | GetComponent().TriggerClicked += new ClickedEventHandler(DoClick); 30 | 31 | if (teleportType == TeleportType.TeleportTypeUseTerrain) 32 | { 33 | // Start the player at the level of the terrain 34 | reference.position = new Vector3(reference.position.x, Terrain.activeTerrain.SampleHeight(reference.position), reference.position.z); 35 | } 36 | } 37 | 38 | // Update is called once per frame 39 | void Update () 40 | { 41 | 42 | } 43 | 44 | void DoClick(object sender, ClickedEventArgs e) 45 | { 46 | if (teleportOnClick) 47 | { 48 | // Teleport 49 | float refY = reference.position.y; 50 | 51 | Plane plane = new Plane(Vector3.up, -refY); 52 | Ray ray = new Ray(this.transform.position, transform.forward); 53 | 54 | bool hasGroundTarget = false; 55 | float dist = 0f; 56 | if (teleportType == TeleportType.TeleportTypeUseCollider) 57 | { 58 | RaycastHit hitInfo; 59 | TerrainCollider tc = Terrain.activeTerrain.GetComponent(); 60 | hasGroundTarget = tc.Raycast(ray, out hitInfo, 1000f); 61 | dist = hitInfo.distance; 62 | } 63 | else if (teleportType == TeleportType.TeleportTypeUseCollider) 64 | { 65 | RaycastHit hitInfo; 66 | Physics.Raycast(ray, out hitInfo); 67 | dist = hitInfo.distance; 68 | } 69 | else 70 | { 71 | hasGroundTarget = plane.Raycast(ray, out dist); 72 | } 73 | if (hasGroundTarget) 74 | { 75 | Vector3 newPos = ray.origin + ray.direction * dist - new Vector3(reference.GetChild(0).localPosition.x, 0f, reference.GetChild(0).localPosition.z); 76 | 77 | reference.position = newPos; 78 | } 79 | } 80 | } 81 | } 82 | -------------------------------------------------------------------------------- /Assets/SteamVR/Extras/SteamVR_Teleporter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24c7d7d77dd0d2a4b8e1ad129b170ee3 3 | timeCreated: 1430337756 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Extras/SteamVR_TestIK.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4b6669fb4e4df9c48926f02b694be9d1 3 | timeCreated: 1437433018 4 | licenseType: Store 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SteamVR/Extras/SteamVR_TestThrow.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using System.Collections; 3 | 4 | [RequireComponent(typeof(SteamVR_TrackedObject))] 5 | public class SteamVR_TestThrow : MonoBehaviour 6 | { 7 | public GameObject prefab; 8 | public Rigidbody attachPoint; 9 | 10 | SteamVR_TrackedObject trackedObj; 11 | FixedJoint joint; 12 | 13 | void Awake() 14 | { 15 | trackedObj = GetComponent(); 16 | } 17 | 18 | void FixedUpdate() 19 | { 20 | var device = SteamVR_Controller.Input((int)trackedObj.index); 21 | if (joint == null && device.GetTouchDown(SteamVR_Controller.ButtonMask.Trigger)) 22 | { 23 | var go = GameObject.Instantiate(prefab); 24 | go.transform.position = attachPoint.transform.position; 25 | 26 | joint = go.AddComponent(); 27 | joint.connectedBody = attachPoint; 28 | } 29 | else if (joint != null && device.GetTouchUp(SteamVR_Controller.ButtonMask.Trigger)) 30 | { 31 | var go = joint.gameObject; 32 | var rigidbody = go.GetComponent(); 33 | Object.DestroyImmediate(joint); 34 | joint = null; 35 | Object.Destroy(go, 15.0f); 36 | 37 | // We should probably apply the offset between trackedObj.transform.position 38 | // and device.transform.pos to insert into the physics sim at the correct 39 | // location, however, we would then want to predict ahead the visual representation 40 | // by the same amount we are predicting our render poses. 41 | 42 | var origin = trackedObj.origin ? trackedObj.origin : trackedObj.transform.parent; 43 | if (origin != null) 44 | { 45 | rigidbody.velocity = origin.TransformVector(device.velocity); 46 | rigidbody.angularVelocity = origin.TransformVector(device.angularVelocity); 47 | } 48 | else 49 | { 50 | rigidbody.velocity = device.velocity; 51 | rigidbody.angularVelocity = device.angularVelocity; 52 | } 53 | 54 | rigidbody.maxAngularVelocity = rigidbody.angularVelocity.magnitude; 55 | } 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /Assets/SteamVR/Extras/SteamVR_TestThrow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ff4f36585e15b1942827390ff1a92502 3 | timeCreated: 1437513988 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Extras/SteamVR_TestThrow.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d936163b5e9a5047b5e4ba5afaf5126 3 | timeCreated: 1437513966 4 | licenseType: Store 5 | DefaultImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SteamVR/Extras/SteamVR_TrackedController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7346a42905a29b347b1f492e8ad7b49f 3 | timeCreated: 1430337756 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c5565f8e7ca2d8438a43cc5d3b31c23 3 | folderAsset: yes 4 | timeCreated: 1458326221 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Materials/portalworkshop.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 3 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: portalworkshop 10 | m_Shader: {fileID: 10752, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: [] 12 | m_CustomRenderQueue: -1 13 | m_SavedProperties: 14 | serializedVersion: 2 15 | m_TexEnvs: 16 | data: 17 | first: 18 | name: _MainTex 19 | second: 20 | m_Texture: {fileID: 2800000, guid: a57cd5c56c9d75c4ba0ee9fbc6e1d8df, type: 3} 21 | m_Scale: {x: 1, y: 1} 22 | m_Offset: {x: 0, y: 0} 23 | m_Floats: {} 24 | m_Colors: {} 25 | -------------------------------------------------------------------------------- /Assets/SteamVR/Materials/portalworkshop.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 712cd3a70a5a1da41a6594aac6a97abe 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/SteamVR/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ca427116464e67643937fb31c39da43a 3 | folderAsset: yes 4 | timeCreated: 1458326221 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Prefabs/[CameraRig].prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4d293c8e162f3874b982baadd71153d2 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/SteamVR/Prefabs/[Status].prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 255333d57084e4e46b3d948279746a47 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/SteamVR/Prefabs/[SteamVR].prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &132594 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 458990} 11 | - 114: {fileID: 11432822} 12 | m_Layer: 0 13 | m_Name: '[SteamVR]' 14 | m_TagString: Untagged 15 | m_Icon: {fileID: 0} 16 | m_NavMeshLayer: 0 17 | m_StaticEditorFlags: 0 18 | m_IsActive: 1 19 | --- !u!4 &458990 20 | Transform: 21 | m_ObjectHideFlags: 1 22 | m_PrefabParentObject: {fileID: 0} 23 | m_PrefabInternal: {fileID: 100100000} 24 | m_GameObject: {fileID: 132594} 25 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 26 | m_LocalPosition: {x: 0, y: 0, z: 0} 27 | m_LocalScale: {x: 1, y: 1, z: 1} 28 | m_Children: [] 29 | m_Father: {fileID: 0} 30 | m_RootOrder: 0 31 | --- !u!114 &11432822 32 | MonoBehaviour: 33 | m_ObjectHideFlags: 1 34 | m_PrefabParentObject: {fileID: 0} 35 | m_PrefabInternal: {fileID: 100100000} 36 | m_GameObject: {fileID: 132594} 37 | m_Enabled: 1 38 | m_EditorHideFlags: 0 39 | m_Script: {fileID: 11500000, guid: e979227f3384fac4b8ca0b3550bf005c, type: 3} 40 | m_Name: 41 | m_EditorClassIdentifier: 42 | helpSeconds: 10 43 | helpText: You may now put on your headset. 44 | helpStyle: 45 | m_Name: 46 | m_Normal: 47 | m_Background: {fileID: 0} 48 | m_TextColor: {r: 0, g: 0, b: 0, a: 1} 49 | m_Hover: 50 | m_Background: {fileID: 0} 51 | m_TextColor: {r: 0, g: 0, b: 0, a: 1} 52 | m_Active: 53 | m_Background: {fileID: 0} 54 | m_TextColor: {r: 0, g: 0, b: 0, a: 1} 55 | m_Focused: 56 | m_Background: {fileID: 0} 57 | m_TextColor: {r: 0, g: 0, b: 0, a: 1} 58 | m_OnNormal: 59 | m_Background: {fileID: 0} 60 | m_TextColor: {r: 0, g: 0, b: 0, a: 1} 61 | m_OnHover: 62 | m_Background: {fileID: 0} 63 | m_TextColor: {r: 0, g: 0, b: 0, a: 1} 64 | m_OnActive: 65 | m_Background: {fileID: 0} 66 | m_TextColor: {r: 0, g: 0, b: 0, a: 1} 67 | m_OnFocused: 68 | m_Background: {fileID: 0} 69 | m_TextColor: {r: 0, g: 0, b: 0, a: 1} 70 | m_Border: 71 | m_Left: 0 72 | m_Right: 0 73 | m_Top: 0 74 | m_Bottom: 0 75 | m_Margin: 76 | m_Left: 0 77 | m_Right: 0 78 | m_Top: 0 79 | m_Bottom: 0 80 | m_Padding: 81 | m_Left: 0 82 | m_Right: 0 83 | m_Top: 0 84 | m_Bottom: 0 85 | m_Overflow: 86 | m_Left: 0 87 | m_Right: 0 88 | m_Top: 0 89 | m_Bottom: 0 90 | m_Font: {fileID: 0} 91 | m_FontSize: 0 92 | m_FontStyle: 0 93 | m_Alignment: 0 94 | m_WordWrap: 0 95 | m_RichText: 1 96 | m_TextClipping: 0 97 | m_ImagePosition: 0 98 | m_ContentOffset: {x: 0, y: 0} 99 | m_FixedWidth: 0 100 | m_FixedHeight: 0 101 | m_StretchWidth: 1 102 | m_StretchHeight: 0 103 | leftMask: 104 | serializedVersion: 2 105 | m_Bits: 0 106 | rightMask: 107 | serializedVersion: 2 108 | m_Bits: 0 109 | trackingSpace: 1 110 | --- !u!1001 &100100000 111 | Prefab: 112 | m_ObjectHideFlags: 1 113 | serializedVersion: 2 114 | m_Modification: 115 | m_TransformParent: {fileID: 0} 116 | m_Modifications: [] 117 | m_RemovedComponents: [] 118 | m_ParentPrefab: {fileID: 0} 119 | m_RootGameObject: {fileID: 132594} 120 | m_IsPrefabParent: 1 121 | -------------------------------------------------------------------------------- /Assets/SteamVR/Prefabs/[SteamVR].prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4f35fa249b5008c44ac2998be6f82d4d 3 | timeCreated: 1429757514 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SteamVR/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57a4b64a784f8d143bb843e06566bc08 3 | folderAsset: yes 4 | timeCreated: 1458326221 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Resources/SteamVR_AlphaOut.shader: -------------------------------------------------------------------------------- 1 | Shader "Custom/SteamVR_AlphaOut" { 2 | Properties { _MainTex ("Base (RGB)", 2D) = "white" {} } 3 | 4 | CGINCLUDE 5 | 6 | #include "UnityCG.cginc" 7 | 8 | sampler2D _MainTex; 9 | 10 | struct v2f { 11 | float4 pos : SV_POSITION; 12 | float2 tex : TEXCOORD0; 13 | }; 14 | 15 | v2f vert(appdata_base v) { 16 | v2f o; 17 | o.pos = mul(UNITY_MATRIX_MVP, v.vertex); 18 | o.tex = v.texcoord; 19 | return o; 20 | } 21 | 22 | float luminance(float3 color) 23 | { 24 | return 0.2126 * color.r + 0.7152 * color.g + 0.0722 * color.b; 25 | } 26 | 27 | float4 frag(v2f i) : COLOR { 28 | float4 color = tex2D(_MainTex, i.tex); 29 | float a = saturate(color.a + luminance(color.rgb)); 30 | return float4(a, a, a, a); 31 | } 32 | 33 | ENDCG 34 | 35 | SubShader { 36 | Pass { 37 | ZTest Always Cull Off ZWrite Off 38 | Fog { Mode Off } 39 | 40 | CGPROGRAM 41 | #pragma vertex vert 42 | #pragma fragment frag 43 | ENDCG 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /Assets/SteamVR/Resources/SteamVR_AlphaOut.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da25bb0dccfd3894181fc5e84714cd17 3 | timeCreated: 1456189850 4 | licenseType: Store 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Resources/SteamVR_Blit.shader: -------------------------------------------------------------------------------- 1 | Shader "Custom/SteamVR_Blit" { 2 | Properties { _MainTex ("Base (RGB)", 2D) = "white" {} } 3 | 4 | CGINCLUDE 5 | 6 | #include "UnityCG.cginc" 7 | 8 | sampler2D _MainTex; 9 | 10 | struct v2f { 11 | float4 pos : SV_POSITION; 12 | float2 tex : TEXCOORD0; 13 | }; 14 | 15 | v2f vert(appdata_base v) { 16 | v2f o; 17 | o.pos = v.vertex; 18 | o.tex = v.texcoord; 19 | return o; 20 | } 21 | 22 | float4 frag(v2f i) : COLOR { 23 | return tex2D(_MainTex, i.tex); 24 | } 25 | 26 | float4 frag_linear(v2f i) : COLOR { 27 | return pow(tex2D(_MainTex, i.tex), 1.0 / 2.2); 28 | } 29 | 30 | ENDCG 31 | 32 | SubShader { 33 | Pass { 34 | ZTest Always Cull Off ZWrite Off 35 | Fog { Mode Off } 36 | 37 | CGPROGRAM 38 | #pragma vertex vert 39 | #pragma fragment frag 40 | ENDCG 41 | } 42 | Pass { 43 | ZTest Always Cull Off ZWrite Off 44 | Fog { Mode Off } 45 | 46 | CGPROGRAM 47 | #pragma vertex vert 48 | #pragma fragment frag_linear 49 | ENDCG 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /Assets/SteamVR/Resources/SteamVR_Blit.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6403027b84bd2824dafa520459aa107d 3 | ShaderImporter: 4 | defaultTextures: [] 5 | userData: 6 | assetBundleName: 7 | -------------------------------------------------------------------------------- /Assets/SteamVR/Resources/SteamVR_BlitFlip.shader: -------------------------------------------------------------------------------- 1 | Shader "Custom/SteamVR_BlitFlip" { 2 | Properties { _MainTex ("Base (RGB)", 2D) = "white" {} } 3 | 4 | CGINCLUDE 5 | 6 | #include "UnityCG.cginc" 7 | 8 | sampler2D _MainTex; 9 | 10 | struct v2f { 11 | float4 pos : SV_POSITION; 12 | float2 tex : TEXCOORD0; 13 | }; 14 | 15 | v2f vert(appdata_base v) { 16 | v2f o; 17 | o.pos = mul(UNITY_MATRIX_MVP, v.vertex); 18 | o.tex.x = v.texcoord.x; 19 | o.tex.y = 1 - v.texcoord.y; 20 | return o; 21 | } 22 | 23 | float4 frag(v2f i) : COLOR { 24 | return tex2D(_MainTex, i.tex); 25 | } 26 | 27 | ENDCG 28 | 29 | SubShader { 30 | Pass { 31 | ZTest Always Cull Off ZWrite Off 32 | Fog { Mode Off } 33 | 34 | CGPROGRAM 35 | #pragma vertex vert 36 | #pragma fragment frag 37 | ENDCG 38 | } 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /Assets/SteamVR/Resources/SteamVR_BlitFlip.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2adcf81282c27bc4098ee69d2419bc48 3 | timeCreated: 1430872950 4 | licenseType: Store 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Resources/SteamVR_ClearAll.shader: -------------------------------------------------------------------------------- 1 | Shader "Custom/SteamVR_ClearAll" { 2 | Properties { _MainTex ("Base (RGB)", 2D) = "white" {} } 3 | 4 | CGINCLUDE 5 | 6 | #include "UnityCG.cginc" 7 | 8 | sampler2D _MainTex; 9 | 10 | struct v2f { 11 | float4 pos : SV_POSITION; 12 | float2 tex : TEXCOORD0; 13 | }; 14 | 15 | v2f vert(appdata_base v) { 16 | v2f o; 17 | o.pos = mul(UNITY_MATRIX_MVP, v.vertex); 18 | o.tex = v.texcoord; 19 | return o; 20 | } 21 | 22 | float4 frag(v2f i) : COLOR { 23 | return float4(0, 0, 0, 0); 24 | } 25 | 26 | ENDCG 27 | 28 | SubShader { 29 | Tags{ "Queue" = "Background" } 30 | Pass { 31 | ZTest Always Cull Off ZWrite On 32 | Fog { Mode Off } 33 | 34 | CGPROGRAM 35 | #pragma vertex vert 36 | #pragma fragment frag 37 | ENDCG 38 | } 39 | } 40 | } 41 | 42 | -------------------------------------------------------------------------------- /Assets/SteamVR/Resources/SteamVR_ClearAll.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1eded52540dd0a4988d5d4d76382da9 3 | timeCreated: 1457042024 4 | licenseType: Store 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Resources/SteamVR_ColorOut.shader: -------------------------------------------------------------------------------- 1 | Shader "Custom/SteamVR_ColorOut" { 2 | Properties { _MainTex ("Base (RGB)", 2D) = "white" {} } 3 | 4 | CGINCLUDE 5 | 6 | #include "UnityCG.cginc" 7 | 8 | sampler2D _MainTex; 9 | 10 | struct v2f { 11 | float4 pos : SV_POSITION; 12 | float2 tex : TEXCOORD0; 13 | }; 14 | 15 | v2f vert(appdata_base v) { 16 | v2f o; 17 | o.pos = mul(UNITY_MATRIX_MVP, v.vertex); 18 | o.tex = v.texcoord; 19 | return o; 20 | } 21 | 22 | float luminance(float3 color) 23 | { 24 | return 0.2126 * color.r + 0.7152 * color.g + 0.0722 * color.b; 25 | } 26 | 27 | float4 frag(v2f i) : COLOR { 28 | float4 color = tex2D(_MainTex, i.tex); 29 | return float4(color.rgb, 1); 30 | } 31 | 32 | ENDCG 33 | 34 | SubShader { 35 | Pass { 36 | ZTest Always Cull Off ZWrite Off 37 | Fog { Mode Off } 38 | 39 | CGPROGRAM 40 | #pragma vertex vert 41 | #pragma fragment frag 42 | ENDCG 43 | } 44 | } 45 | } 46 | 47 | -------------------------------------------------------------------------------- /Assets/SteamVR/Resources/SteamVR_ColorOut.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 04d03a6e2ff64bf47911d08912140c31 3 | timeCreated: 1456866489 4 | licenseType: Store 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Resources/SteamVR_ExternalCamera.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &128450 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 100100000} 8 | serializedVersion: 4 9 | m_Component: 10 | - 4: {fileID: 417074} 11 | - 114: {fileID: 11479102} 12 | m_Layer: 0 13 | m_Name: SteamVR_ExternalCamera 14 | m_TagString: Untagged 15 | m_Icon: {fileID: 0} 16 | m_NavMeshLayer: 0 17 | m_StaticEditorFlags: 0 18 | m_IsActive: 1 19 | --- !u!1 &129796 20 | GameObject: 21 | m_ObjectHideFlags: 0 22 | m_PrefabParentObject: {fileID: 0} 23 | m_PrefabInternal: {fileID: 100100000} 24 | serializedVersion: 4 25 | m_Component: 26 | - 4: {fileID: 444732} 27 | - 114: {fileID: 11487396} 28 | - 114: {fileID: 11472986} 29 | m_Layer: 0 30 | m_Name: Controller (third) 31 | m_TagString: Untagged 32 | m_Icon: {fileID: 0} 33 | m_NavMeshLayer: 0 34 | m_StaticEditorFlags: 0 35 | m_IsActive: 1 36 | --- !u!4 &417074 37 | Transform: 38 | m_ObjectHideFlags: 1 39 | m_PrefabParentObject: {fileID: 0} 40 | m_PrefabInternal: {fileID: 100100000} 41 | m_GameObject: {fileID: 128450} 42 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 43 | m_LocalPosition: {x: 0, y: 0, z: 0} 44 | m_LocalScale: {x: 1, y: 1, z: 1} 45 | m_Children: 46 | - {fileID: 444732} 47 | m_Father: {fileID: 0} 48 | m_RootOrder: 0 49 | --- !u!4 &444732 50 | Transform: 51 | m_ObjectHideFlags: 1 52 | m_PrefabParentObject: {fileID: 0} 53 | m_PrefabInternal: {fileID: 100100000} 54 | m_GameObject: {fileID: 129796} 55 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 56 | m_LocalPosition: {x: 0, y: 0, z: 0} 57 | m_LocalScale: {x: 1, y: 1, z: 1} 58 | m_Children: [] 59 | m_Father: {fileID: 417074} 60 | m_RootOrder: 0 61 | --- !u!114 &11472986 62 | MonoBehaviour: 63 | m_ObjectHideFlags: 1 64 | m_PrefabParentObject: {fileID: 0} 65 | m_PrefabInternal: {fileID: 100100000} 66 | m_GameObject: {fileID: 129796} 67 | m_Enabled: 1 68 | m_EditorHideFlags: 0 69 | m_Script: {fileID: 11500000, guid: d37c2cf88f7c59f4c8cf5d3812568143, type: 3} 70 | m_Name: 71 | m_EditorClassIdentifier: 72 | index: -1 73 | origin: {fileID: 0} 74 | isValid: 0 75 | --- !u!114 &11479102 76 | MonoBehaviour: 77 | m_ObjectHideFlags: 1 78 | m_PrefabParentObject: {fileID: 0} 79 | m_PrefabInternal: {fileID: 100100000} 80 | m_GameObject: {fileID: 128450} 81 | m_Enabled: 1 82 | m_EditorHideFlags: 0 83 | m_Script: {fileID: 11500000, guid: e3b47c2980b93bc48844a54641dab5b8, type: 3} 84 | m_Name: 85 | m_EditorClassIdentifier: 86 | left: {fileID: 0} 87 | right: {fileID: 0} 88 | objects: 89 | - {fileID: 129796} 90 | --- !u!114 &11487396 91 | MonoBehaviour: 92 | m_ObjectHideFlags: 1 93 | m_PrefabParentObject: {fileID: 0} 94 | m_PrefabInternal: {fileID: 100100000} 95 | m_GameObject: {fileID: 129796} 96 | m_Enabled: 1 97 | m_EditorHideFlags: 0 98 | m_Script: {fileID: 11500000, guid: c9da270df5147d24597cc106058c1fa7, type: 3} 99 | m_Name: 100 | m_EditorClassIdentifier: 101 | offset: {fileID: 0} 102 | frontCam: {fileID: 0} 103 | backCam: {fileID: 0} 104 | --- !u!1001 &100100000 105 | Prefab: 106 | m_ObjectHideFlags: 1 107 | serializedVersion: 2 108 | m_Modification: 109 | m_TransformParent: {fileID: 0} 110 | m_Modifications: [] 111 | m_RemovedComponents: [] 112 | m_ParentPrefab: {fileID: 0} 113 | m_RootGameObject: {fileID: 128450} 114 | m_IsPrefabParent: 1 115 | -------------------------------------------------------------------------------- /Assets/SteamVR/Resources/SteamVR_ExternalCamera.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b259143c09ffc447ad059e5b8d8cf89 3 | timeCreated: 1456288801 4 | licenseType: Store 5 | NativeFormatImporter: 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/SteamVR/Resources/SteamVR_Fade.shader: -------------------------------------------------------------------------------- 1 | Shader "Custom/SteamVR_Fade" { 2 | SubShader { Pass { 3 | Blend SrcAlpha OneMinusSrcAlpha 4 | ZTest Always Cull Off ZWrite Off Fog { Mode Off } 5 | BindChannels { Bind "vertex", vertex Bind "color", color } 6 | } } } -------------------------------------------------------------------------------- /Assets/SteamVR/Resources/SteamVR_Fade.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9f884441bea153347be721454dc13716 3 | timeCreated: 1433284862 4 | licenseType: Store 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Resources/SteamVR_HiddenArea.shader: -------------------------------------------------------------------------------- 1 | Shader "Custom/SteamVR_HiddenArea" { 2 | 3 | CGINCLUDE 4 | 5 | #include "UnityCG.cginc" 6 | 7 | float4 vert(appdata_base v) : SV_POSITION { return v.vertex; } 8 | float4 frag(float4 v : SV_POSITION) : COLOR { return float4(0,0,0,0); } 9 | 10 | ENDCG 11 | 12 | SubShader { 13 | Tags { "Queue" = "Background" } 14 | Pass { 15 | ZTest Always Cull Off ZWrite On 16 | Fog { Mode Off } 17 | 18 | CGPROGRAM 19 | #pragma vertex vert 20 | #pragma fragment frag 21 | ENDCG 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /Assets/SteamVR/Resources/SteamVR_HiddenArea.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7687f525efe9f4b449dfe5a7fe0b7c8e 3 | timeCreated: 1428972938 4 | licenseType: Store 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Resources/SteamVR_Overlay.shader: -------------------------------------------------------------------------------- 1 | Shader "Custom/SteamVR_Overlay" { 2 | Properties { _MainTex ("Base (RGB)", 2D) = "white" {} } 3 | 4 | CGINCLUDE 5 | 6 | #include "UnityCG.cginc" 7 | 8 | sampler2D _MainTex; 9 | 10 | struct v2f { 11 | float4 pos : SV_POSITION; 12 | float2 tex : TEXCOORD0; 13 | }; 14 | 15 | v2f vert(appdata_base v) { 16 | v2f o; 17 | o.pos = v.vertex; 18 | o.tex = v.texcoord; 19 | return o; 20 | } 21 | 22 | float4 frag(v2f i) : COLOR { 23 | return tex2D(_MainTex, i.tex); 24 | } 25 | 26 | float4 frag_linear(v2f i) : COLOR { 27 | return pow(tex2D(_MainTex, i.tex), 2.2); 28 | } 29 | 30 | ENDCG 31 | 32 | SubShader { 33 | Pass { 34 | Blend SrcAlpha OneMinusSrcAlpha 35 | ZTest Always Cull Off ZWrite Off 36 | Fog { Mode Off } 37 | 38 | CGPROGRAM 39 | #pragma vertex vert 40 | #pragma fragment frag 41 | ENDCG 42 | } 43 | Pass { 44 | Blend SrcAlpha OneMinusSrcAlpha 45 | ZTest Always Cull Off ZWrite Off 46 | Fog { Mode Off } 47 | 48 | CGPROGRAM 49 | #pragma vertex vert 50 | #pragma fragment frag_linear 51 | ENDCG 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Assets/SteamVR/Resources/SteamVR_Overlay.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cd9d4af6e66af1c4d8abe3384397ee14 3 | timeCreated: 1433793509 4 | licenseType: Store 5 | ShaderImporter: 6 | defaultTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3bf264d55e7a1f848ab895f06d47925d 3 | folderAsset: yes 4 | timeCreated: 1458326221 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scenes/example.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 274ae687a94e2444b85ce2bcf56c1df3 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 715cbbe1125914d4692f448809856451 3 | folderAsset: yes 4 | timeCreated: 1458326221 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7fae0ddab09ac324c85494471274d6a4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_Camera.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6bca9ccf900ccc84c887d783321d27e2 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_CameraFlip.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2015, Valve Corporation, All rights reserved. =========== 2 | // 3 | // Purpose: Flips the camera output back to normal for D3D. 4 | // 5 | //============================================================================= 6 | 7 | using UnityEngine; 8 | using System.Collections; 9 | 10 | public class SteamVR_CameraFlip : MonoBehaviour 11 | { 12 | static Material blitMaterial; 13 | 14 | void OnEnable() 15 | { 16 | if (blitMaterial == null) 17 | blitMaterial = new Material(Shader.Find("Custom/SteamVR_BlitFlip")); 18 | } 19 | 20 | void OnRenderImage(RenderTexture src, RenderTexture dest) 21 | { 22 | Graphics.Blit(src, dest, blitMaterial); 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_CameraFlip.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f5be45115742b07478e21c85fcc233ec 3 | timeCreated: 1430851231 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_CameraMask.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2014, Valve Corporation, All rights reserved. =========== 2 | // 3 | // Purpose: Masks out pixels that cannot be seen through the connected hmd. 4 | // 5 | //============================================================================= 6 | 7 | using UnityEngine; 8 | using System.Collections; 9 | using UnityEngine.Rendering; 10 | 11 | [RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))] 12 | public class SteamVR_CameraMask : MonoBehaviour 13 | { 14 | static Material material; 15 | static Mesh[] hiddenAreaMeshes = new Mesh[] { null, null }; 16 | 17 | MeshFilter meshFilter; 18 | 19 | void Awake() 20 | { 21 | meshFilter = GetComponent(); 22 | 23 | if (material == null) 24 | material = new Material(Shader.Find("Custom/SteamVR_HiddenArea")); 25 | 26 | var mr = GetComponent(); 27 | mr.material = material; 28 | mr.shadowCastingMode = ShadowCastingMode.Off; 29 | mr.receiveShadows = false; 30 | #if !(UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0) 31 | mr.lightProbeUsage = LightProbeUsage.Off; 32 | #else 33 | mr.useLightProbes = false; 34 | #endif 35 | mr.reflectionProbeUsage = ReflectionProbeUsage.Off; 36 | } 37 | 38 | public void Set(SteamVR vr, Valve.VR.EVREye eye) 39 | { 40 | int i = (int)eye; 41 | if (hiddenAreaMeshes[i] == null) 42 | hiddenAreaMeshes[i] = SteamVR_Utils.CreateHiddenAreaMesh(vr.hmd.GetHiddenAreaMesh(eye), vr.textureBounds[i]); 43 | meshFilter.mesh = hiddenAreaMeshes[i]; 44 | } 45 | 46 | public void Clear() 47 | { 48 | meshFilter.mesh = null; 49 | } 50 | } 51 | 52 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_CameraMask.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5828f252c3c228f4b931f66c21e525c4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_Controller.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f9c6e0c408020c341b3c329ec30355a1 3 | timeCreated: 1429900414 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_ControllerManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3b47c2980b93bc48844a54641dab5b8 3 | timeCreated: 1437430318 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_Ears.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2016, Valve Corporation, All rights reserved. =========== 2 | // 3 | // Purpose: Handles aligning audio listener when using speakers. 4 | // 5 | //============================================================================= 6 | 7 | using UnityEngine; 8 | using Valve.VR; 9 | 10 | [RequireComponent(typeof(AudioListener))] 11 | public class SteamVR_Ears : MonoBehaviour 12 | { 13 | public SteamVR_Camera vrcam; 14 | 15 | bool usingSpeakers; 16 | Quaternion offset; 17 | 18 | private void OnNewPosesApplied(params object[] args) 19 | { 20 | var origin = vrcam.origin; 21 | var baseRotation = origin != null ? origin.rotation : Quaternion.identity; 22 | transform.rotation = baseRotation * offset; 23 | } 24 | 25 | void OnEnable() 26 | { 27 | usingSpeakers = false; 28 | 29 | var settings = OpenVR.Settings; 30 | if (settings != null) 31 | { 32 | var error = EVRSettingsError.None; 33 | if (settings.GetBool(OpenVR.k_pch_SteamVR_Section, OpenVR.k_pch_SteamVR_UsingSpeakers_Bool, false, ref error)) 34 | { 35 | usingSpeakers = true; 36 | 37 | var yawOffset = settings.GetFloat(OpenVR.k_pch_SteamVR_Section, OpenVR.k_pch_SteamVR_SpeakersForwardYawOffsetDegrees_Float, 0.0f, ref error); 38 | offset = Quaternion.Euler(0.0f, yawOffset, 0.0f); 39 | } 40 | } 41 | 42 | if (usingSpeakers) 43 | SteamVR_Utils.Event.Listen("new_poses_applied", OnNewPosesApplied); 44 | } 45 | 46 | void OnDisable() 47 | { 48 | if (usingSpeakers) 49 | SteamVR_Utils.Event.Remove("new_poses_applied", OnNewPosesApplied); 50 | } 51 | } 52 | 53 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_Ears.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49a86c1078ce4314b9c4224560e031b9 3 | timeCreated: 1457243016 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_ExternalCamera.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c9da270df5147d24597cc106058c1fa7 3 | timeCreated: 1455761349 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_Fade.cs: -------------------------------------------------------------------------------- 1 | //#define TEST_FADE_VIEW 2 | //========= Copyright 2014, Valve Corporation, All rights reserved. =========== 3 | // 4 | // Purpose: CameraFade script adapted to work with SteamVR. 5 | // 6 | // Usage: Add to your top level SteamVR_Camera (the one with ApplyDistoration 7 | // checked) and drag a reference to this component into SteamVR_Camera 8 | // RenderComponents list. Then call the static helper function 9 | // SteamVR_Fade.Start with the desired color and duration. 10 | // Use a duration of zero to set the start color. 11 | // 12 | // Example: Fade down from black over one second. 13 | // SteamVR_Fade.Start(Color.black, 0); 14 | // SteamVR_Fade.Start(Color.clear, 1); 15 | // 16 | // Note: This component is provided to fade out a single camera layer's 17 | // scene view. If instead you want to fade the entire view, use: 18 | // SteamVR_Fade.View(Color.black, 1); 19 | // (Does not affect the game view, however.) 20 | // 21 | //============================================================================= 22 | 23 | using UnityEngine; 24 | using Valve.VR; 25 | 26 | public class SteamVR_Fade : MonoBehaviour 27 | { 28 | private Color currentColor = new Color(0, 0, 0, 0); // default starting color: black and fully transparent 29 | private Color targetColor = new Color(0, 0, 0, 0); // default target color: black and fully transparent 30 | private Color deltaColor = new Color(0, 0, 0, 0); // the delta-color is basically the "speed / second" at which the current color should change 31 | private bool fadeOverlay = false; 32 | 33 | static public void Start(Color newColor, float duration, bool fadeOverlay = false) 34 | { 35 | SteamVR_Utils.Event.Send("fade", newColor, duration, fadeOverlay); 36 | } 37 | 38 | static public void View(Color newColor, float duration) 39 | { 40 | var compositor = OpenVR.Compositor; 41 | if (compositor != null) 42 | compositor.FadeToColor(duration, newColor.r, newColor.g, newColor.b, newColor.a, false); 43 | } 44 | 45 | #if TEST_FADE_VIEW 46 | void Update() 47 | { 48 | if (Input.GetKeyDown(KeyCode.Space)) 49 | { 50 | SteamVR_Fade.View(Color.black, 0); 51 | SteamVR_Fade.View(Color.clear, 1); 52 | } 53 | } 54 | #endif 55 | 56 | public void OnStartFade(params object[] args) 57 | { 58 | var newColor = (Color)args[0]; 59 | var duration = (float)args[1]; 60 | 61 | fadeOverlay = (args.Length > 2) && (bool)args[2]; 62 | 63 | if (duration > 0.0f) 64 | { 65 | targetColor = newColor; 66 | deltaColor = (targetColor - currentColor) / duration; 67 | } 68 | else 69 | { 70 | currentColor = newColor; 71 | } 72 | } 73 | 74 | static Material fadeMaterial = null; 75 | 76 | void OnEnable() 77 | { 78 | if (fadeMaterial == null) 79 | { 80 | fadeMaterial = new Material(Shader.Find("Custom/SteamVR_Fade")); 81 | } 82 | 83 | SteamVR_Utils.Event.Listen("fade", OnStartFade); 84 | SteamVR_Utils.Event.Send("fade_ready"); 85 | } 86 | 87 | void OnDisable() 88 | { 89 | SteamVR_Utils.Event.Remove("fade", OnStartFade); 90 | } 91 | 92 | void OnPostRender() 93 | { 94 | if (currentColor != targetColor) 95 | { 96 | // if the difference between the current alpha and the desired alpha is smaller than delta-alpha * deltaTime, then we're pretty much done fading: 97 | if (Mathf.Abs(currentColor.a - targetColor.a) < Mathf.Abs(deltaColor.a) * Time.deltaTime) 98 | { 99 | currentColor = targetColor; 100 | deltaColor = new Color(0, 0, 0, 0); 101 | } 102 | else 103 | { 104 | currentColor += deltaColor * Time.deltaTime; 105 | } 106 | 107 | if (fadeOverlay) 108 | { 109 | var overlay = SteamVR_Overlay.instance; 110 | if (overlay != null) 111 | { 112 | overlay.alpha = 1.0f - currentColor.a; 113 | } 114 | } 115 | } 116 | 117 | if (currentColor.a > 0 && fadeMaterial) 118 | { 119 | GL.PushMatrix(); 120 | GL.LoadOrtho(); 121 | fadeMaterial.SetPass(0); 122 | GL.Begin(GL.QUADS); 123 | GL.Color(currentColor); 124 | GL.Vertex3(0, 0, 0); 125 | GL.Vertex3(1, 0, 0); 126 | GL.Vertex3(1, 1, 0); 127 | GL.Vertex3(0, 1, 0); 128 | GL.End(); 129 | GL.PopMatrix(); 130 | } 131 | } 132 | } 133 | 134 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_Fade.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2ad1e469d4e3e04489f9a36419f1a4f8 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_Frustum.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2014, Valve Corporation, All rights reserved. =========== 2 | // 3 | // Purpose: Generates a mesh based on field of view. 4 | // 5 | //============================================================================= 6 | 7 | using UnityEngine; 8 | using Valve.VR; 9 | 10 | [ExecuteInEditMode, RequireComponent(typeof(MeshRenderer), typeof(MeshFilter))] 11 | public class SteamVR_Frustum : MonoBehaviour 12 | { 13 | public SteamVR_TrackedObject.EIndex index; 14 | 15 | public float fovLeft = 45, fovRight = 45, fovTop = 45, fovBottom = 45, nearZ = 0.5f, farZ = 2.5f; 16 | 17 | public void UpdateModel() 18 | { 19 | fovLeft = Mathf.Clamp(fovLeft, 1, 89); 20 | fovRight = Mathf.Clamp(fovRight, 1, 89); 21 | fovTop = Mathf.Clamp(fovTop, 1, 89); 22 | fovBottom = Mathf.Clamp(fovBottom, 1, 89); 23 | farZ = Mathf.Max(farZ, nearZ + 0.01f); 24 | nearZ = Mathf.Clamp(nearZ, 0.01f, farZ - 0.01f); 25 | 26 | var lsin = Mathf.Sin(-fovLeft * Mathf.Deg2Rad); 27 | var rsin = Mathf.Sin(fovRight * Mathf.Deg2Rad); 28 | var tsin = Mathf.Sin(fovTop * Mathf.Deg2Rad); 29 | var bsin = Mathf.Sin(-fovBottom * Mathf.Deg2Rad); 30 | 31 | var lcos = Mathf.Cos(-fovLeft * Mathf.Deg2Rad); 32 | var rcos = Mathf.Cos(fovRight * Mathf.Deg2Rad); 33 | var tcos = Mathf.Cos(fovTop * Mathf.Deg2Rad); 34 | var bcos = Mathf.Cos(-fovBottom * Mathf.Deg2Rad); 35 | 36 | var corners = new Vector3[] { 37 | new Vector3(lsin * nearZ / lcos, tsin * nearZ / tcos, nearZ), //tln 38 | new Vector3(rsin * nearZ / rcos, tsin * nearZ / tcos, nearZ), //trn 39 | new Vector3(rsin * nearZ / rcos, bsin * nearZ / bcos, nearZ), //brn 40 | new Vector3(lsin * nearZ / lcos, bsin * nearZ / bcos, nearZ), //bln 41 | new Vector3(lsin * farZ / lcos, tsin * farZ / tcos, farZ ), //tlf 42 | new Vector3(rsin * farZ / rcos, tsin * farZ / tcos, farZ ), //trf 43 | new Vector3(rsin * farZ / rcos, bsin * farZ / bcos, farZ ), //brf 44 | new Vector3(lsin * farZ / lcos, bsin * farZ / bcos, farZ ), //blf 45 | }; 46 | 47 | var triangles = new int[] { 48 | // 0, 1, 2, 0, 2, 3, // near 49 | // 0, 2, 1, 0, 3, 2, // near 50 | // 4, 5, 6, 4, 6, 7, // far 51 | // 4, 6, 5, 4, 7, 6, // far 52 | 0, 4, 7, 0, 7, 3, // left 53 | 0, 7, 4, 0, 3, 7, // left 54 | 1, 5, 6, 1, 6, 2, // right 55 | 1, 6, 5, 1, 2, 6, // right 56 | 0, 4, 5, 0, 5, 1, // top 57 | 0, 5, 4, 0, 1, 5, // top 58 | 2, 3, 7, 2, 7, 6, // bottom 59 | 2, 7, 3, 2, 6, 7, // bottom 60 | }; 61 | 62 | int j = 0; 63 | var vertices = new Vector3[triangles.Length]; 64 | var normals = new Vector3[triangles.Length]; 65 | for (int i = 0; i < triangles.Length / 3; i++) 66 | { 67 | var a = corners[triangles[i * 3 + 0]]; 68 | var b = corners[triangles[i * 3 + 1]]; 69 | var c = corners[triangles[i * 3 + 2]]; 70 | var n = Vector3.Cross(b - a, c - a).normalized; 71 | normals[i * 3 + 0] = n; 72 | normals[i * 3 + 1] = n; 73 | normals[i * 3 + 2] = n; 74 | vertices[i * 3 + 0] = a; 75 | vertices[i * 3 + 1] = b; 76 | vertices[i * 3 + 2] = c; 77 | triangles[i * 3 + 0] = j++; 78 | triangles[i * 3 + 1] = j++; 79 | triangles[i * 3 + 2] = j++; 80 | } 81 | 82 | var mesh = new Mesh(); 83 | mesh.vertices = vertices; 84 | mesh.normals = normals; 85 | mesh.triangles = triangles; 86 | 87 | GetComponent().mesh = mesh; 88 | } 89 | 90 | private void OnDeviceConnected(params object[] args) 91 | { 92 | var i = (int)args[0]; 93 | if (i != (int)index) 94 | return; 95 | 96 | GetComponent().mesh = null; 97 | 98 | var connected = (bool)args[1]; 99 | if (connected) 100 | { 101 | var system = OpenVR.System; 102 | if (system != null && system.GetTrackedDeviceClass((uint)i) == ETrackedDeviceClass.TrackingReference) 103 | { 104 | var error = ETrackedPropertyError.TrackedProp_Success; 105 | var result = system.GetFloatTrackedDeviceProperty((uint)i, ETrackedDeviceProperty.Prop_FieldOfViewLeftDegrees_Float, ref error); 106 | if (error == ETrackedPropertyError.TrackedProp_Success) 107 | fovLeft = result; 108 | 109 | result = system.GetFloatTrackedDeviceProperty((uint)i, ETrackedDeviceProperty.Prop_FieldOfViewRightDegrees_Float, ref error); 110 | if (error == ETrackedPropertyError.TrackedProp_Success) 111 | fovRight = result; 112 | 113 | result = system.GetFloatTrackedDeviceProperty((uint)i, ETrackedDeviceProperty.Prop_FieldOfViewTopDegrees_Float, ref error); 114 | if (error == ETrackedPropertyError.TrackedProp_Success) 115 | fovTop = result; 116 | 117 | result = system.GetFloatTrackedDeviceProperty((uint)i, ETrackedDeviceProperty.Prop_FieldOfViewBottomDegrees_Float, ref error); 118 | if (error == ETrackedPropertyError.TrackedProp_Success) 119 | fovBottom = result; 120 | 121 | result = system.GetFloatTrackedDeviceProperty((uint)i, ETrackedDeviceProperty.Prop_TrackingRangeMinimumMeters_Float, ref error); 122 | if (error == ETrackedPropertyError.TrackedProp_Success) 123 | nearZ = result; 124 | 125 | result = system.GetFloatTrackedDeviceProperty((uint)i, ETrackedDeviceProperty.Prop_TrackingRangeMaximumMeters_Float, ref error); 126 | if (error == ETrackedPropertyError.TrackedProp_Success) 127 | farZ = result; 128 | 129 | UpdateModel(); 130 | } 131 | } 132 | } 133 | 134 | void OnEnable() 135 | { 136 | GetComponent().mesh = null; 137 | SteamVR_Utils.Event.Listen("device_connected", OnDeviceConnected); 138 | } 139 | 140 | void OnDisable() 141 | { 142 | SteamVR_Utils.Event.Remove("device_connected", OnDeviceConnected); 143 | GetComponent().mesh = null; 144 | } 145 | 146 | #if UNITY_EDITOR 147 | void Update() 148 | { 149 | if (!Application.isPlaying) 150 | UpdateModel(); 151 | } 152 | #endif 153 | } 154 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_Frustum.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b2d1785fa0c551e408b6c94398847b76 3 | timeCreated: 1427400484 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_GameView.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2014, Valve Corporation, All rights reserved. =========== 2 | // 3 | // Purpose: Handles rendering to the game view window 4 | // 5 | //============================================================================= 6 | 7 | using UnityEngine; 8 | 9 | [RequireComponent(typeof(Camera))] 10 | public class SteamVR_GameView : MonoBehaviour 11 | { 12 | public float scale = 1.5f; 13 | public bool drawOverlay = true; 14 | 15 | static Material overlayMaterial; 16 | 17 | void OnEnable() 18 | { 19 | if (overlayMaterial == null) 20 | { 21 | overlayMaterial = new Material(Shader.Find("Custom/SteamVR_Overlay")); 22 | } 23 | } 24 | 25 | void OnPostRender() 26 | { 27 | var vr = SteamVR.instance; 28 | var camera = GetComponent(); 29 | var aspect = scale * camera.aspect / vr.aspect; 30 | 31 | var x0 = -scale; 32 | var x1 = scale; 33 | var y0 = aspect; 34 | var y1 = -aspect; 35 | 36 | var blitMaterial = SteamVR_Camera.blitMaterial; 37 | blitMaterial.mainTexture = SteamVR_Camera.GetSceneTexture(camera.hdr); 38 | 39 | GL.PushMatrix(); 40 | GL.LoadOrtho(); 41 | #if !(UNITY_5_0) 42 | blitMaterial.SetPass(0); 43 | #else 44 | blitMaterial.SetPass(QualitySettings.activeColorSpace == ColorSpace.Linear ? 1 : 0); 45 | #endif 46 | GL.Begin(GL.QUADS); 47 | GL.TexCoord2(0.0f, 0.0f); GL.Vertex3(x0, y0, 0); 48 | GL.TexCoord2(1.0f, 0.0f); GL.Vertex3(x1, y0, 0); 49 | GL.TexCoord2(1.0f, 1.0f); GL.Vertex3(x1, y1, 0); 50 | GL.TexCoord2(0.0f, 1.0f); GL.Vertex3(x0, y1, 0); 51 | GL.End(); 52 | GL.PopMatrix(); 53 | 54 | var overlay = SteamVR_Overlay.instance; 55 | if (overlay && overlay.texture && overlayMaterial && drawOverlay) 56 | { 57 | var texture = overlay.texture; 58 | overlayMaterial.mainTexture = texture; 59 | 60 | var u0 = 0.0f; 61 | var v0 = 1.0f - (float)Screen.height / texture.height; 62 | var u1 = (float)Screen.width / texture.width; 63 | var v1 = 1.0f; 64 | 65 | GL.PushMatrix(); 66 | GL.LoadOrtho(); 67 | #if !(UNITY_5_0) 68 | overlayMaterial.SetPass(QualitySettings.activeColorSpace == ColorSpace.Linear ? 1 : 0); 69 | #else 70 | overlayMaterial.SetPass(0); 71 | #endif 72 | GL.Begin(GL.QUADS); 73 | GL.TexCoord2(u0, v0); GL.Vertex3(-1, -1, 0); 74 | GL.TexCoord2(u1, v0); GL.Vertex3( 1, -1, 0); 75 | GL.TexCoord2(u1, v1); GL.Vertex3( 1, 1, 0); 76 | GL.TexCoord2(u0, v1); GL.Vertex3(-1, 1, 0); 77 | GL.End(); 78 | GL.PopMatrix(); 79 | } 80 | } 81 | } 82 | 83 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_GameView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: be96d45fe21847a4a805d408a8015c84 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_IK.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2015, Valve Corporation, All rights reserved. =========== 2 | // 3 | // Purpose: Simple two bone ik solver. 4 | // 5 | //============================================================================= 6 | 7 | using UnityEngine; 8 | 9 | public class SteamVR_IK : MonoBehaviour 10 | { 11 | public Transform target; 12 | public Transform start, joint, end; 13 | public Transform poleVector, upVector; 14 | 15 | public float blendPct = 1.0f; 16 | 17 | [HideInInspector] 18 | public Transform startXform, jointXform, endXform; 19 | 20 | void LateUpdate() 21 | { 22 | const float epsilon = 0.001f; 23 | if (blendPct < epsilon) 24 | return; 25 | 26 | var preUp = upVector ? upVector.up : Vector3.Cross(end.position - start.position, joint.position - start.position).normalized; 27 | 28 | var targetPosition = target.position; 29 | var targetRotation = target.rotation; 30 | 31 | Vector3 forward, up, result = joint.position; 32 | Solve(start.position, targetPosition, poleVector.position, 33 | (joint.position - start.position).magnitude, 34 | (end.position - joint.position).magnitude, 35 | ref result, out forward, out up); 36 | 37 | if (up == Vector3.zero) 38 | return; 39 | 40 | var startPosition = start.position; 41 | var jointPosition = joint.position; 42 | var endPosition = end.position; 43 | 44 | var startRotationLocal = start.localRotation; 45 | var jointRotationLocal = joint.localRotation; 46 | var endRotationLocal = end.localRotation; 47 | 48 | var startParent = start.parent; 49 | var jointParent = joint.parent; 50 | var endParent = end.parent; 51 | 52 | var startScale = start.localScale; 53 | var jointScale = joint.localScale; 54 | var endScale = end.localScale; 55 | 56 | if (startXform == null) 57 | { 58 | startXform = new GameObject("startXform").transform; 59 | startXform.parent = transform; 60 | } 61 | 62 | startXform.position = startPosition; 63 | startXform.LookAt(joint, preUp); 64 | start.parent = startXform; 65 | 66 | if (jointXform == null) 67 | { 68 | jointXform = new GameObject("jointXform").transform; 69 | jointXform.parent = startXform; 70 | } 71 | 72 | jointXform.position = jointPosition; 73 | jointXform.LookAt(end, preUp); 74 | joint.parent = jointXform; 75 | 76 | if (endXform == null) 77 | { 78 | endXform = new GameObject("endXform").transform; 79 | endXform.parent = jointXform; 80 | } 81 | 82 | endXform.position = endPosition; 83 | end.parent = endXform; 84 | 85 | startXform.LookAt(result, up); 86 | jointXform.LookAt(targetPosition, up); 87 | endXform.rotation = targetRotation; 88 | 89 | start.parent = startParent; 90 | joint.parent = jointParent; 91 | end.parent = endParent; 92 | 93 | end.rotation = targetRotation; // optionally blend? 94 | 95 | // handle blending in/out 96 | if (blendPct < 1.0f) 97 | { 98 | start.localRotation = Quaternion.Slerp(startRotationLocal, start.localRotation, blendPct); 99 | joint.localRotation = Quaternion.Slerp(jointRotationLocal, joint.localRotation, blendPct); 100 | end.localRotation = Quaternion.Slerp(endRotationLocal, end.localRotation, blendPct); 101 | } 102 | 103 | // restore scale so it doesn't blow out 104 | start.localScale = startScale; 105 | joint.localScale = jointScale; 106 | end.localScale = endScale; 107 | } 108 | 109 | public static bool Solve( 110 | Vector3 start, // shoulder / hip 111 | Vector3 end, // desired hand / foot position 112 | Vector3 poleVector, // point to aim elbow / knee toward 113 | float jointDist, // distance from start to elbow / knee 114 | float targetDist, // distance from joint to hand / ankle 115 | ref Vector3 result, // original and output elbow / knee position 116 | out Vector3 forward, out Vector3 up) // plane formed by root, joint and target 117 | { 118 | var totalDist = jointDist + targetDist; 119 | var start2end = end - start; 120 | var poleVectorDir = (poleVector - start).normalized; 121 | var baseDist = start2end.magnitude; 122 | 123 | result = start; 124 | 125 | const float epsilon = 0.001f; 126 | if (baseDist < epsilon) 127 | { 128 | // move jointDist toward jointTarget 129 | result += poleVectorDir * jointDist; 130 | 131 | forward = Vector3.Cross(poleVectorDir, Vector3.up); 132 | up = Vector3.Cross(forward, poleVectorDir).normalized; 133 | } 134 | else 135 | { 136 | forward = start2end * (1.0f / baseDist); 137 | up = Vector3.Cross(forward, poleVectorDir).normalized; 138 | 139 | if (baseDist + epsilon < totalDist) 140 | { 141 | // calculate the area of the triangle to determine its height 142 | var p = (totalDist + baseDist) * 0.5f; // half perimeter 143 | if (p > jointDist + epsilon && p > targetDist + epsilon) 144 | { 145 | var A = Mathf.Sqrt(p * (p - jointDist) * (p - targetDist) * (p - baseDist)); 146 | var height = 2.0f * A / baseDist; // distance of joint from line between root and target 147 | 148 | var dist = Mathf.Sqrt((jointDist * jointDist) - (height * height)); 149 | var right = Vector3.Cross(up, forward); // no need to normalized - already orthonormal 150 | 151 | result += (forward * dist) + (right * height); 152 | return true; // in range 153 | } 154 | else 155 | { 156 | // move jointDist toward jointTarget 157 | result += poleVectorDir * jointDist; 158 | } 159 | } 160 | else 161 | { 162 | // move elboDist toward target 163 | result += forward * jointDist; 164 | } 165 | } 166 | 167 | return false; // edge cases 168 | } 169 | } 170 | 171 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_IK.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ea22dba3baf2ecc4d886bf2444444228 3 | timeCreated: 1437502789 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_LoadLevel.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a5a6a70209b6e6345bfe18b02314a54e 3 | timeCreated: 1446783318 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_Menu.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e7afc8c74d1f73b458705e0b946292a0 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_Overlay.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2014, Valve Corporation, All rights reserved. =========== 2 | // 3 | // Purpose: Displays 2d content on a large virtual screen. 4 | // 5 | //============================================================================= 6 | 7 | using UnityEngine; 8 | using System.Collections; 9 | using Valve.VR; 10 | 11 | public class SteamVR_Overlay : MonoBehaviour 12 | { 13 | public Texture texture; 14 | public bool curved = true; 15 | public bool antialias = true; 16 | public bool highquality = true; 17 | public float scale = 3.0f; // size of overlay view 18 | public float distance = 1.25f; // distance from surface 19 | public float alpha = 1.0f; // opacity 0..1 20 | 21 | public Vector4 uvOffset = new Vector4(0, 0, 1, 1); 22 | public Vector2 mouseScale = new Vector2(1, 1); 23 | public Vector2 curvedRange = new Vector2(1, 2); 24 | 25 | public VROverlayInputMethod inputMethod = VROverlayInputMethod.None; 26 | 27 | static public SteamVR_Overlay instance { get; private set; } 28 | 29 | static public string key { get { return "unity:" + Application.companyName + "." + Application.productName; } } 30 | 31 | private ulong handle = OpenVR.k_ulOverlayHandleInvalid; 32 | 33 | void OnEnable() 34 | { 35 | var overlay = OpenVR.Overlay; 36 | if (overlay != null) 37 | { 38 | var error = overlay.CreateOverlay(key, gameObject.name, ref handle); 39 | if (error != EVROverlayError.None) 40 | { 41 | Debug.Log(overlay.GetOverlayErrorNameFromEnum(error)); 42 | enabled = false; 43 | return; 44 | } 45 | } 46 | 47 | SteamVR_Overlay.instance = this; 48 | } 49 | 50 | void OnDisable() 51 | { 52 | if (handle != OpenVR.k_ulOverlayHandleInvalid) 53 | { 54 | var overlay = OpenVR.Overlay; 55 | if (overlay != null) 56 | { 57 | overlay.DestroyOverlay(handle); 58 | } 59 | 60 | handle = OpenVR.k_ulOverlayHandleInvalid; 61 | } 62 | 63 | SteamVR_Overlay.instance = null; 64 | } 65 | 66 | public void UpdateOverlay() 67 | { 68 | var overlay = OpenVR.Overlay; 69 | if (overlay == null) 70 | return; 71 | 72 | if (texture != null) 73 | { 74 | var error = overlay.ShowOverlay(handle); 75 | if (error == EVROverlayError.InvalidHandle || error == EVROverlayError.UnknownOverlay) 76 | { 77 | if (overlay.FindOverlay(key, ref handle) != EVROverlayError.None) 78 | return; 79 | } 80 | 81 | var tex = new Texture_t(); 82 | tex.handle = texture.GetNativeTexturePtr(); 83 | tex.eType = SteamVR.instance.graphicsAPI; 84 | tex.eColorSpace = EColorSpace.Auto; 85 | overlay.SetOverlayTexture(handle, ref tex); 86 | 87 | overlay.SetOverlayAlpha(handle, alpha); 88 | overlay.SetOverlayWidthInMeters(handle, scale); 89 | overlay.SetOverlayAutoCurveDistanceRangeInMeters(handle, curvedRange.x, curvedRange.y); 90 | 91 | var textureBounds = new VRTextureBounds_t(); 92 | textureBounds.uMin = (0 + uvOffset.x) * uvOffset.z; 93 | textureBounds.vMin = (1 + uvOffset.y) * uvOffset.w; 94 | textureBounds.uMax = (1 + uvOffset.x) * uvOffset.z; 95 | textureBounds.vMax = (0 + uvOffset.y) * uvOffset.w; 96 | overlay.SetOverlayTextureBounds(handle, ref textureBounds); 97 | 98 | var vecMouseScale = new HmdVector2_t(); 99 | vecMouseScale.v0 = mouseScale.x; 100 | vecMouseScale.v1 = mouseScale.y; 101 | overlay.SetOverlayMouseScale(handle, ref vecMouseScale); 102 | 103 | var vrcam = SteamVR_Render.Top(); 104 | if (vrcam != null && vrcam.origin != null) 105 | { 106 | var offset = new SteamVR_Utils.RigidTransform(vrcam.origin, transform); 107 | offset.pos.x /= vrcam.origin.localScale.x; 108 | offset.pos.y /= vrcam.origin.localScale.y; 109 | offset.pos.z /= vrcam.origin.localScale.z; 110 | 111 | offset.pos.z += distance; 112 | 113 | var t = offset.ToHmdMatrix34(); 114 | overlay.SetOverlayTransformAbsolute(handle, SteamVR_Render.instance.trackingSpace, ref t); 115 | } 116 | 117 | overlay.SetOverlayInputMethod(handle, inputMethod); 118 | 119 | if (curved || antialias) 120 | highquality = true; 121 | 122 | if (highquality) 123 | { 124 | overlay.SetHighQualityOverlay(handle); 125 | overlay.SetOverlayFlag(handle, VROverlayFlags.Curved, curved); 126 | overlay.SetOverlayFlag(handle, VROverlayFlags.RGSS4X, antialias); 127 | } 128 | else if (overlay.GetHighQualityOverlay() == handle) 129 | { 130 | overlay.SetHighQualityOverlay(OpenVR.k_ulOverlayHandleInvalid); 131 | } 132 | } 133 | else 134 | { 135 | overlay.HideOverlay(handle); 136 | } 137 | } 138 | 139 | public bool PollNextEvent(ref VREvent_t pEvent) 140 | { 141 | var overlay = OpenVR.Overlay; 142 | if (overlay == null) 143 | return false; 144 | 145 | var size = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(Valve.VR.VREvent_t)); 146 | return overlay.PollNextOverlayEvent(handle, ref pEvent, size); 147 | } 148 | 149 | public struct IntersectionResults 150 | { 151 | public Vector3 point; 152 | public Vector3 normal; 153 | public Vector2 UVs; 154 | public float distance; 155 | } 156 | 157 | public bool ComputeIntersection(Vector3 source, Vector3 direction, ref IntersectionResults results) 158 | { 159 | var overlay = OpenVR.Overlay; 160 | if (overlay == null) 161 | return false; 162 | 163 | var input = new VROverlayIntersectionParams_t(); 164 | input.eOrigin = SteamVR_Render.instance.trackingSpace; 165 | input.vSource.v0 = source.x; 166 | input.vSource.v1 = source.y; 167 | input.vSource.v2 = -source.z; 168 | input.vDirection.v0 = direction.x; 169 | input.vDirection.v1 = direction.y; 170 | input.vDirection.v2 = -direction.z; 171 | 172 | var output = new VROverlayIntersectionResults_t(); 173 | if (!overlay.ComputeOverlayIntersection(handle, ref input, ref output)) 174 | return false; 175 | 176 | results.point = new Vector3(output.vPoint.v0, output.vPoint.v1, -output.vPoint.v2); 177 | results.normal = new Vector3(output.vNormal.v0, output.vNormal.v1, -output.vNormal.v2); 178 | results.UVs = new Vector2(output.vUVs.v0, output.vUVs.v1); 179 | results.distance = output.fDistance; 180 | return true; 181 | } 182 | } 183 | 184 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_Overlay.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46fe9e0b23166454c8cb73040321d78c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_PlayArea.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f0522eaef74d984591c060d05a095c8 3 | timeCreated: 1438043592 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_Render.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e979227f3384fac4b8ca0b3550bf005c 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: -32000 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_RenderModel.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5890e3cad70bea64d91aef9145ba3454 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_Skybox.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2015, Valve Corporation, All rights reserved. =========== 2 | // 3 | // Purpose: Sets cubemap to use in the compositor. 4 | // 5 | //============================================================================= 6 | 7 | using UnityEngine; 8 | using Valve.VR; 9 | 10 | public class SteamVR_Skybox : MonoBehaviour 11 | { 12 | // Note: Unity's Left and Right Skybox shader variables are switched. 13 | public Texture front, back, left, right, top, bottom; 14 | 15 | public void SetTextureByIndex(int i, Texture t) 16 | { 17 | switch (i) 18 | { 19 | case 0: 20 | front = t; 21 | break; 22 | case 1: 23 | back = t; 24 | break; 25 | case 2: 26 | left = t; 27 | break; 28 | case 3: 29 | right = t; 30 | break; 31 | case 4: 32 | top = t; 33 | break; 34 | case 5: 35 | bottom = t; 36 | break; 37 | } 38 | } 39 | 40 | public Texture GetTextureByIndex(int i) 41 | { 42 | switch (i) 43 | { 44 | case 0: 45 | return front; 46 | case 1: 47 | return back; 48 | case 2: 49 | return left; 50 | case 3: 51 | return right; 52 | case 4: 53 | return top; 54 | case 5: 55 | return bottom; 56 | } 57 | return null; 58 | } 59 | 60 | static public void SetOverride( 61 | Texture front = null, 62 | Texture back = null, 63 | Texture left = null, 64 | Texture right = null, 65 | Texture top = null, 66 | Texture bottom = null ) 67 | { 68 | var compositor = OpenVR.Compositor; 69 | if (compositor != null) 70 | { 71 | var handles = new Texture[] { front, back, left, right, top, bottom }; 72 | var textures = new Texture_t[6]; 73 | for (int i = 0; i < 6; i++) 74 | { 75 | textures[i].handle = (handles[i] != null) ? handles[i].GetNativeTexturePtr() : System.IntPtr.Zero; 76 | textures[i].eType = SteamVR.instance.graphicsAPI; 77 | textures[i].eColorSpace = EColorSpace.Auto; 78 | } 79 | var error = compositor.SetSkyboxOverride(textures); 80 | if (error != EVRCompositorError.None) 81 | { 82 | Debug.LogError("Failed to set skybox override with error: " + error); 83 | if (error == EVRCompositorError.TextureIsOnWrongDevice) 84 | Debug.Log("Set your graphics driver to use the same video card as the headset is plugged into for Unity."); 85 | else if (error == EVRCompositorError.TextureUsesUnsupportedFormat) 86 | Debug.Log("Ensure skybox textures are not compressed and have no mipmaps."); 87 | } 88 | } 89 | } 90 | 91 | static public void ClearOverride() 92 | { 93 | var compositor = OpenVR.Compositor; 94 | if (compositor != null) 95 | compositor.ClearSkyboxOverride(); 96 | } 97 | 98 | void OnEnable() 99 | { 100 | SetOverride(front, back, left, right, top, bottom); 101 | } 102 | 103 | void OnDisable() 104 | { 105 | ClearOverride(); 106 | } 107 | } 108 | 109 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_Skybox.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 13a43e992568b8e48b4bd489b9d96f40 3 | timeCreated: 1439344311 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_Stats.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2014, Valve Corporation, All rights reserved. =========== 2 | // 3 | // Purpose: Helper to display various hmd stats via GUIText 4 | // 5 | //============================================================================= 6 | 7 | using UnityEngine; 8 | using Valve.VR; 9 | 10 | public class SteamVR_Stats : MonoBehaviour 11 | { 12 | public GUIText text; 13 | 14 | public Color fadeColor = Color.black; 15 | public float fadeDuration = 1.0f; 16 | 17 | void Awake() 18 | { 19 | if (text == null) 20 | { 21 | text = GetComponent(); 22 | text.enabled = false; 23 | } 24 | 25 | if (fadeDuration > 0) 26 | { 27 | SteamVR_Fade.Start(fadeColor, 0); 28 | SteamVR_Fade.Start(Color.clear, fadeDuration); 29 | } 30 | } 31 | 32 | double lastUpdate = 0.0f; 33 | 34 | void Update() 35 | { 36 | if (text != null) 37 | { 38 | if (Input.GetKeyDown(KeyCode.I)) 39 | { 40 | text.enabled = !text.enabled; 41 | } 42 | 43 | if (text.enabled) 44 | { 45 | var compositor = OpenVR.Compositor; 46 | if (compositor != null) 47 | { 48 | var timing = new Compositor_FrameTiming(); 49 | timing.m_nSize = (uint)System.Runtime.InteropServices.Marshal.SizeOf(typeof(Compositor_FrameTiming)); 50 | compositor.GetFrameTiming(ref timing, 0); 51 | 52 | var update = timing.m_flSystemTimeInSeconds; 53 | if (update > lastUpdate) 54 | { 55 | var framerate = (lastUpdate > 0.0f) ? 1.0f / (update - lastUpdate) : 0.0f; 56 | lastUpdate = update; 57 | text.text = string.Format("framerate: {0:N0}\ndropped frames: {1}", framerate, (int)timing.m_nNumDroppedFrames); 58 | } 59 | else 60 | { 61 | lastUpdate = update; 62 | } 63 | } 64 | } 65 | } 66 | } 67 | } 68 | 69 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_Stats.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c3faa610c019764a81eb8497109e2d4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_Status.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2014, Valve Corporation, All rights reserved. =========== 2 | // 3 | // Purpose: Base class for fading things based on SteamVR events 4 | // 5 | //============================================================================= 6 | 7 | using UnityEngine; 8 | 9 | public abstract class SteamVR_Status : MonoBehaviour 10 | { 11 | public string message; // name of event to respond to 12 | public float duration, fade; 13 | 14 | protected float timer; 15 | protected bool status; 16 | 17 | public enum Mode 18 | { 19 | OnTrue, 20 | OnFalse, 21 | WhileTrue, 22 | WhileFalse 23 | } 24 | 25 | public Mode mode; 26 | 27 | protected abstract void SetAlpha(float a); 28 | 29 | void OnEnable() 30 | { 31 | SteamVR_Utils.Event.Listen(message, OnEvent); 32 | } 33 | 34 | void OnDisable() 35 | { 36 | SteamVR_Utils.Event.Remove(message, OnEvent); 37 | } 38 | 39 | void OnEvent(params object[] args) 40 | { 41 | status = (bool)args[0]; 42 | if (status) 43 | { 44 | if (mode == Mode.OnTrue) 45 | timer = duration; 46 | } 47 | else 48 | { 49 | if (mode == Mode.OnFalse) 50 | timer = duration; 51 | } 52 | } 53 | 54 | void Update() 55 | { 56 | if (mode == Mode.OnTrue || mode == Mode.OnFalse) 57 | { 58 | timer -= Time.deltaTime; 59 | if (timer < 0.0f) 60 | { 61 | SetAlpha(0.0f); 62 | } 63 | else 64 | { 65 | var a = 1.0f; 66 | if (timer < fade) 67 | a = timer / fade; 68 | if (timer > duration - fade) 69 | a = Mathf.InverseLerp(duration, duration - fade, timer); 70 | SetAlpha(a); 71 | } 72 | } 73 | else 74 | { 75 | var show = (mode == Mode.WhileTrue && status == true) || (mode == Mode.WhileFalse && status == false); 76 | timer = show ? Mathf.Min(fade, timer + Time.deltaTime) : Mathf.Max(0.0f, timer - Time.deltaTime); 77 | SetAlpha(timer / fade); 78 | } 79 | } 80 | } 81 | 82 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_Status.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58bbdee1309aef543ac92df1576bfe23 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_StatusText.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2014, Valve Corporation, All rights reserved. =========== 2 | // 3 | // Purpose: Used to display SteamVR status messages 4 | // 5 | //============================================================================= 6 | 7 | using UnityEngine; 8 | 9 | [RequireComponent(typeof(GUIText))] 10 | public class SteamVR_StatusText : SteamVR_Status 11 | { 12 | GUIText text; 13 | 14 | void Awake() 15 | { 16 | text = GetComponent(); 17 | 18 | if (mode == Mode.WhileTrue || mode == Mode.WhileFalse) 19 | timer = fade * text.color.a; 20 | } 21 | 22 | protected override void SetAlpha(float a) 23 | { 24 | if (a > 0.0f) 25 | { 26 | text.enabled = true; 27 | text.color = new Color(text.color.r, text.color.g, text.color.b, a); 28 | } 29 | else 30 | { 31 | text.enabled = false; 32 | } 33 | } 34 | } 35 | 36 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_StatusText.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 734380cdf472d0948a48549e5d5e7aa4 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_TestController.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2015, Valve Corporation, All rights reserved. =========== 2 | // 3 | // Purpose: Test SteamVR_Controller support. 4 | // 5 | //============================================================================= 6 | 7 | using UnityEngine; 8 | using System.Collections.Generic; 9 | using Valve.VR; 10 | 11 | public class SteamVR_TestController : MonoBehaviour 12 | { 13 | List controllerIndices = new List(); 14 | 15 | private void OnDeviceConnected(params object[] args) 16 | { 17 | var index = (int)args[0]; 18 | 19 | var system = OpenVR.System; 20 | if (system == null || system.GetTrackedDeviceClass((uint)index) != ETrackedDeviceClass.Controller) 21 | return; 22 | 23 | var connected = (bool)args[1]; 24 | if (connected) 25 | { 26 | Debug.Log(string.Format("Controller {0} connected.", index)); 27 | PrintControllerStatus(index); 28 | controllerIndices.Add(index); 29 | } 30 | else 31 | { 32 | Debug.Log(string.Format("Controller {0} disconnected.", index)); 33 | PrintControllerStatus(index); 34 | controllerIndices.Remove(index); 35 | } 36 | } 37 | 38 | void OnEnable() 39 | { 40 | SteamVR_Utils.Event.Listen("device_connected", OnDeviceConnected); 41 | } 42 | 43 | void OnDisable() 44 | { 45 | SteamVR_Utils.Event.Remove("device_connected", OnDeviceConnected); 46 | } 47 | 48 | void PrintControllerStatus(int index) 49 | { 50 | var device = SteamVR_Controller.Input(index); 51 | Debug.Log("index: " + device.index); 52 | Debug.Log("connected: " + device.connected); 53 | Debug.Log("hasTracking: " + device.hasTracking); 54 | Debug.Log("outOfRange: " + device.outOfRange); 55 | Debug.Log("calibrating: " + device.calibrating); 56 | Debug.Log("uninitialized: " + device.uninitialized); 57 | Debug.Log("pos: " + device.transform.pos); 58 | Debug.Log("rot: " + device.transform.rot.eulerAngles); 59 | Debug.Log("velocity: " + device.velocity); 60 | Debug.Log("angularVelocity: " + device.angularVelocity); 61 | 62 | var l = SteamVR_Controller.GetDeviceIndex(SteamVR_Controller.DeviceRelation.Leftmost); 63 | var r = SteamVR_Controller.GetDeviceIndex(SteamVR_Controller.DeviceRelation.Rightmost); 64 | Debug.Log((l == r) ? "first" : (l == index) ? "left" : "right"); 65 | } 66 | 67 | EVRButtonId[] buttonIds = new EVRButtonId[] { 68 | EVRButtonId.k_EButton_ApplicationMenu, 69 | EVRButtonId.k_EButton_Grip, 70 | EVRButtonId.k_EButton_SteamVR_Touchpad, 71 | EVRButtonId.k_EButton_SteamVR_Trigger 72 | }; 73 | 74 | EVRButtonId[] axisIds = new EVRButtonId[] { 75 | EVRButtonId.k_EButton_SteamVR_Touchpad, 76 | EVRButtonId.k_EButton_SteamVR_Trigger 77 | }; 78 | 79 | public Transform point, pointer; 80 | 81 | void Update() 82 | { 83 | foreach (var index in controllerIndices) 84 | { 85 | var overlay = SteamVR_Overlay.instance; 86 | if (overlay && point && pointer) 87 | { 88 | var t = SteamVR_Controller.Input(index).transform; 89 | pointer.transform.localPosition = t.pos; 90 | pointer.transform.localRotation = t.rot; 91 | 92 | var results = new SteamVR_Overlay.IntersectionResults(); 93 | var hit = overlay.ComputeIntersection(t.pos, t.rot * Vector3.forward, ref results); 94 | if (hit) 95 | { 96 | point.transform.localPosition = results.point; 97 | point.transform.localRotation = Quaternion.LookRotation(results.normal); 98 | } 99 | 100 | continue; 101 | } 102 | 103 | foreach (var buttonId in buttonIds) 104 | { 105 | if (SteamVR_Controller.Input(index).GetPressDown(buttonId)) 106 | Debug.Log(buttonId + " press down"); 107 | if (SteamVR_Controller.Input(index).GetPressUp(buttonId)) 108 | { 109 | Debug.Log(buttonId + " press up"); 110 | if (buttonId == EVRButtonId.k_EButton_SteamVR_Trigger) 111 | { 112 | SteamVR_Controller.Input(index).TriggerHapticPulse(); 113 | PrintControllerStatus(index); 114 | } 115 | } 116 | if (SteamVR_Controller.Input(index).GetPress(buttonId)) 117 | Debug.Log(buttonId); 118 | } 119 | 120 | foreach (var buttonId in axisIds) 121 | { 122 | if (SteamVR_Controller.Input(index).GetTouchDown(buttonId)) 123 | Debug.Log(buttonId + " touch down"); 124 | if (SteamVR_Controller.Input(index).GetTouchUp(buttonId)) 125 | Debug.Log(buttonId + " touch up"); 126 | if (SteamVR_Controller.Input(index).GetTouch(buttonId)) 127 | { 128 | var axis = SteamVR_Controller.Input(index).GetAxis(buttonId); 129 | Debug.Log("axis: " + axis); 130 | } 131 | } 132 | } 133 | } 134 | } 135 | 136 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_TestController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0811e240274b8ea4a8469e82b86747b4 3 | timeCreated: 1432764931 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_TrackedObject.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2014, Valve Corporation, All rights reserved. =========== 2 | // 3 | // Purpose: For controlling in-game objects with tracked devices. 4 | // 5 | //============================================================================= 6 | 7 | using UnityEngine; 8 | using Valve.VR; 9 | 10 | public class SteamVR_TrackedObject : MonoBehaviour 11 | { 12 | public enum EIndex 13 | { 14 | None = -1, 15 | Hmd = (int)OpenVR.k_unTrackedDeviceIndex_Hmd, 16 | Device1, 17 | Device2, 18 | Device3, 19 | Device4, 20 | Device5, 21 | Device6, 22 | Device7, 23 | Device8, 24 | Device9, 25 | Device10, 26 | Device11, 27 | Device12, 28 | Device13, 29 | Device14, 30 | Device15 31 | } 32 | 33 | public EIndex index; 34 | public Transform origin; // if not set, relative to parent 35 | public bool isValid = false; 36 | 37 | private void OnNewPoses(params object[] args) 38 | { 39 | if (index == EIndex.None) 40 | return; 41 | 42 | var i = (int)index; 43 | 44 | isValid = false; 45 | var poses = (Valve.VR.TrackedDevicePose_t[])args[0]; 46 | if (poses.Length <= i) 47 | return; 48 | 49 | if (!poses[i].bDeviceIsConnected) 50 | return; 51 | 52 | if (!poses[i].bPoseIsValid) 53 | return; 54 | 55 | isValid = true; 56 | 57 | var pose = new SteamVR_Utils.RigidTransform(poses[i].mDeviceToAbsoluteTracking); 58 | 59 | if (origin != null) 60 | { 61 | pose = new SteamVR_Utils.RigidTransform(origin) * pose; 62 | pose.pos.x *= origin.localScale.x; 63 | pose.pos.y *= origin.localScale.y; 64 | pose.pos.z *= origin.localScale.z; 65 | transform.position = pose.pos; 66 | transform.rotation = pose.rot; 67 | } 68 | else 69 | { 70 | transform.localPosition = pose.pos; 71 | transform.localRotation = pose.rot; 72 | } 73 | } 74 | 75 | void OnEnable() 76 | { 77 | var render = SteamVR_Render.instance; 78 | if (render == null) 79 | { 80 | enabled = false; 81 | return; 82 | } 83 | 84 | SteamVR_Utils.Event.Listen("new_poses", OnNewPoses); 85 | } 86 | 87 | void OnDisable() 88 | { 89 | SteamVR_Utils.Event.Remove("new_poses", OnNewPoses); 90 | } 91 | 92 | public void SetDeviceIndex(int index) 93 | { 94 | if (System.Enum.IsDefined(typeof(EIndex), index)) 95 | this.index = (EIndex)index; 96 | } 97 | } 98 | 99 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_TrackedObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d37c2cf88f7c59f4c8cf5d3812568143 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_UpdatePoses.cs: -------------------------------------------------------------------------------- 1 | //========= Copyright 2016, Valve Corporation, All rights reserved. =========== 2 | // 3 | // Purpose: Helper to update poses when using native OpenVR integration. 4 | // 5 | //============================================================================= 6 | 7 | using UnityEngine; 8 | using Valve.VR; 9 | 10 | [RequireComponent(typeof(Camera))] 11 | public class SteamVR_UpdatePoses : MonoBehaviour 12 | { 13 | void Awake() 14 | { 15 | var camera = GetComponent(); 16 | #if !(UNITY_5_3 || UNITY_5_2 || UNITY_5_1 || UNITY_5_0) 17 | camera.targetEye = TargetEyeMask.kTargetEyeMaskNone; 18 | #endif 19 | camera.clearFlags = CameraClearFlags.Nothing; 20 | camera.useOcclusionCulling = false; 21 | camera.cullingMask = 0; 22 | camera.depth = -9999; 23 | } 24 | 25 | void OnPreCull() 26 | { 27 | var compositor = OpenVR.Compositor; 28 | if (compositor != null) 29 | { 30 | var render = SteamVR_Render.instance; 31 | compositor.GetLastPoses(render.poses, render.gamePoses); 32 | SteamVR_Utils.Event.Send("new_poses", render.poses); 33 | SteamVR_Utils.Event.Send("new_poses_applied"); 34 | } 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_UpdatePoses.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b61cd59d8f02e454186a61a5f55c21b9 3 | timeCreated: 1457229804 4 | licenseType: Store 5 | MonoImporter: 6 | serializedVersion: 2 7 | defaultReferences: [] 8 | executionOrder: 0 9 | icon: {instanceID: 0} 10 | userData: 11 | assetBundleName: 12 | assetBundleVariant: 13 | -------------------------------------------------------------------------------- /Assets/SteamVR/Scripts/SteamVR_Utils.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: be3c3a084f7b29b4880b42b4cfbf4d8f 3 | MonoImporter: 4 | serializedVersion: 2 5 | defaultReferences: [] 6 | executionOrder: 0 7 | icon: {instanceID: 0} 8 | userData: 9 | assetBundleName: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ba25b7c8383e86a4aa59d6474fcaf82d 3 | folderAsset: yes 4 | timeCreated: 1458326221 5 | licenseType: Free 6 | DefaultImporter: 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/SteamVR/Textures/arrow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/SteamVR/Textures/arrow.png -------------------------------------------------------------------------------- /Assets/SteamVR/Textures/arrow.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2db89a771043d7b4eb9d26622f6b97c7 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 0 9 | linearTexture: 1 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 1024 29 | textureSettings: 30 | filterMode: -1 31 | aniso: 1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 2 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/SteamVR/Textures/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/SteamVR/Textures/background.png -------------------------------------------------------------------------------- /Assets/SteamVR/Textures/background.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bb00cc87e146a414fbf2c4d3c0d31151 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 0 9 | linearTexture: 1 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -1 28 | maxTextureSize: 1024 29 | textureSettings: 30 | filterMode: -1 31 | aniso: 1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 2 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/SteamVR/Textures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/SteamVR/Textures/logo.png -------------------------------------------------------------------------------- /Assets/SteamVR/Textures/logo.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 09db43b3b77bf744287ba587fea02f8b 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 0 9 | linearTexture: 1 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -3 28 | maxTextureSize: 1024 29 | textureSettings: 30 | filterMode: -1 31 | aniso: 1 32 | mipBias: -1 33 | wrapMode: 1 34 | nPOTScale: 0 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 1 46 | textureType: 2 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | assetBundleVariant: 54 | -------------------------------------------------------------------------------- /Assets/SteamVR/Textures/overlay.renderTexture: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!84 &8400000 4 | RenderTexture: 5 | m_ObjectHideFlags: 0 6 | m_PrefabParentObject: {fileID: 0} 7 | m_PrefabInternal: {fileID: 0} 8 | m_Name: overlay 9 | m_ImageContentsHash: 10 | serializedVersion: 2 11 | Hash: 00000000000000000000000000000000 12 | m_Width: 2048 13 | m_Height: 2048 14 | m_AntiAliasing: 8 15 | m_DepthFormat: 0 16 | m_ColorFormat: 0 17 | m_MipMap: 0 18 | m_GenerateMips: 1 19 | m_SRGB: 0 20 | m_TextureSettings: 21 | m_FilterMode: 2 22 | m_Aniso: 9 23 | m_MipBias: 0 24 | m_WrapMode: 1 25 | -------------------------------------------------------------------------------- /Assets/SteamVR/Textures/overlay.renderTexture.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 005ed5a6df2f5ff468efd6497d37fefa 3 | NativeFormatImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/SteamVR/Textures/portalworkshop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/SteamVR/Textures/portalworkshop.png -------------------------------------------------------------------------------- /Assets/SteamVR/Textures/portalworkshop.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a57cd5c56c9d75c4ba0ee9fbc6e1d8df 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | serializedVersion: 2 6 | mipmaps: 7 | mipMapMode: 0 8 | enableMipMap: 1 9 | linearTexture: 0 10 | correctGamma: 0 11 | fadeOut: 0 12 | borderMipMap: 0 13 | mipMapFadeDistanceStart: 1 14 | mipMapFadeDistanceEnd: 3 15 | bumpmap: 16 | convertToNormalMap: 0 17 | externalNormalMap: 0 18 | heightScale: .25 19 | normalMapFilter: 0 20 | isReadable: 0 21 | grayScaleToAlpha: 0 22 | generateCubemap: 0 23 | cubemapConvolution: 0 24 | cubemapConvolutionSteps: 8 25 | cubemapConvolutionExponent: 1.5 26 | seamlessCubemap: 0 27 | textureFormat: -3 28 | maxTextureSize: 1024 29 | textureSettings: 30 | filterMode: 2 31 | aniso: 9 32 | mipBias: -1 33 | wrapMode: -1 34 | nPOTScale: 1 35 | lightmap: 0 36 | rGBM: 0 37 | compressionQuality: 50 38 | spriteMode: 0 39 | spriteExtrude: 1 40 | spriteMeshType: 1 41 | alignment: 0 42 | spritePivot: {x: .5, y: .5} 43 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 44 | spritePixelsToUnits: 100 45 | alphaIsTransparency: 0 46 | textureType: -1 47 | buildTargetSettings: [] 48 | spriteSheet: 49 | sprites: [] 50 | spritePackingTag: 51 | userData: 52 | assetBundleName: 53 | -------------------------------------------------------------------------------- /Assets/SteamVR/quickstart.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/Assets/SteamVR/quickstart.pdf -------------------------------------------------------------------------------- /Assets/SteamVR/quickstart.pdf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e7e681076fb2fad47bed246936de90bf 3 | DefaultImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /Assets/SteamVR/readme.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a51c3dbd81ecb6741b7a2c5b06dbcb2e 3 | TextScriptImporter: 4 | userData: 5 | assetBundleName: 6 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | Copyright (c) 2016 Albert Hwang 3 | 4 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 5 | 6 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 7 | 8 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 9 | -------------------------------------------------------------------------------- /Notes/General.md: -------------------------------------------------------------------------------- 1 | Timing of events 2 | ---------------- 3 | Would like a head-check from someone who knows more about timing to see if I'm doing these things correctly... esp w/ regards to doing the manipulation stuff in the LateUpdate (seems to be the best way to ensure all the focal points have fired appropriately) 4 | 5 | Things to play with later 6 | ------------------------- 7 | There are lots of things that, for the first pass, I'm going to punt on playing with even though I find them compelling. Would be interested to wait and see if there is any need for these features before building out. Here are a few: 8 | 9 | * Handles to constrain rotation / scaling / movement against only one dimension 10 | * Different layers of Focal Points for different controllers (so that each hand can manipulate it's own object) 11 | * Distinguishing between objects and environments... or discovering patterns that properly account for both 12 | * Allowing control on a per user basis 13 | * "Displaced Claw" -- when you grip, the difference of your controller and the claw gets cemented, so if you rotate your hand, the claw only rotates, and if you displace your hand, the claw displaces in a mirrored manner 14 | * menu (swipe right to show menu) that has checkboxes: 15 | * [x] translate 16 | * [x] rotate 17 | * [x] scale 18 | * When the focal point is on the ground, pointing off into the horizon has undesirable results. Would be nice if there were some way to map a sphere around the user onto that surface so that they can move around freely without flying way far off. 19 | -------------------------------------------------------------------------------- /Notes/Technical Architecture.txt: -------------------------------------------------------------------------------- 1 | --------------- 2 | -- Game Objs -- 3 | --------------- 4 | 5 | Game Scene 6 | typical heirarchy 7 | 8 | SteamVR Rig 9 | Controller Left 10 | Claw 11 | Focal Point 1 12 | Focal Point 2 13 | Focal Point 3 14 | Telescope 15 | Laser 16 | 17 | Controller Right 18 | Claw 19 | Focal Point 1 20 | Focal Point 2 21 | Focal Point 3 22 | Telescope 23 | Laser 24 | Camera 25 | 26 | Interaction Layer 27 | Game Subject (whenever being interacted with) 28 | 29 | // down below in prefabs 30 | Prefabs 31 | Focal Point 32 | Claw 33 | 34 | ------------- 35 | -- Scripts -- 36 | ------------- 37 | 38 | TO STEAMVR RIG 39 | ClawVR SteamVR Scaffolding 40 | Focal Point Prefab 41 | Claw Prefab 42 | [x] can select any object 43 | 44 | TO CLAW PREFAB 45 | ClawVR Attachment Renderer 46 | Telescope Sprite 47 | Laser Sprite 48 | 49 | TO FOCAL POINT PREFAB 50 | ClawVR Focal Point Renderer 51 | public color when hover 52 | public color when active 53 | 54 | TO CONTROLLERS 55 | ClawVR Claw Controller 56 | ClawVR Selector 57 | 58 | TO INTERACTION LAYER 59 | ClawVR Interaction Manager.cs 60 | public List controllers 61 | public GameObject FocalPointTemplate (can be left empty to not render) 62 | 63 | TO OBJECTS THAT ARE HANDLEABLE (optional) 64 | ClawVR Manipulation Handler.cs 65 | public: 66 | bool lock translation 67 | bool lock rotation 68 | bool lock scale 69 | bool keeps translation inertia on release 70 | bool keeps rotation inertia on release 71 | bool keeps scale inertia on release 72 | -------------------------------------------------------------------------------- /Notes/User Stories.txt: -------------------------------------------------------------------------------- 1 | key: 2 | [x] done 3 | [-] skip for now 4 | 5 | [ ] Manipulator should be able to (or, Unity dev should feel enabled to create experiences where end users are able to) 6 | [x] WORK WITH POINTS OF TRACTION 7 | [x] assert physical 3d points 8 | [x] activate points 9 | [x] see the focal points 10 | [ ] MOVE CLAW 11 | [ ] telescope the claw in and out (3) 12 | [ ] deploy and retract laser claw (5) 13 | [ ] SELECT THINGS 14 | [ ] select objects (5) 15 | [ ] easily identify which element is selected (3) 16 | [-] change scope of selection 17 | [x] MANIPULATE 18 | [x] translate by moving focal points 19 | [x] scale by moving 2 or more points 20 | [x] rotate by moving 2 or more points 21 | [x] throw things (kinematic vs non, and the transition) 22 | 23 | [ ] Unity Dev should be able to 24 | [ ] LEARN 25 | [ ] see a demo of the tech to understand how it works (8) 26 | [-] read tips on affordance and training the users 27 | [ ] IMPLEMENT 28 | [ ] use only 1 component on the SteamVR object to instantiate everything (5) 29 | [ ] replace each component with their own flavor of the component (3) 30 | [ ] CUSTOMIZE 31 | [x] identify if an object should be freely movable in all dims or not 32 | [-] customize how focal points get placed 33 | [-] customize how focal points look 34 | [-] customize how lasers look 35 | [ ] THINK META 36 | [ ] learn about licensing (2) 37 | [ ] get alerts for updates (2) 38 | 39 | [ ] Library Dev should be able to 40 | [ ] send / retrieve / review PRs (2) 41 | [ ] push updates (2) 42 | -------------------------------------------------------------------------------- /ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/ProjectSettings/AudioManager.asset -------------------------------------------------------------------------------- /ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/ProjectSettings/ClusterInputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/ProjectSettings/DynamicsManager.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/ProjectSettings/EditorBuildSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/ProjectSettings/EditorSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/ProjectSettings/GraphicsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/ProjectSettings/InputManager.asset -------------------------------------------------------------------------------- /ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/ProjectSettings/NavMeshAreas.asset -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/ProjectSettings/NetworkManager.asset -------------------------------------------------------------------------------- /ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/ProjectSettings/Physics2DSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/ProjectSettings/ProjectSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 5.3.3f1 2 | m_StandardAssetsVersion: 0 3 | -------------------------------------------------------------------------------- /ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/ProjectSettings/QualitySettings.asset -------------------------------------------------------------------------------- /ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/ProjectSettings/TagManager.asset -------------------------------------------------------------------------------- /ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/ProjectSettings/TimeManager.asset -------------------------------------------------------------------------------- /ProjectSettings/UnityAdsSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/ProjectSettings/UnityAdsSettings.asset -------------------------------------------------------------------------------- /ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Albert/FocalPointVR/499479f78bbbd44cfcdf894b6e07a5f6c407c028/ProjectSettings/UnityConnectSettings.asset -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | Focal Point 2 | ----------- 3 | 4 | Focal Point is an interaction framework for manipulating objects / environments in VR. It provides solutions for locomotion and object manipulation. More info can be found at the website and Unity asset URL: 5 | 6 | Website: 7 | http://www.albert-hwang.com/focal-point-vr 8 | 9 | Unity Asset: 10 | http://u3d.as/qT7 11 | 12 | 13 | 14 | Notes on the development side of things can be found in the /Notes directory of this repo 15 | 16 | 17 | Version history 18 | --------------- 19 | Version 1.0.0 - Accepted and in asset store 20 | Version 0.0.0 - First pass -- as the sole developer I'll keep this at 0.0.0 until other people depend on it or Unity accepts the asset, at which point I'll tag it at 1.0. I will be submitting it to the asset store shortly. 21 | --------------------------------------------------------------------------------