├── .github ├── ISSUE_TEMPLATE │ └── custom.md └── PULL_REQUEST_TEMPLATE │ └── pull_request_template.md ├── .gitignore ├── .travis.yml ├── .vs ├── VSWorkspaceState.json └── slnx.sqlite ├── Doxyfile ├── Gesturing ├── Assets │ ├── Gestures.meta │ └── Gestures │ │ ├── ExampleScene.meta │ │ ├── ExampleScene │ │ ├── GestureDemoScene.unity │ │ └── GestureDemoScene.unity.meta │ │ ├── Resources.meta │ │ ├── Resources │ │ ├── Default.mat │ │ ├── Default.mat.meta │ │ ├── Floor.mat │ │ ├── Floor.mat.meta │ │ ├── Hand.mat │ │ ├── Hand.mat.meta │ │ ├── Transparent.mat │ │ └── Transparent.mat.meta │ │ ├── Scripts.meta │ │ ├── Scripts │ │ ├── .vs │ │ │ ├── ProjectSettings.json │ │ │ └── slnx.sqlite │ │ ├── Checks.meta │ │ ├── Checks │ │ │ ├── ArcCheck.cs │ │ │ ├── ArcCheck.cs.meta │ │ │ ├── Check.cs │ │ │ ├── Check.cs.meta │ │ │ ├── LineCheck.cs │ │ │ ├── LineCheck.cs.meta │ │ │ ├── RadiusCheck.cs │ │ │ └── RadiusCheck.cs.meta │ │ ├── Controllers.meta │ │ ├── Controllers │ │ │ ├── IController.cs │ │ │ ├── IController.cs.meta │ │ │ ├── TouchController.cs │ │ │ └── TouchController.cs.meta │ │ ├── Core.meta │ │ ├── Core │ │ │ ├── GTransform.cs │ │ │ ├── GTransform.cs.meta │ │ │ ├── GTransformBuffer.cs │ │ │ ├── GTransformBuffer.cs.meta │ │ │ ├── Gesture.cs │ │ │ ├── Gesture.cs.meta │ │ │ ├── GestureEvent.cs │ │ │ ├── GestureEvent.cs.meta │ │ │ ├── GestureMetaData.cs │ │ │ ├── GestureMetaData.cs.meta │ │ │ ├── GestureMonitor.cs │ │ │ └── GestureMonitor.cs.meta │ │ ├── Editor.meta │ │ ├── Editor │ │ │ ├── GestureVisualizerWindow.cs │ │ │ └── GestureVisualizerWindow.cs.meta │ │ ├── Normalizers.meta │ │ ├── Normalizers │ │ │ ├── FittedNormalizer.cs │ │ │ ├── FittedNormalizer.cs.meta │ │ │ ├── LineNormalizer.cs │ │ │ ├── LineNormalizer.cs.meta │ │ │ ├── Normalizer.cs │ │ │ ├── Normalizer.cs.meta │ │ │ ├── ViewNormalizer.cs │ │ │ └── ViewNormalizer.cs.meta │ │ ├── Preset Gestures.meta │ │ └── Preset Gestures │ │ │ ├── CircleGesture.cs │ │ │ ├── CircleGesture.cs.meta │ │ │ ├── HeartGesture.cs │ │ │ ├── HeartGesture.cs.meta │ │ │ ├── SquareGesture.cs │ │ │ ├── SquareGesture.cs.meta │ │ │ ├── TriangleGesture.cs │ │ │ └── TriangleGesture.cs.meta │ │ ├── SimpleHand.cs │ │ ├── SimpleHand.cs.meta │ │ ├── TrackerSetup.cs │ │ └── TrackerSetup.cs.meta ├── Packages │ └── manifest.json └── ProjectSettings │ ├── AudioManager.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── NavMeshAreas.asset │ ├── NetworkManager.asset │ ├── Physics2DSettings.asset │ ├── PresetManager.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── TagManager.asset │ ├── TimeManager.asset │ ├── UnityConnectSettings.asset │ ├── VFXManager.asset │ └── XRSettings.asset ├── LICENSE ├── README.md ├── UI ├── Assets │ ├── OSVR_GUI.meta │ └── OSVR_GUI │ │ ├── Button.meta │ │ ├── Button │ │ ├── ButtonScript.cs │ │ ├── ButtonScript.cs.meta │ │ ├── README.md │ │ └── README.md.meta │ │ ├── DropDown.meta │ │ ├── DropDown │ │ ├── Color Item.prefab │ │ ├── Color Item.prefab.meta │ │ ├── ColorChanging.mat │ │ ├── ColorChanging.mat.meta │ │ ├── DropDownControl.cs │ │ ├── DropDownControl.cs.meta │ │ ├── Example prefabs.meta │ │ ├── Example prefabs │ │ │ ├── Template.prefab │ │ │ ├── Template.prefab.meta │ │ │ ├── bounding box 1.prefab │ │ │ └── bounding box 1.prefab.meta │ │ ├── README.md │ │ ├── README.md.meta │ │ ├── bounding box.prefab │ │ ├── bounding box.prefab.meta │ │ ├── null object.prefab │ │ └── null object.prefab.meta │ │ ├── Keyboard.meta │ │ ├── Keyboard │ │ ├── Keyboard.prefab │ │ ├── Keyboard.prefab.meta │ │ ├── TextScript.cs │ │ └── TextScript.cs.meta │ │ ├── Materials.meta │ │ ├── Materials │ │ ├── Default.mat │ │ ├── Default.mat.meta │ │ ├── Default.shader │ │ ├── Default.shader.meta │ │ ├── Green.mat │ │ ├── Green.mat.meta │ │ ├── Ground.mat │ │ ├── Ground.mat.meta │ │ ├── Ground.shader │ │ ├── Ground.shader.meta │ │ ├── Skybox_Mat.mat │ │ ├── Skybox_Mat.mat.meta │ │ ├── Wall.mat │ │ ├── Wall.mat.meta │ │ ├── Wall.shader │ │ └── Wall.shader.meta │ │ ├── Scenes.meta │ │ ├── Scenes │ │ ├── ExampleScene.unity │ │ └── ExampleScene.unity.meta │ │ ├── Scripts.meta │ │ ├── Scripts │ │ ├── ChangeColor.cs │ │ ├── ChangeColor.cs.meta │ │ ├── DisappearAtDistance.cs │ │ ├── DisappearAtDistance.cs.meta │ │ ├── Pointer.cs │ │ ├── Pointer.cs.meta │ │ ├── README.md │ │ ├── README.md.meta │ │ ├── RotateToUser.cs │ │ ├── RotateToUser.cs.meta │ │ ├── ScaleToUser.cs │ │ ├── ScaleToUser.cs.meta │ │ ├── SetCorrectCameraHeight.cs │ │ ├── SetCorrectCameraHeight.cs.meta │ │ ├── SimpleHand.cs │ │ └── SimpleHand.cs.meta │ │ ├── UIREADME.pdf │ │ └── UIREADME.pdf.meta ├── Packages │ └── manifest.json └── ProjectSettings │ ├── AudioManager.asset │ ├── ClusterInputManager.asset │ ├── DynamicsManager.asset │ ├── EditorBuildSettings.asset │ ├── EditorSettings.asset │ ├── GraphicsSettings.asset │ ├── InputManager.asset │ ├── NavMeshAreas.asset │ ├── NetworkManager.asset │ ├── Physics2DSettings.asset │ ├── PresetManager.asset │ ├── ProjectSettings.asset │ ├── ProjectVersion.txt │ ├── QualitySettings.asset │ ├── TagManager.asset │ ├── TimeManager.asset │ ├── UnityConnectSettings.asset │ ├── VFXManager.asset │ └── XRSettings.asset ├── UIREADME.md ├── docs ├── issue_templates │ └── issue_template.md ├── pull_request_templates │ └── pull_request_template.md └── read_me_templates │ └── read_me_template.md ├── images ├── UIInspector.png ├── XORGesture.png └── XORVisual.png └── scripts └── deploy.sh /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: OSVR Issue Template 3 | about: Basic Issue template for issue based branching workflow 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | # Project 10 | UI/GESTURING 11 | 12 | # Acceptance Criteria 13 | 14 | - [ ] CHECKLIST_ITEM_1 15 | - [ ] CHECKLIST_ITEM_2 16 | - [ ] CHECKLIST_ITEM_3 17 | 18 | ## Notes 19 | 20 | NOTES_FOR_ASSIGNEE 21 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Addressed Issue(s) 2 | 3 | (ISSUE_NUMBER e.g. #10) 4 | 5 | # Goals 6 | 7 | (WHAT PROBLEMS IS IT TRYING TO SOLVE? ...) 8 | 9 | # Special Considerations 10 | 11 | (WHAT DO THE REVIEWERS ALSO NEED TO KNOW? ...) 12 | 13 | # Acceptance Criteria 14 | 15 | (WHAT ARE THE OUTCOMES? ...) 16 | 17 | # Testing 18 | 19 | (HOW DO THE REVIEWERS VERIFY IT WORKS? ...) 20 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /Gesturing/[Tt]emp/ 2 | /Gesturing/[Oo]bj/ 3 | /Gesturing/[Ll]ibrary/ 4 | /Gesturing/[Bb]uild/ 5 | /Gesturing/[Bb]uilds/ 6 | /Gesturing/[Ll]ogs/ 7 | /Gesturing/Assets/AssetStoreTools* 8 | /Gesturing/.vs/* 9 | /Gesturing/.vs.meta 10 | 11 | /Gesturing/Assets/TextMesh*Pro/ 12 | /Gesturing/Assets/TextMesh*Pro.meta 13 | /Gesturing/Assets/Oculus/ 14 | /Gesturing/Assets/Oculus.meta 15 | 16 | /UI/[Tt]emp/ 17 | /UI/[Oo]bj/ 18 | /UI/[Ll]ibrary/ 19 | /UI/[Bb]uild/ 20 | /UI/[Bb]uilds/ 21 | /UI/[Ll]ogs/ 22 | /UI/Assets/AssetStoreTools* 23 | /UI/.vs/* 24 | /UI/.vs.meta 25 | 26 | /UI/Assets/Oculus/ 27 | /UI/Assets/OVRAvatarSDK/ 28 | /UI/Assets/Presets/ 29 | /UI/Assets/Resources/ 30 | /UI/Assets/Settings/ 31 | /UI/Assets/TutorialInfo/ 32 | /UI/Assets/Oculus.meta 33 | /UI/Assets/OVRAvatarSDK.meta 34 | /UI/Assets/Presets.meta 35 | /UI/Assets/Resources.meta 36 | /UI/Assets/Settings.meta 37 | /UI/Assets/TutorialInfo.meta 38 | 39 | 40 | ExportedObj/ 41 | *.svd 42 | *.userprefs 43 | *.csproj 44 | *.pidb 45 | *.suo 46 | *.sln 47 | *.user 48 | *.unityproj 49 | *.booproj 50 | *.pibd.meta 51 | 52 | sysinfo.txt 53 | .DS_Store 54 | ._* 55 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language : generic 2 | 3 | branches: 4 | only: 5 | - master 6 | 7 | addons: 8 | apt: 9 | packages: 10 | - doxygen 11 | 12 | script: bash scripts/deploy.sh -------------------------------------------------------------------------------- /.vs/VSWorkspaceState.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExpandedNodes": [ 3 | "" 4 | ], 5 | "PreviewInSolutionExplorer": false 6 | } -------------------------------------------------------------------------------- /.vs/slnx.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/os-vr/OSVR-Senior-Project/a71e806af8e7d25aec8c3d1dd0d1d53c02307395/.vs/slnx.sqlite -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 70d72f3e8f89f394e80c06af88bb82cf 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/ExampleScene.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8362a3d8b27054247849c0d8d6ec1bc0 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/ExampleScene/GestureDemoScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99c9720ab356a0642a771bea13969a05 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Resources.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 67eafbd3aae62ed4eb70916ca7cbbcf7 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Resources/Default.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Default 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _GLOSSYREFLECTIONS_OFF _SPECULARHIGHLIGHTS_OFF 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0.5 64 | - _GlossyReflections: 0 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 0 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 1, g: 1, b: 1, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 77 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Resources/Default.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c744762b4434160429c61ad2f13cce16 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Resources/Floor.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Floor 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _GLOSSYREFLECTIONS_OFF _SMOOTHNESS_TEXTURE_ALBEDO_CHANNEL_A 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 0.522 64 | - _Glossiness: 0 65 | - _GlossyReflections: 0 66 | - _Metallic: 0.307 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 1 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0, g: 0, b: 0, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Resources/Floor.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6bc0b6104da47f64799e7e77a038b382 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Resources/Hand.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Hand 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0.5 64 | - _GlossyReflections: 1 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 1 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 0.4292453, g: 0.51852643, b: 1, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 77 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Resources/Hand.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 77696ed469ccc2248b60ef86de741975 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Resources/Transparent.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Transparent 11 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: _ALPHAPREMULTIPLY_ON 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: 3000 17 | stringTagMap: 18 | RenderType: Transparent 19 | disabledShaderPasses: [] 20 | m_SavedProperties: 21 | serializedVersion: 3 22 | m_TexEnvs: 23 | - _BumpMap: 24 | m_Texture: {fileID: 0} 25 | m_Scale: {x: 1, y: 1} 26 | m_Offset: {x: 0, y: 0} 27 | - _DetailAlbedoMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _DetailMask: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _DetailNormalMap: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _EmissionMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _MainTex: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _MetallicGlossMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _OcclusionMap: 52 | m_Texture: {fileID: 0} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _ParallaxMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | m_Floats: 60 | - _BumpScale: 1 61 | - _Cutoff: 0.5 62 | - _DetailNormalMapScale: 1 63 | - _DstBlend: 10 64 | - _GlossMapScale: 1 65 | - _Glossiness: 0.5 66 | - _GlossyReflections: 1 67 | - _Metallic: 0 68 | - _Mode: 3 69 | - _OcclusionStrength: 1 70 | - _Parallax: 0.02 71 | - _SmoothnessTextureChannel: 0 72 | - _SpecularHighlights: 1 73 | - _SrcBlend: 1 74 | - _UVSec: 0 75 | - _ZWrite: 0 76 | m_Colors: 77 | - _Color: {r: 1, g: 0, b: 0, a: 0.5019608} 78 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 79 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Resources/Transparent.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 04eb9c2d03039f44b9ac9b1cc3a9d30a 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0eda7be167e316f4589e497fefe1188c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/.vs/ProjectSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "CurrentProjectSetting": null 3 | } -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/.vs/slnx.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/os-vr/OSVR-Senior-Project/a71e806af8e7d25aec8c3d1dd0d1d53c02307395/Gesturing/Assets/Gestures/Scripts/.vs/slnx.sqlite -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Checks.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c297e8f5ec848f24e805f9dd25d02149 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Checks/ArcCheck.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | 7 | namespace Gestures { 8 | 9 | /// 10 | /// A Check to determine whether a point fits inside an Arc. 11 | /// 12 | public class ArcCheck : Check { 13 | 14 | /// 15 | /// Enum describing the orientation of the Arc along the three axes. 16 | /// 17 | public enum ARC_ORIENTATION { 18 | XY, /// Arc orientation is in the XY-plane 19 | YZ, /// Arc orientation is in the YZ-plane 20 | XZ, /// Arc orientation is in the XZ-plane 21 | }; 22 | 23 | private float tolerance; 24 | private Vector3 startPosition; 25 | private float degrees; 26 | private Vector3 center; 27 | private float radius; 28 | private const float eps = 0.01f; 29 | private ARC_ORIENTATION orientation; 30 | 31 | /// 32 | /// Create an Arc Check used to determine whether a point fits inside the defined Arc. 33 | /// 34 | /// The starting position of the arc. 35 | /// Number of degrees to extent. MUST be between -90 and 90 degrees, otherwise unpredictable consequences occur. 36 | /// The center point of circle on which the Arc lies. 37 | /// The distance tolerance from which a point can be considered within the arc 38 | /// ARC_ORIENTATION enum, specifying which plane the arc resides in 39 | public ArcCheck(Vector3 startPosition, float degrees, Vector3 center, float tolerance = 0.4f, ARC_ORIENTATION orientation = ARC_ORIENTATION.XY) { 40 | this.startPosition = startPosition; 41 | this.degrees = Mathf.Clamp(degrees, -90.0f, 90.0f); 42 | this.center = center; 43 | this.radius = Vector3.Distance(center, startPosition); 44 | this.tolerance = tolerance; 45 | this.orientation = orientation; 46 | } 47 | 48 | 49 | private bool IsClockwise(Vector3 v1, Vector3 v2) { 50 | if (orientation == ARC_ORIENTATION.XY) { 51 | return Mathf.Sign(degrees) * (-v1.x * v2.y + v1.y * v2.x) >= 0; 52 | } 53 | 54 | if (orientation == ARC_ORIENTATION.XZ) { 55 | return Mathf.Sign(degrees) * (-v1.z * v2.x + v1.x * v2.z) >= 0; 56 | } 57 | 58 | return Mathf.Sign(degrees) * (-v1.y * v2.z + v1.z * v2.y) >= 0; 59 | } 60 | 61 | /// 62 | /// Determine whether a single GTransform fits inside the area defined by the Arc 63 | /// 64 | /// GTransform to check position against 65 | /// Returns a float (between 0 and 1) representing the distance from the center of the arc, or -1 if the check fails 66 | override public float CheckPasses(GTransform g) { 67 | 68 | Vector3 rotation = new Vector3( 69 | (orientation == ARC_ORIENTATION.YZ) ? 1 : 0, 70 | (orientation == ARC_ORIENTATION.XZ) ? 1 : 0, 71 | (orientation == ARC_ORIENTATION.XY) ? 1 : 0); 72 | Quaternion qrot = Quaternion.Euler(-degrees*rotation); 73 | 74 | Vector3 position = g.position; 75 | Vector3 direction = (position - center).normalized; 76 | Vector3 sectorStart = (startPosition - center).normalized; 77 | Vector3 sectorEnd = (qrot * sectorStart).normalized; 78 | float distance = Vector3.Distance(position, center); 79 | 80 | bool inArc = IsClockwise(sectorStart, direction) && !IsClockwise(sectorEnd, direction); 81 | bool prettyClose = (Vector3.Dot(sectorStart, direction) >= (1.0f - eps)) || (Vector3.Dot(sectorEnd, direction) >= (1.0f - eps)); 82 | bool withinRadius = (distance < radius + tolerance/2.0f && distance > radius - tolerance/2.0f); 83 | 84 | if (withinRadius && (inArc || prettyClose)) { 85 | return Mathf.Abs((distance - radius))/(tolerance/2.0f); 86 | } 87 | return -1; 88 | } 89 | 90 | } 91 | } 92 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Checks/ArcCheck.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cde9fac8cfb4fcf41a2e9ef13afdc1e8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Checks/Check.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | 7 | namespace Gestures { 8 | 9 | /// 10 | /// An abstract class representing a single segment of a Gesture. 11 | /// 12 | /// 13 | /// Current implementations include Lines, Arcs, and Radii, all which deal with the position element of a GTransform 14 | /// 15 | public abstract class Check { 16 | 17 | /// 18 | /// Determine whether a single GTransform passes the Check. 19 | /// 20 | /// GTransform data to compare against the specified Check 21 | /// Returns a float (between 0 and 1) representing the distance from the center of a check, or -1 if the check fails 22 | public abstract float CheckPasses(GTransform transform); 23 | 24 | } 25 | 26 | } -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Checks/Check.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a851d234d20930c49966766ae3817892 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Checks/LineCheck.cs: -------------------------------------------------------------------------------- 1 | using UnityEditor; 2 | using UnityEngine; 3 | 4 | 5 | namespace Gestures { 6 | /// 7 | /// A Check to determine whether a point fits inside a line segment. 8 | /// 9 | public class LineCheck : Check { 10 | 11 | private Vector3 firstPosition; 12 | private Vector3 secondPosition; 13 | private float tolerance; 14 | private LineRenderer lineRenderer; 15 | 16 | /// 17 | /// Create a Line Check used to determine whether a point fits inside the defined line segment. 18 | /// 19 | /// The first point of the line segment. 20 | /// The second point of the line segment. 21 | /// Distance from the line considered to be on the line. 22 | public LineCheck(Vector3 firstPosition, Vector3 secondPosition, float tolerance = 0.4f) { 23 | this.firstPosition = firstPosition; 24 | this.secondPosition = secondPosition; 25 | this.tolerance = tolerance; 26 | } 27 | 28 | 29 | /// 30 | /// Determine whether a single GTransform fits inside the area defined by the line segment 31 | /// 32 | /// GTransform to check position against 33 | /// Returns a float (between 0 and 1) representing the distance from the center of the line, or -1 if the check fails 34 | override public float CheckPasses(GTransform g) { 35 | float distance = Vector3.Distance(g.position, GetClosestPointOnLineSegment(firstPosition, secondPosition, g.position)); 36 | if (distance > tolerance/2.0f) { 37 | return -1; 38 | } 39 | 40 | return distance/(tolerance/2.0f); 41 | } 42 | 43 | 44 | private Vector3 GetClosestPointOnLineSegment(Vector3 A, Vector3 B, Vector3 P) { 45 | Vector3 AP = P - A; 46 | Vector3 AB = B - A; 47 | 48 | float magnitudeAB = AB.sqrMagnitude; 49 | float ABAPproduct = Vector3.Dot(AP, AB); 50 | float distance = ABAPproduct / magnitudeAB; 51 | 52 | if (distance < 0) { 53 | return A; 54 | 55 | } else if (distance > 1) { 56 | return B; 57 | } else { 58 | return A + AB * distance; 59 | } 60 | } 61 | 62 | } 63 | 64 | } -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Checks/LineCheck.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 764912bec288cf3489c56fdc99bdb23f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Checks/RadiusCheck.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEditor; 4 | using UnityEngine; 5 | 6 | 7 | namespace Gestures { 8 | 9 | /// 10 | /// A Check to check if a point is within a certain radius of another point. 11 | /// 12 | public class RadiusCheck : Check { 13 | 14 | private Vector3 position; 15 | private float radius; 16 | 17 | /// 18 | /// Create a Radius Check used to determine whether a point fits inside the defined circular area. 19 | /// 20 | /// The center of the circle 21 | /// A radius tolerance away from the center 22 | public RadiusCheck(Vector3 position, float radius = 0.4f) { 23 | this.position = position; 24 | this.radius = radius; 25 | } 26 | 27 | /// 28 | /// Determine whether a single GTransform fits inside the area defined by the circle 29 | /// 30 | /// GTransform to check position against 31 | /// Returns a float (between 0 and 1) representing the distance from the center of the circle, or -1 if the check fails 32 | override public float CheckPasses(GTransform gTransform) { 33 | float distance = Vector3.Distance(gTransform.position, position); 34 | if (distance > radius) { 35 | return -1; 36 | } 37 | return 1; 38 | } 39 | 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Checks/RadiusCheck.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57ccd41d2776b4f4ebe67bfbce9a6c7a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Controllers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d2230144cc240cf46a66d0d908e400cc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Controllers/IController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace Gestures 6 | { 7 | /// 8 | /// Abstract class which is responsible for tracking transform data for a VR headset. 9 | /// 10 | /// 11 | /// Although we have only provided support for Oculus Rift Touch Controllers, any headset may be used if an appropriate concrete implementation of this class is created 12 | /// 13 | public abstract class IController : MonoBehaviour { 14 | 15 | /// 16 | /// Generate the data representing the necessary transform data for a given controller 17 | /// 18 | /// Returns `GTransform` instance containing transform data 19 | public abstract GTransform QueryGTransform(); 20 | 21 | /// 22 | /// This method will query the controller to determine whether the gesture should be tracked or not. 23 | /// 24 | /// 25 | /// The most common implementation of this method simply returns whether a specific button is pressed. 26 | /// 27 | /// Return `true` if a gesture should be active, `false` otherwise 28 | public abstract bool GestureActive(); 29 | 30 | } 31 | } 32 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Controllers/IController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8c16155e19d2fb34a8b3adc15a8c136b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Controllers/TouchController.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace Gestures 6 | { 7 | /// 8 | /// A concrete implementation of the IController class, targeted at the Oculus Rift Touch Controllers 9 | /// 10 | public class TouchController : IController 11 | { 12 | /// The Touch Controller to use. Typically LTouch or RTouch for left and right hands. 13 | public OVRInput.Controller controllerType; 14 | 15 | /// The controller button which will activate a gesture 16 | public OVRInput.Button gestureActiveButton; 17 | 18 | /// The frequency of the controller vibration when the gestureActiveButton is pressed 19 | public float vibrationFrequency = 0.2f; 20 | 21 | /// The amplitude of the controller vibration when the gestureActiveButton is pressed 22 | public float vibrationAmplitude = 0.2f; 23 | 24 | /// 25 | /// Generate the data representing the position, rotation, velocity, and timing data for the controller 26 | /// 27 | /// 28 | /// Velocity depends on OVRInput.GetLocalControllerVelocity. 29 | /// 30 | /// Returns `GTransform` instance containing transform data 31 | public override GTransform QueryGTransform() 32 | { 33 | Vector3 vel = OVRInput.GetLocalControllerVelocity(controllerType); 34 | return new GTransform(transform.position, transform.rotation, vel, Time.time); 35 | } 36 | 37 | /// 38 | /// This method will query the controller to determine whether the gesture activation button is pressed on the correct controller 39 | /// 40 | /// Return `true` if the user is pressing the gesture button, `false` otherwise 41 | public override bool GestureActive() 42 | { 43 | bool isActive = OVRInput.Get(gestureActiveButton, controllerType); 44 | SetVibration(isActive); 45 | return isActive; 46 | } 47 | 48 | /// 49 | /// Set the controller vibration 50 | /// 51 | /// This functionality notifies the user that a gesture is active. It can be disabled by setting the frequency and amplitude of vibration to 0 52 | /// Boolean to indicate whether to enable or disable vibrations 53 | private void SetVibration(bool isActive) 54 | { 55 | int modifier = isActive ? 1 : 0; 56 | OVRInput.SetControllerVibration(vibrationFrequency * modifier, vibrationAmplitude * modifier, controllerType); 57 | } 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Controllers/TouchController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1e1f2f6e529adb1469e3574f6ed92dd7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Core.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c5d82009b6eda440842364a7a76ac5b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Core/GTransform.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using System; 5 | 6 | namespace Gestures { 7 | 8 | /// 9 | /// Data class to contain all necessary information related to a controller transform 10 | /// 11 | public class GTransform { 12 | 13 | /// 14 | /// The position vector generated by the IController 15 | /// 16 | public Vector3 position; 17 | 18 | /// 19 | /// The rotation Quaternion generated by the IController 20 | /// 21 | public Quaternion rotation; 22 | 23 | /// 24 | /// The velocity vector generated by the IController 25 | /// 26 | public Vector3 velocity; 27 | 28 | /// 29 | /// The current time at which the GTransform was generated 30 | /// 31 | /// 32 | /// Best practice is using Time.time, or some time from an independent epoch. 33 | /// 34 | public float time; 35 | 36 | /// 37 | /// Create a GTransform objet with the specified position, quaternion, velocity, and time data points. 38 | /// 39 | /// The position Vector3 generated by the IController 40 | /// The rotation quaternion generated by the IController 41 | /// The velocity Vector3 generated by the IController 42 | /// The current time as determined by the IController 43 | public GTransform(Vector3 pos, Quaternion quat, Vector3 vel, float t) { 44 | position = pos; 45 | rotation = quat; 46 | velocity = vel; 47 | time = t; 48 | } 49 | 50 | /// 51 | /// Create a copy of the GTransform instance 52 | /// 53 | /// 54 | /// Return new `GTransform` with the same data as the object this method was called on. 55 | /// 56 | public GTransform Copy() { 57 | return new GTransform(position, rotation, velocity, time); 58 | } 59 | } 60 | } 61 | 62 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Core/GTransform.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 736b59e1b52675c45bfc13bdba146910 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Core/GTransformBuffer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace Gestures { 7 | 8 | /// 9 | /// Internal data storage class which can behave as either a set-size array or a circular array. 10 | /// 11 | public class GTransformBuffer : IEnumerable { 12 | 13 | private int maxSize; 14 | private bool circular = false; 15 | private LinkedList data; 16 | 17 | /// 18 | /// Create a GTransformBuffer with a specified max size. 19 | /// 20 | /// The desired max size of the GTransformBuffer 21 | public GTransformBuffer(int maxSize) { 22 | this.data = new LinkedList(); 23 | this.maxSize = maxSize; 24 | } 25 | 26 | public void Enqueue(GTransform t) { 27 | if (data.Count >= maxSize) { 28 | if (circular) { 29 | Dequeue(); 30 | } else { 31 | return; 32 | } 33 | } 34 | data.AddLast(t); 35 | } 36 | /// 37 | /// Sets the max size of the buffer. 38 | /// 39 | /// 40 | public void SetMaxSize(int maxSize) { 41 | this.maxSize = maxSize; 42 | } 43 | /// 44 | /// Sets the circular behavior according to the specified parameter. 45 | /// 46 | /// 47 | public void SetCircular(bool circular) { 48 | this.circular = circular; 49 | } 50 | 51 | /// 52 | /// Returns the number of elements in the buffer. 53 | /// 54 | /// 55 | public int Size() { 56 | return data.Count; 57 | } 58 | 59 | /// 60 | /// Removes the first element of the buffer. 61 | /// 62 | public void Dequeue() { 63 | data.RemoveFirst(); 64 | } 65 | 66 | /// 67 | /// Clears the buffer. 68 | /// 69 | public void Clear() { 70 | data.Clear(); 71 | } 72 | 73 | /// 74 | /// Generates the Enumerator over the GTransforms in the buffer. 75 | /// 76 | /// IEnumerator of GTransform data points 77 | public IEnumerator GetEnumerator() { 78 | foreach (GTransform t in data) { 79 | yield return t; 80 | } 81 | } 82 | 83 | /// 84 | /// Returns the Enumerator over the GTransforrms in the buffer. 85 | /// 86 | /// 87 | IEnumerator IEnumerable.GetEnumerator() { 88 | return GetEnumerator(); 89 | } 90 | 91 | /// 92 | /// Returns the GTransformBuffer contents as a GTransform[] array; 93 | /// 94 | /// GTransform array of the contents of the buffer. 95 | public Vector3[] ToArray() { 96 | Vector3[] ret = new Vector3[data.Count]; 97 | int counter = 0; 98 | foreach (GTransform g in data) { 99 | ret[counter++] = g.position; 100 | if(counter >= maxSize) { 101 | break; 102 | } 103 | } 104 | return ret; 105 | } 106 | 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Core/GTransformBuffer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d836ca72c20f15040993dd6d796d9543 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Core/Gesture.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8dba3198d03020f4c97fe81fc768cf72 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Core/GestureEvent.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.Events; 5 | 6 | namespace Gestures { 7 | /// 8 | /// Wrapper class for a Unity Event that takes in GestureMetaData as a parameter. 9 | /// 10 | public class GestureEvent : UnityEvent { 11 | public GestureEvent() : base() {} 12 | public GestureEvent(UnityAction action) : base() { 13 | this.AddListener(action); 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Core/GestureEvent.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 49837c54492818c4eaec00e5bd39de03 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Core/GestureMetaData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | 6 | namespace Gestures { 7 | /// 8 | /// A data container class to store extra meta data about the completed gesture 9 | /// 10 | public class GestureMetaData { 11 | /// The scale of the gesture in world-space 12 | public Vector3 scale; 13 | 14 | /// The center of the gesture in world-space 15 | public Vector3 centroid; 16 | 17 | /// The name of the completed gesture. 18 | public string name = "NO_GESTURE"; 19 | 20 | /// The number of points used to draw the gesture 21 | public int pointCount; 22 | 23 | /// The total time it took to draw the gesture 24 | public float time; 25 | 26 | /// A measure of how close a gesture was to the exact definition. A perfect gesture has a precision of 0, a gesture that barely passes has a precision of 1 27 | public float precision; 28 | 29 | /// The average speed of the user's hand over the course of the gesture 30 | public float averageSpeed = 0.0f; 31 | 32 | /// 33 | /// Static helper method to convert a list of transforms into a partially complete GestureMetaData object 34 | /// 35 | /// The list of raw GTransform data 36 | /// Returns a `GestureMetaData` instance with fields populated 37 | public static GestureMetaData GetGestureMetaData(List transforms) { 38 | Vector3 min = transforms[0].position; 39 | Vector3 max = transforms[0].position; 40 | Vector3 centroid = new Vector3(0, 0, 0); 41 | float speed = 0.0f; 42 | int count = transforms.Count; 43 | for (int i = 0; i < count; i++) { 44 | Vector3 pos = transforms[i].position; 45 | min = new Vector3(Math.Min(pos.x, min.x), Math.Min(pos.y, min.y), Math.Min(pos.z, min.z)); 46 | max = new Vector3(Math.Max(pos.x, max.x), Math.Max(pos.y, max.y), Math.Max(pos.z, max.z)); 47 | centroid += pos; 48 | 49 | speed += transforms[i].velocity.magnitude; 50 | } 51 | GestureMetaData ret = new GestureMetaData(); 52 | 53 | ret.scale = max - min; 54 | ret.centroid = centroid / count; 55 | ret.pointCount = count; 56 | ret.time = transforms[count - 1].time - transforms[0].time; 57 | ret.averageSpeed = speed / count; 58 | 59 | return ret; 60 | } 61 | 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Core/GestureMetaData.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 34b5d1e15f951b445a02850b67d66b7b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Core/GestureMonitor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2cacdbd68ba22e46992ef1232c34b17 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 368d6319ece373c48ac350b03aee7505 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Editor/GestureVisualizerWindow.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f4b075b02fe56841accaa2387b74301 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Normalizers.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f0256cef885262d4aa6c3f77560b38af 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Normalizers/FittedNormalizer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace Gestures { 6 | 7 | /// 8 | /// Fitted Normalizer will be the standard normalizer for any 2D or 3D Gestures. 9 | /// 10 | public class FittedNormalizer : Normalizer { 11 | 12 | private Vector3 bottomLeft, topRight; 13 | private bool maintainAspectRatio; 14 | 15 | /// 16 | /// Create a new FittedNormalizer with bounds of Vector3(-1, -1, 0), Vector3(1, 1, 0) 17 | /// 18 | public FittedNormalizer() : this(new Vector3(-1, -1, 0), new Vector3(1, 1, 0)) { } 19 | 20 | /// 21 | /// Create a new Fitted Normalizer with specific bounds 22 | /// 23 | /// Vector3 defining the bottomleft-most coordinate of the bounding box encompassing the Gesture 24 | /// Vector3 defining the topright-most coordinate of the bounding box encompassing the Gesture 25 | /// `True` if the Gesture must be performed such that the aspect ratio of the drawn figure matches the aspect ratio of the Gesture definition. Most of the time, this should be `False` 26 | public FittedNormalizer(Vector3 bottomLeft, Vector3 topRight, bool maintainAspectRatio = false) { 27 | this.topRight = topRight; 28 | this.bottomLeft = bottomLeft; 29 | this.maintainAspectRatio = maintainAspectRatio; 30 | } 31 | 32 | private delegate float MinMaxDelegate(float a, float b); // used internally to apply min / max arbitrarily to vectors 33 | private Vector3 ApplyPredToVector(Vector3 a, Vector3 b, MinMaxDelegate pred) { 34 | return new Vector3(pred(a.x, b.x), pred(a.y, b.y), pred(a.z, b.z)); 35 | } 36 | 37 | private Vector3 Inverse(Vector3 vec) { 38 | float ix = (vec.x != 0) ? 1.0f / vec.x : 0.0f; 39 | float iy = (vec.y != 0) ? 1.0f / vec.y : 0.0f; 40 | float iz = (vec.z != 0) ? 1.0f / vec.z : 0.0f; 41 | return new Vector3(ix, iy, iz); 42 | } 43 | 44 | /// 45 | /// Normalizes the GTransforms with respect to the bounding box FittedNormalizer was initialized with. 46 | /// 47 | /// List of GTramsforms 48 | /// 49 | public List Normalize(List data) { 50 | List normalizedData = new List(); 51 | 52 | int count = data.Count; 53 | if(count == 0) { 54 | return normalizedData; 55 | } 56 | 57 | Vector3 range = new Vector3(0, 0, 0); 58 | Vector3 min = data[0].position; 59 | Vector3 max = data[0].position; 60 | 61 | 62 | for (int i = 0; i < data.Count; i++) { 63 | GTransform trans = data[i].Copy(); 64 | Vector3 pos = trans.position; 65 | 66 | min = ApplyPredToVector(min, pos, Mathf.Min); 67 | max = ApplyPredToVector(max, pos, Mathf.Max); 68 | 69 | normalizedData.Add(trans); 70 | } 71 | 72 | range = max - min; 73 | 74 | if (maintainAspectRatio) { 75 | float xRange = (topRight.x - bottomLeft.x); 76 | float yRange = (topRight.y - bottomLeft.y); 77 | float zRange = (topRight.z - bottomLeft.z); 78 | 79 | if (xRange != 0) { 80 | range.y = (yRange / xRange) * range.x; 81 | range.z = (zRange / xRange) * range.x; 82 | } 83 | } 84 | 85 | for (int i = 0; i < data.Count; i++) { 86 | GTransform trans = normalizedData[i]; 87 | 88 | trans.position -= min; 89 | 90 | Vector3 v = (topRight - bottomLeft); 91 | v.Scale(Inverse(range)); 92 | trans.position.Scale(v); 93 | 94 | trans.position += bottomLeft; 95 | } 96 | 97 | return normalizedData; 98 | } 99 | 100 | } 101 | } 102 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Normalizers/FittedNormalizer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b6d2e5083806db4e8a7e5ee4cbe4c6b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Normalizers/LineNormalizer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace Gestures { 6 | 7 | /// 8 | /// A Normalizer that only works to normalize single line segments. 9 | /// 10 | /// 11 | /// The class has little use outside of detecting horizontal and vertical lines 12 | /// 13 | public class LineNormalizer : Normalizer { 14 | 15 | 16 | /// 17 | /// Normalizes the series of GTransforms with respect to the proportion of X / Y scale in the given data. 18 | /// 19 | /// 20 | /// Works for horizontal and vertical lines in the viewing plane. 21 | /// 22 | /// 23 | /// 24 | public List Normalize(List data) { 25 | List normalizedData = new List(); 26 | 27 | if(data.Count == 0) { 28 | return normalizedData; 29 | } 30 | 31 | Vector3 first = data[0].position; 32 | Vector3 last = data[data.Count - 1].position; 33 | 34 | Vector2 percentage = (last - first).normalized; 35 | 36 | for (int i = 0; i < data.Count; i++) { 37 | GTransform trans = data[i].Copy(); 38 | trans.position -= first; 39 | trans.position.z = 0; 40 | 41 | normalizedData.Add(trans); 42 | } 43 | 44 | last = normalizedData[data.Count - 1].position; 45 | for (int i = 0; i < data.Count; i++) { 46 | GTransform trans = normalizedData[i]; 47 | trans.position.x *= percentage.x * (2.0f / last.x); 48 | trans.position.y *= percentage.y * (2.0f / last.y); 49 | trans.position -= new Vector3(1 * percentage.x, 1 * percentage.y, 0); 50 | 51 | } 52 | 53 | 54 | return normalizedData; 55 | 56 | } 57 | 58 | public Vector2 Abs(Vector2 v) { 59 | v.x = Mathf.Abs(v.x); 60 | v.y = Mathf.Abs(v.y); 61 | return v; 62 | } 63 | 64 | 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Normalizers/LineNormalizer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b39dffdbae146ea4fabb7fb47303e6f7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Normalizers/Normalizer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace Gestures { 7 | 8 | /// 9 | /// Multipurpose interface for normalizing data into a form that can be more easily recognized by the gesture detection algorithm. 10 | /// 11 | public interface Normalizer { 12 | /// 13 | /// Normalize a set of points into a form that is easier for the system to interpret 14 | /// 15 | /// List of GTransform data to normalize 16 | /// List of normalized GTransforms 17 | List Normalize(List data); 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Normalizers/Normalizer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e670d130dfc1ee47abb5f931242d2ac 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Normalizers/ViewNormalizer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace Gestures{ 6 | 7 | /// 8 | /// Normalizer implementation that takes the raw world-space GTransform data and rotates it about the user's position. 9 | /// 10 | /// 11 | /// The algorithm behind this class is not perfect yet. There are still problems with gestures that are too far above or below the user's eyeline 12 | /// 13 | public class ViewNormalizer : Normalizer { 14 | 15 | private Transform userTransform; //transform for the user's gameObject to be used in normalization 16 | private Vector3 forward = new Vector3(0, 0, 1); 17 | 18 | /// 19 | /// Creates a ViewNormalizer based on the provided transform of the user's gameObject. 20 | /// 21 | /// 22 | public ViewNormalizer(Transform userTransform) { 23 | this.userTransform = userTransform; 24 | } 25 | 26 | /// 27 | /// Rotates the GTransforms to in front of the user gameObject. 28 | /// 29 | /// 30 | /// 31 | public List Normalize(List data) { 32 | Vector3 centroid = new Vector3(0, 0, 0); 33 | int count = data.Count; 34 | List normalizedData = new List(); 35 | 36 | if(count == 0) { 37 | return normalizedData; 38 | } 39 | 40 | for (int i = 0; i < data.Count; i++) { 41 | GTransform trans = data[i].Copy(); 42 | centroid += trans.position; 43 | normalizedData.Add(trans); 44 | } 45 | 46 | 47 | centroid /= count; 48 | Vector3 userPosition = userTransform.position; 49 | Vector3 direction = (centroid - userPosition); 50 | 51 | float dp = Vector3.Dot(new Vector3(direction.x, 0, direction.z).normalized, direction.normalized); 52 | float angle = -Mathf.Sign(direction.y) * Mathf.Acos(dp); 53 | Quaternion rotation = Quaternion.AngleAxis(-angle * 360 / (2 * Mathf.PI), new Vector3(direction.z, 0, -direction.x).normalized); 54 | 55 | centroid = rotation * (centroid - userPosition) + userPosition; 56 | centroid = normalizedData[0].position; 57 | Vector3 direction2 = (centroid - userPosition).normalized; 58 | Quaternion rotation2 = Quaternion.FromToRotation(new Vector3(direction2.x, 0, direction2.z), forward); 59 | 60 | 61 | for (int i = 0; i < data.Count; i++) { 62 | GTransform trans = normalizedData[i]; 63 | 64 | trans.position = rotation * (trans.position - userPosition) + userPosition; 65 | trans.position = rotation2 * (trans.position - userPosition) + userPosition; 66 | } 67 | 68 | return normalizedData; 69 | } 70 | 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Normalizers/ViewNormalizer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d960613c86bf2ae418d9ae298abb23aa 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Preset Gestures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 386ca03d6199dee4e9761ea64ae216ee 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Preset Gestures/CircleGesture.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace Gestures { 6 | /// 7 | /// A Circular Gesture 8 | /// 9 | /// A proper aspect-ratio is necessary to complete this gesture. As such, an oval or ellipsoid shape will not be detected 10 | public class CircleGesture : Gesture { 11 | 12 | /// 13 | /// Create a Circle Gesture with a specified tolerance. 14 | /// 15 | /// The tolerance value for the circle gesture. Default is 0.4f 16 | public CircleGesture(float tolerance = 0.4f) : base() { 17 | this.AddChecks(new List { 18 | new ArcCheck(new Vector3(0, 1, 0), 90, new Vector3(0,0,0), tolerance), 19 | new ArcCheck(new Vector3(1, 0, 0), 90, new Vector3(0,0,0), tolerance), 20 | new ArcCheck(new Vector3(0, -1, 0), 90, new Vector3(0,0,0), tolerance), 21 | new ArcCheck(new Vector3(-1, 0, 0), 90, new Vector3(0,0,0), tolerance), 22 | }) 23 | .SetNormalizer(new FittedNormalizer(new Vector3(-1, -1, 0), new Vector3(1, 1, 0), true)); 24 | 25 | } 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Preset Gestures/CircleGesture.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 45a3425caf095c6428484875148fd214 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Preset Gestures/HeartGesture.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace Gestures{ 7 | /// 8 | /// A Heart-Shaped Gesture 9 | /// 10 | public class HeartGesture : Gesture { 11 | 12 | /// 13 | /// Create a Heart Gesture with a specified tolerance. 14 | /// 15 | /// The tolerance value for the lines and arcs of the heart. Default is 0.4f 16 | public HeartGesture(float tolerance = 0.4f) : base() { 17 | this.AddChecks(new List{ 18 | 19 | new ArcCheck(new Vector3(0, .5f, 0), 90, new Vector3(.5f, .5f, 0), tolerance), 20 | new ArcCheck(new Vector3(.5f, 1.0f, 0), 90, new Vector3(.5f, .5f, 0), tolerance), 21 | new ArcCheck(new Vector3(-1, .5f, 0), 90, new Vector3(-.5f, .5f, 0), tolerance), 22 | new ArcCheck(new Vector3(-.5f, 1.0f, 0), 90, new Vector3(-.5f, .5f, 0), tolerance), 23 | new LineCheck(new Vector3(0, -1f, 0), new Vector3(.75f, -.25f, 0), tolerance), 24 | new LineCheck(new Vector3(0, -1f, 0), new Vector3(-.75f, -.25f, 0), tolerance), 25 | new LineCheck(new Vector3(.75f, -.25f, 0), new Vector3(1f, .5f, 0), tolerance), 26 | new LineCheck(new Vector3(-.75f, -.25f, 0), new Vector3(-1f, .5f, 0), tolerance), 27 | 28 | new RadiusCheck(new Vector3(0, .5f, 0), .25f) 29 | }) 30 | .SetNormalizer(new FittedNormalizer(new Vector3(-1, -1, 0), new Vector3(1, 1, 0))); 31 | 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Preset Gestures/HeartGesture.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f2efb1dc62b21f248934f3f6f4d4b5ca 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Preset Gestures/SquareGesture.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace Gestures { 6 | /// 7 | /// A Square Gesture 8 | /// 9 | /// A proper aspect-ratio is NOT necessary to complete this gesture. Any sufficiently rectangular shape will be detected 10 | public class SquareGesture : Gesture { 11 | 12 | /// 13 | /// Create a Square Gesture with a specified tolerance. 14 | /// 15 | /// The tolerance value for the edges of the square. Default is 0.4f 16 | public SquareGesture(float tolerance = 0.4f) : base() 17 | { 18 | this.AddChecks(new List { 19 | new LineCheck(new Vector3(1, 1, 0), new Vector3(-1, 1, 0), tolerance), 20 | new LineCheck(new Vector3(-1, 1, 0), new Vector3(-1, -1, 0), tolerance), 21 | new LineCheck(new Vector3(-1, -1, 0), new Vector3(1, -1, 0), tolerance), 22 | new LineCheck(new Vector3(1, -1, 0), new Vector3(1, 1, 0), tolerance), 23 | 24 | new RadiusCheck(new Vector3(1, 1, 0), tolerance/2), 25 | new RadiusCheck(new Vector3(-1, 1, 0), tolerance/2), 26 | new RadiusCheck(new Vector3(-1, -1, 0), tolerance/2), 27 | new RadiusCheck(new Vector3(1, -1, 0), tolerance/2), 28 | }) 29 | .SetNormalizer(new FittedNormalizer(new Vector3(-1, -1, 0), new Vector3(1, 1, 0))); 30 | 31 | } 32 | } 33 | } 34 | 35 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Preset Gestures/SquareGesture.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 62440a2a962b5894899c40e3fc5fbd6e 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Preset Gestures/TriangleGesture.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | 6 | namespace Gestures { 7 | /// 8 | /// A Triangular Gesture. 9 | /// 10 | public class TriangleGesture : Gesture { 11 | 12 | /// 13 | /// Create a Triangle Gesture with a specified tolerance. 14 | /// 15 | /// The tolerance value for the edges of the triangle. Default is 0.4f 16 | public TriangleGesture(float tolerance = 0.4f) : base() { 17 | this.AddChecks(new List { 18 | new LineCheck(new Vector3(-1, -1, 0), new Vector3(0, 1.0f, 0)), 19 | new LineCheck(new Vector3(0, 1.0f, 0), new Vector3(1, -1, 0)), 20 | new LineCheck(new Vector3(1, -1, 0),new Vector3(-1, -1, 0)) 21 | }) 22 | .SetNormalizer(new FittedNormalizer(new Vector3(-1, -1, 0), new Vector3(1, 1, 0))); 23 | 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/Scripts/Preset Gestures/TriangleGesture.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f99f312fb2d9b6243b2ef34a1bdc9e86 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/SimpleHand.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | /// 6 | /// Extremely simple class for setting up a hand that moves with the position and rotation of an Oculus Touch Controller. 7 | /// 8 | public class SimpleHand : MonoBehaviour { 9 | 10 | public OVRInput.Controller controllerType; 11 | 12 | void Update () { 13 | transform.localPosition = OVRInput.GetLocalControllerPosition(controllerType); 14 | transform.localRotation = OVRInput.GetLocalControllerRotation(controllerType); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/SimpleHand.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7b1818a9815a41143a0a4459ec61bde7 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/TrackerSetup.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using Gestures; 5 | using UnityEngine.Events; 6 | 7 | 8 | public class TrackerSetup : MonoBehaviour { 9 | 10 | public TextMesh text; 11 | private GestureMonitor tracker; 12 | public LineRenderer lineRenderer; 13 | public IController controller; 14 | 15 | void Start () { 16 | tracker = gameObject.AddComponent(); 17 | tracker.controller = controller; 18 | tracker.lineRenderer = lineRenderer; 19 | 20 | GenerateGestures(); 21 | 22 | tracker.AddGestureCompleteCallback(GestureComplete); 23 | tracker.AddGestureFailedCallback(GestureFailed); 24 | tracker.AddGestureStartCallback(GestureStart); 25 | 26 | } 27 | 28 | 29 | void GestureStart() { 30 | lineRenderer.startColor = Color.blue; 31 | lineRenderer.endColor = Color.blue; 32 | } 33 | 34 | 35 | void GestureComplete(GestureMetaData data) { 36 | lineRenderer.startColor = Color.green; 37 | lineRenderer.endColor = Color.green; 38 | 39 | SetText(data); 40 | } 41 | 42 | 43 | void GestureFailed(GestureMetaData data) { 44 | string newText = "Result: " + "None" + ""; 45 | text.text = newText; 46 | } 47 | 48 | 49 | void GenerateGestures() { 50 | 51 | tracker.AddGesture("Square", new SquareGesture(.6f)); 52 | tracker.AddGesture("Circle", new CircleGesture(.4f)); 53 | tracker.AddGesture("Triangle", new TriangleGesture(.8f)); 54 | tracker.AddGesture("Heart", new HeartGesture()); 55 | 56 | tracker.AddGesture("Letter-S", new Gesture().AddChecks(new List { 57 | new ArcCheck(new Vector3(.5f, .5f, 0), -90, new Vector3(0,.5f,0)), 58 | new ArcCheck(new Vector3(0, 1, 0), -90, new Vector3(0,.5f,0)), 59 | new ArcCheck(new Vector3(-.5f,.5f,0), -90, new Vector3(0,.5f,0)), 60 | 61 | new ArcCheck(new Vector3(0, 0, 0), 90, new Vector3(0,-.5f,0)), 62 | new ArcCheck(new Vector3(.5f,-.5f,0), 90, new Vector3(0,-.5f,0)), 63 | new ArcCheck(new Vector3(0,-1,0), 90, new Vector3(0,-.5f,0)) }) 64 | 65 | .SetNormalizer(new FittedNormalizer(new Vector3(-.5f, -1.0f, 0), new Vector3(.5f, 1.0f, 0)))); 66 | 67 | 68 | tracker.AddGesture("Plus", new Gesture().AddChecks(new List() { 69 | new LineCheck(new Vector3(-1,0,0), new Vector3(1,0,0)), 70 | new LineCheck(new Vector3(0,-1,0), new Vector3(0,1,0)), 71 | 72 | new RadiusCheck(new Vector3(-1,0,0)), 73 | new RadiusCheck(new Vector3(1,0,0)), 74 | new RadiusCheck(new Vector3(0,-1,0)), 75 | new RadiusCheck(new Vector3(0,1,0)), 76 | 77 | }).SetNormalizer(new FittedNormalizer())); 78 | 79 | } 80 | 81 | 82 | 83 | private void SetText(GestureMetaData data) { 84 | string newText = "Result: " + data.name + ""; 85 | text.text = newText; 86 | } 87 | 88 | } 89 | -------------------------------------------------------------------------------- /Gesturing/Assets/Gestures/TrackerSetup.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8113374cd556ae54b9cd7e7cf6def8e2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Gesturing/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ads": "2.3.1", 4 | "com.unity.analytics": "3.3.2", 5 | "com.unity.collab-proxy": "1.2.16", 6 | "com.unity.multiplayer-hlapi": "1.0.2", 7 | "com.unity.package-manager-ui": "2.1.2", 8 | "com.unity.purchasing": "2.0.6", 9 | "com.unity.textmeshpro": "2.0.0", 10 | "com.unity.timeline": "1.0.0", 11 | "com.unity.xr.legacyinputhelpers": "2.0.2", 12 | "com.unity.xr.oculus.standalone": "1.29.1", 13 | "com.unity.modules.ai": "1.0.0", 14 | "com.unity.modules.animation": "1.0.0", 15 | "com.unity.modules.assetbundle": "1.0.0", 16 | "com.unity.modules.audio": "1.0.0", 17 | "com.unity.modules.cloth": "1.0.0", 18 | "com.unity.modules.director": "1.0.0", 19 | "com.unity.modules.imageconversion": "1.0.0", 20 | "com.unity.modules.imgui": "1.0.0", 21 | "com.unity.modules.jsonserialize": "1.0.0", 22 | "com.unity.modules.particlesystem": "1.0.0", 23 | "com.unity.modules.physics": "1.0.0", 24 | "com.unity.modules.physics2d": "1.0.0", 25 | "com.unity.modules.screencapture": "1.0.0", 26 | "com.unity.modules.terrain": "1.0.0", 27 | "com.unity.modules.terrainphysics": "1.0.0", 28 | "com.unity.modules.tilemap": "1.0.0", 29 | "com.unity.modules.ui": "1.0.0", 30 | "com.unity.modules.uielements": "1.0.0", 31 | "com.unity.modules.umbra": "1.0.0", 32 | "com.unity.modules.unityanalytics": "1.0.0", 33 | "com.unity.modules.unitywebrequest": "1.0.0", 34 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 35 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 36 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 37 | "com.unity.modules.unitywebrequestwww": "1.0.0", 38 | "com.unity.modules.vehicles": "1.0.0", 39 | "com.unity.modules.video": "1.0.0", 40 | "com.unity.modules.vr": "1.0.0", 41 | "com.unity.modules.wind": "1.0.0", 42 | "com.unity.modules.xr": "1.0.0" 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /Gesturing/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 1024 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /Gesturing/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /Gesturing/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 1 23 | m_ClothInterCollisionSettingsToggle: 0 24 | m_ContactPairsMode: 0 25 | m_BroadphaseType: 0 26 | m_WorldBounds: 27 | m_Center: {x: 0, y: 0, z: 0} 28 | m_Extent: {x: 250, y: 250, z: 250} 29 | m_WorldSubdivisions: 8 30 | -------------------------------------------------------------------------------- /Gesturing/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Gestures/ExampleScene/GestureDemoScene.unity 10 | guid: 99c9720ab356a0642a771bea13969a05 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /Gesturing/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_SpritePackerMode: 0 12 | m_SpritePackerPaddingPower: 1 13 | m_EtcTextureCompressorBehavior: 1 14 | m_EtcTextureFastCompressor: 1 15 | m_EtcTextureNormalCompressor: 2 16 | m_EtcTextureBestCompressor: 4 17 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 18 | m_ProjectGenerationRootNamespace: 19 | m_UserGeneratedProjectSuffix: 20 | m_CollabEditorSettings: 21 | inProgressEnabled: 1 22 | -------------------------------------------------------------------------------- /Gesturing/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 40 | m_PreloadedShaders: [] 41 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 42 | type: 0} 43 | m_CustomRenderPipeline: {fileID: 0} 44 | m_TransparencySortMode: 0 45 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 46 | m_DefaultRenderingPath: 1 47 | m_DefaultMobileRenderingPath: 1 48 | m_TierSettings: [] 49 | m_LightmapStripping: 0 50 | m_FogStripping: 0 51 | m_InstancingStripping: 0 52 | m_LightmapKeepPlain: 1 53 | m_LightmapKeepDirCombined: 1 54 | m_LightmapKeepDynamicPlain: 1 55 | m_LightmapKeepDynamicDirCombined: 1 56 | m_LightmapKeepShadowMask: 1 57 | m_LightmapKeepSubtractive: 1 58 | m_FogKeepLinear: 1 59 | m_FogKeepExp: 1 60 | m_FogKeepExp2: 1 61 | m_AlbedoSwatchInfos: [] 62 | m_LightsUseLinearIntensity: 0 63 | m_LightsUseColorTemperature: 0 64 | -------------------------------------------------------------------------------- /Gesturing/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /Gesturing/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /Gesturing/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 1 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_AutoSyncTransforms: 1 28 | m_AlwaysShowColliders: 0 29 | m_ShowColliderSleep: 1 30 | m_ShowColliderContacts: 0 31 | m_ShowColliderAABB: 0 32 | m_ContactArrowScale: 0.2 33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 38 | -------------------------------------------------------------------------------- /Gesturing/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: 7 | - type: 8 | m_NativeTypeID: 108 9 | m_ManagedTypePPtr: {fileID: 0} 10 | m_ManagedTypeFallback: 11 | defaultPresets: 12 | - m_Preset: {fileID: 2655988077585873504, guid: c1cf8506f04ef2c4a88b64b6c4202eea, 13 | type: 2} 14 | - type: 15 | m_NativeTypeID: 1020 16 | m_ManagedTypePPtr: {fileID: 0} 17 | m_ManagedTypeFallback: 18 | defaultPresets: 19 | - m_Preset: {fileID: 2655988077585873504, guid: 0cd792cc87e492d43b4e95b205fc5cc6, 20 | type: 2} 21 | - type: 22 | m_NativeTypeID: 1006 23 | m_ManagedTypePPtr: {fileID: 0} 24 | m_ManagedTypeFallback: 25 | defaultPresets: 26 | - m_Preset: {fileID: 2655988077585873504, guid: 7a99f8aa944efe94cb9bd74562b7d5f9, 27 | type: 2} 28 | -------------------------------------------------------------------------------- /Gesturing/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.1.0f2 2 | m_EditorVersionWithRevision: 2019.1.0f2 (292b93d75a2c) 3 | -------------------------------------------------------------------------------- /Gesturing/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 4 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | particleRaycastBudget: 4 33 | asyncUploadTimeSlice: 2 34 | asyncUploadBufferSize: 4 35 | resolutionScalingFixedDPIFactor: 1 36 | excludedTargetPlatforms: [] 37 | - serializedVersion: 2 38 | name: Low 39 | pixelLightCount: 0 40 | shadows: 0 41 | shadowResolution: 0 42 | shadowProjection: 1 43 | shadowCascades: 1 44 | shadowDistance: 20 45 | shadowNearPlaneOffset: 3 46 | shadowCascade2Split: 0.33333334 47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 48 | shadowmaskMode: 0 49 | blendWeights: 2 50 | textureQuality: 0 51 | anisotropicTextures: 0 52 | antiAliasing: 0 53 | softParticles: 0 54 | softVegetation: 0 55 | realtimeReflectionProbes: 0 56 | billboardsFaceCameraPosition: 0 57 | vSyncCount: 0 58 | lodBias: 0.4 59 | maximumLODLevel: 0 60 | particleRaycastBudget: 16 61 | asyncUploadTimeSlice: 2 62 | asyncUploadBufferSize: 4 63 | resolutionScalingFixedDPIFactor: 1 64 | excludedTargetPlatforms: [] 65 | - serializedVersion: 2 66 | name: Medium 67 | pixelLightCount: 1 68 | shadows: 1 69 | shadowResolution: 0 70 | shadowProjection: 1 71 | shadowCascades: 1 72 | shadowDistance: 20 73 | shadowNearPlaneOffset: 3 74 | shadowCascade2Split: 0.33333334 75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 76 | shadowmaskMode: 0 77 | blendWeights: 2 78 | textureQuality: 0 79 | anisotropicTextures: 1 80 | antiAliasing: 0 81 | softParticles: 0 82 | softVegetation: 0 83 | realtimeReflectionProbes: 0 84 | billboardsFaceCameraPosition: 0 85 | vSyncCount: 1 86 | lodBias: 0.7 87 | maximumLODLevel: 0 88 | particleRaycastBudget: 64 89 | asyncUploadTimeSlice: 2 90 | asyncUploadBufferSize: 4 91 | resolutionScalingFixedDPIFactor: 1 92 | excludedTargetPlatforms: [] 93 | - serializedVersion: 2 94 | name: High 95 | pixelLightCount: 2 96 | shadows: 2 97 | shadowResolution: 1 98 | shadowProjection: 1 99 | shadowCascades: 2 100 | shadowDistance: 40 101 | shadowNearPlaneOffset: 3 102 | shadowCascade2Split: 0.33333334 103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 104 | shadowmaskMode: 1 105 | blendWeights: 2 106 | textureQuality: 0 107 | anisotropicTextures: 1 108 | antiAliasing: 2 109 | softParticles: 0 110 | softVegetation: 1 111 | realtimeReflectionProbes: 1 112 | billboardsFaceCameraPosition: 1 113 | vSyncCount: 1 114 | lodBias: 1 115 | maximumLODLevel: 0 116 | particleRaycastBudget: 256 117 | asyncUploadTimeSlice: 2 118 | asyncUploadBufferSize: 4 119 | resolutionScalingFixedDPIFactor: 1 120 | excludedTargetPlatforms: [] 121 | - serializedVersion: 2 122 | name: Very High 123 | pixelLightCount: 3 124 | shadows: 2 125 | shadowResolution: 2 126 | shadowProjection: 1 127 | shadowCascades: 2 128 | shadowDistance: 40 129 | shadowNearPlaneOffset: 3 130 | shadowCascade2Split: 0.33333334 131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 132 | shadowmaskMode: 1 133 | blendWeights: 4 134 | textureQuality: 0 135 | anisotropicTextures: 1 136 | antiAliasing: 4 137 | softParticles: 1 138 | softVegetation: 1 139 | realtimeReflectionProbes: 1 140 | billboardsFaceCameraPosition: 1 141 | vSyncCount: 1 142 | lodBias: 1.5 143 | maximumLODLevel: 0 144 | particleRaycastBudget: 1024 145 | asyncUploadTimeSlice: 2 146 | asyncUploadBufferSize: 4 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Ultra 151 | pixelLightCount: 4 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 4 156 | shadowDistance: 150 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 1 164 | antiAliasing: 4 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 2 171 | maximumLODLevel: 0 172 | particleRaycastBudget: 4096 173 | asyncUploadTimeSlice: 2 174 | asyncUploadBufferSize: 4 175 | resolutionScalingFixedDPIFactor: 1 176 | excludedTargetPlatforms: [] 177 | m_PerPlatformDefaultQuality: 178 | Android: 2 179 | Nintendo 3DS: 5 180 | Nintendo Switch: 5 181 | PS4: 5 182 | PSP2: 2 183 | Standalone: 5 184 | Tizen: 2 185 | WebGL: 3 186 | WiiU: 5 187 | Windows Store Apps: 5 188 | XboxOne: 5 189 | iPhone: 2 190 | tvOS: 2 191 | -------------------------------------------------------------------------------- /Gesturing/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /Gesturing/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.1 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /Gesturing/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 1 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /Gesturing/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /Gesturing/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 analog-anagram 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Open Source VR Project 2 | [![Build Status](https://travis-ci.org/os-vr/OSVR-Senior-Project.svg?branch=master)](https://travis-ci.org/os-vr/OSVR-Senior-Project) 3 | [API Documentation](https://os-vr.github.io/OSVR-Senior-Project/namespace_gestures.html) 4 | 5 | 6 | 7 | # OSVR Gesturing Installation Guide 8 | 9 | > **Requires** the Unity software version 2019.1 (or above). 10 | 11 | > **Requires** the Oculus Integration plugin from the Unity Asset Store. 12 | 13 | 14 | 15 | ## Getting Started 16 | 17 | ### Documentation 18 | 19 | Visit [Full Documentation](https://os-vr.github.io/OSVR-Senior-Project/namespace_gestures.html) for a detailed API 20 | 21 | ### Setting up the project 22 | 23 | * Create a new project in the Unity software version 2019.1 using 3D Template or open an existing project. 24 | 25 | * Ensure `Virtual Reality Supported` is checked: 26 | 27 | * In the Unity software select `Main Menu -> Edit -> Project Settings` to open the `Project Settings` window. 28 | 29 | * Select `Player` from the left hand menu in the `Project Settings` window. 30 | 31 | * In the `Player` settings panel expand `XR Settings`. 32 | 33 | * In `XR Settings` ensure the `Virtual Reality Supported` option is checked. 34 | 35 | * Ensure the project `Scripting Runtime Version` is set to `.NET 4.x Equivalent`: 36 | 37 | * In the Unity software select `Main Menu -> Edit -> Project Settings` to open the `Project Settings` inspector. 38 | 39 | * Select `Player` from the left hand menu in the `Project Settings` window. 40 | 41 | * In the `Player` settings panel expand `Other Settings`. 42 | 43 | * Ensure the `Scripting Runtime Version` is set to `.NET 4.x Equivalent`. 44 | 45 | * Download `Oculus Integration Plugin` 46 | * Navigate to the Unity Asset Store (`Ctrl+9`) 47 | * Search for `Oculus Integration` 48 | * Download the package and import the assets. 49 | 50 | * Download the `OSVR Gesture Framework` asset from the Unity Asset Store 51 | * *If the Gesture Framework is downloaded before Oculus Integration, various scripts will not be loaded correctly* 52 | * Open the `Gestures/ExampleScenes/GestureDemoScene` scene. 53 | 54 | 55 | ## Controls 56 | 57 | The system requires a concrete implementation of IController to track positions and determine when a Gesture should be active. In the example scene, the GameObject "Right Hand" holds a `TouchController` component, which works for Oculus Rift Touch Controllers. In the Inspector, the option `controllerType` will let you choose which hand is used, and the option `gestureActiveButton` lets you choose which button must be held to activate the Gesture. The defaults are RTouch (Right Touch Controller) and Primary Index Trigger (the trigger resting under the index finger of the RTouch Controller). 58 | 59 | 60 | ### Getting Started 61 | 62 | In the `TrackerSetup.cs` file, code is written to demonstrate how to set up the Gesture tracking 63 | 64 | `GestureMonitor tracker = gameObject.AddComponent();` 65 | > Create the Gesture Monitor Component responsible for tracking and detecting Gestures 66 | 67 | `tracker.controller = GetComponent();` 68 | > Set the instance of an IController to track. 69 | 70 | `tracker.lineRenderer = GetComponent();` 71 | > Attach a LineRenderer if wanted 72 | 73 | ` tracker.AddGesture("Square", new SquareGesture());` 74 | > Add Gestures to be tracked 75 | 76 | `tracker.AddGestureCompleteCallback(GestureComplete);` 77 | > Set what happens when a Gesture is completed 78 | 79 | `tracker.AddGestureFailedCallback(GestureFailed);` 80 | > Set what happens when a Gesture is failed 81 | 82 | `tracker.AddGestureStartCallback(GestureStart);` 83 | > Set what happens when a Gesture is started 84 | 85 | `tracker.setEnabled("Square", true)` 86 | > Although Gestures are enabled by default, use this method to toggle the tracking state of individual Gestures 87 | 88 | 89 | ## Building Gestures 90 | 91 | Gestures are defined in the XY plane, and consist line segments, arcs, and points, called "Checks". When the user draws a shape, each of these Checks will be queried with the positional data passed in, to determine whether the Gesture has been completed or not. 92 | Currently, creating Gestures much be done in code, there is not a solution to do so in the Unity Editor or Unity Inspector. 93 | 94 | `new Gesture()` 95 | 96 | > Start with a base Gesture 97 | 98 | `new Gesture().AddOnceChecks(new List{})` 99 | 100 | > Add a series of Checks where each segment much only be satisfied once 101 | 102 | `new Gesture().AddSequentialChecks(new List{})` 103 | 104 | > Add a series of Checks where each segment much be passed in a specified order 105 | 106 | `new LineCheck(new Vector3(0,0,0), new Vector3(1,1,0), .5f)` 107 | 108 | > Create a new Line segment check that goes from (0,0,0) to (1,1,0) and has a tolerance of .5f 109 | 110 | `new RadiusCheck(new Vector3(0,0,0), .5f)` 111 | 112 | > Create a new Radius check centered at (0,0,0) with a radius of .5f. 113 | 114 | `new ArcCheck(new Vector3(0, 0, 0), 90, new Vector3(0,1,0))` 115 | 116 | > Create a new Arc check that traces out the path from (0,0,0) to (1, 1, 0) (90 degrees around the circle defined by the starting point (0,0,0) and the center (0,1,0)). 117 | 118 | `new Gesture().SetNormalizer(new FittedNormalizer(new Vector3(-1,-1,0), new Vector3(1,1,0)))` 119 | > All Gestures must have a Normalizer attached, and FittedNormalizer is the standard for shapes with height and width. The Normalizer must take in bounds that completely encompass the bounds of the Checks that make up the Gesture. In the example above, the leftmost point of the Gesture is at `x=-1`, and the rightmost point is at `x=1`. 120 | > *When adding the Normalizer, it is very important to completely encompass the Gesture without making the bounding box too large, or else the Gesture will not be detected as intended*. 121 | 122 | `new Gesture().AddEvent(UnityAction action)` 123 | > Each Gesture can have its own Event attached that will run when the Gesture is detected at any time. This call takes in a function with a single parameter of GestureMetaData. 124 | 125 | ## Visualization 126 | In order to see how the Gestures will look (and check your construction), navigate to `Tools/Gesture Visualization` while the game is running. Using the dropdown to select the correct Gesture name will give a rough depiction of what each Gesture will look like. 127 | 128 | 129 | 130 | 131 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7a154b3105c32e7418b415a9691794df 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Button.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c67dc078083de384ea2be541657a106a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Button/ButtonScript.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8f91496f6107c23459a27c30851ded77 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Button/README.md: -------------------------------------------------------------------------------- 1 | NewButtonScript 2 | 3 | To make a NewButtonScript place The NewButtonScript on a object with a collider set to trigger 4 | 5 | inspector details: 6 | hoverLayer/activationLayer: The layer mask used to determine if a colliding object is in the layers that hovers or activates. 7 | extra: The game object that is rendered in addition to the button, based on the button's state. 8 | triggered: Determines if the button has been pressed. gradient: 9 | The gradient for color changing based on hovering. 10 | useGradient: If we use the given gradient. 11 | startColor: The color we start with if we instantly change the color. 12 | endColor: The color we end with if we instantly change color. 13 | itemFade: How long the color transition takes when hovered. 14 | delay: how long no input must be sent for after which input will be considered valid. 15 | onEnterUseForHover: Determines if we use onEnter events for hovering. 16 | onEnterUseForActivation: Determines if we use onEnter events for activating. 17 | onStayUseForHover: Determines if we use onStay events for hovering. 18 | onStayUseForActivation: Determines if we use onStay events for activating. 19 | onExitUseForHover: Determines if we use onExit events for hovering. 20 | onExitUseForActivation: Determines if we use onExit events for activating. 21 | detectOnEnter: Determines if we use any event on enter. 22 | detectOnHover: Determines if we use any events on hover. 23 | \detectOnExit: Determines if we use any events on exit. 24 | extras: gameobjects that are rendered when the botton is in no other state. 25 | extrasHovered: gameobjects that are rendered when the botton is in the hovered state. 26 | extrasPressed: gameobjects that are rendered when the botton is in the pressed state. 27 | extrasDisabled: gameobjects that are rendered when the botton is in the disabled state. 28 | 29 | Pressed, Disabled, Hovered: internals that can be toggled to change state 30 | These items will be spawned at the item's position when in the right state. 31 | 32 | If normal, then Extras is placed. If pressed, then Extras pressed is placed. 33 | If hovered, then Extras Hovered is placed. 34 | If disabled, the extras disabled is placed 35 | There are 4 states: normal < pressed < hovered < diabled these correspond to the items 36 | that are placed each item suppercedes the ones on the left so the system is in the state furthest right that it can be. 37 | 38 | Unity Events: 39 | 40 | onHover: Called when the dropdown box has an collider stay in it; 41 | onEnter: Called when the dropdown box has an collider enter in it; 42 | onExit: Called when the dropdown box has an collider exit in it; 43 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Button/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a3f7cd322313f484eba7a9914298101d 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/DropDown.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ccc0bdcb2fe1f834eaab9bcd737218e2 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/DropDown/Color Item.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &2088010617044845502 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 7658872371128623500} 12 | - component: {fileID: 1859554660098140584} 13 | - component: {fileID: 5710965041475605655} 14 | - component: {fileID: 1715654471715442398} 15 | m_Layer: 0 16 | m_Name: Color Item 17 | m_TagString: Untagged 18 | m_Icon: {fileID: 0} 19 | m_NavMeshLayer: 0 20 | m_StaticEditorFlags: 0 21 | m_IsActive: 1 22 | --- !u!4 &7658872371128623500 23 | Transform: 24 | m_ObjectHideFlags: 0 25 | m_CorrespondingSourceObject: {fileID: 0} 26 | m_PrefabInstance: {fileID: 0} 27 | m_PrefabAsset: {fileID: 0} 28 | m_GameObject: {fileID: 2088010617044845502} 29 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 30 | m_LocalPosition: {x: -5.6200895, y: 1.0311543, z: 14.094471} 31 | m_LocalScale: {x: 0.4, y: 0.1, z: 0.1} 32 | m_Children: 33 | - {fileID: 2805208789582196405} 34 | m_Father: {fileID: 0} 35 | m_RootOrder: 0 36 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 37 | --- !u!33 &1859554660098140584 38 | MeshFilter: 39 | m_ObjectHideFlags: 0 40 | m_CorrespondingSourceObject: {fileID: 0} 41 | m_PrefabInstance: {fileID: 0} 42 | m_PrefabAsset: {fileID: 0} 43 | m_GameObject: {fileID: 2088010617044845502} 44 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 45 | --- !u!23 &5710965041475605655 46 | MeshRenderer: 47 | m_ObjectHideFlags: 0 48 | m_CorrespondingSourceObject: {fileID: 0} 49 | m_PrefabInstance: {fileID: 0} 50 | m_PrefabAsset: {fileID: 0} 51 | m_GameObject: {fileID: 2088010617044845502} 52 | m_Enabled: 1 53 | m_CastShadows: 1 54 | m_ReceiveShadows: 1 55 | m_DynamicOccludee: 1 56 | m_MotionVectors: 1 57 | m_LightProbeUsage: 1 58 | m_ReflectionProbeUsage: 1 59 | m_RenderingLayerMask: 1 60 | m_RendererPriority: 0 61 | m_Materials: 62 | - {fileID: 2100000, guid: 4ebb8f14063f19a45af503eee3cb70cb, type: 2} 63 | m_StaticBatchInfo: 64 | firstSubMesh: 0 65 | subMeshCount: 0 66 | m_StaticBatchRoot: {fileID: 0} 67 | m_ProbeAnchor: {fileID: 0} 68 | m_LightProbeVolumeOverride: {fileID: 0} 69 | m_ScaleInLightmap: 1 70 | m_PreserveUVs: 0 71 | m_IgnoreNormalsForChartDetection: 0 72 | m_ImportantGI: 0 73 | m_StitchLightmapSeams: 0 74 | m_SelectedEditorRenderState: 3 75 | m_MinimumChartSize: 4 76 | m_AutoUVMaxDistance: 0.5 77 | m_AutoUVMaxAngle: 89 78 | m_LightmapParameters: {fileID: 0} 79 | m_SortingLayerID: 0 80 | m_SortingLayer: 0 81 | m_SortingOrder: 0 82 | --- !u!65 &1715654471715442398 83 | BoxCollider: 84 | m_ObjectHideFlags: 0 85 | m_CorrespondingSourceObject: {fileID: 0} 86 | m_PrefabInstance: {fileID: 0} 87 | m_PrefabAsset: {fileID: 0} 88 | m_GameObject: {fileID: 2088010617044845502} 89 | m_Material: {fileID: 0} 90 | m_IsTrigger: 1 91 | m_Enabled: 1 92 | serializedVersion: 2 93 | m_Size: {x: 1, y: 1, z: 1} 94 | m_Center: {x: 0, y: 0, z: 0} 95 | --- !u!1 &3102432233350894391 96 | GameObject: 97 | m_ObjectHideFlags: 0 98 | m_CorrespondingSourceObject: {fileID: 0} 99 | m_PrefabInstance: {fileID: 0} 100 | m_PrefabAsset: {fileID: 0} 101 | serializedVersion: 6 102 | m_Component: 103 | - component: {fileID: 2805208789582196405} 104 | - component: {fileID: 6116356163228011398} 105 | - component: {fileID: 1879798519975959354} 106 | m_Layer: 0 107 | m_Name: Label 108 | m_TagString: Untagged 109 | m_Icon: {fileID: 0} 110 | m_NavMeshLayer: 0 111 | m_StaticEditorFlags: 0 112 | m_IsActive: 1 113 | --- !u!4 &2805208789582196405 114 | Transform: 115 | m_ObjectHideFlags: 0 116 | m_CorrespondingSourceObject: {fileID: 0} 117 | m_PrefabInstance: {fileID: 0} 118 | m_PrefabAsset: {fileID: 0} 119 | m_GameObject: {fileID: 3102432233350894391} 120 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 121 | m_LocalPosition: {x: 0, y: 0, z: 0} 122 | m_LocalScale: {x: 0.02, y: 0.1, z: 0.01} 123 | m_Children: [] 124 | m_Father: {fileID: 7658872371128623500} 125 | m_RootOrder: 0 126 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 127 | --- !u!23 &6116356163228011398 128 | MeshRenderer: 129 | m_ObjectHideFlags: 0 130 | m_CorrespondingSourceObject: {fileID: 0} 131 | m_PrefabInstance: {fileID: 0} 132 | m_PrefabAsset: {fileID: 0} 133 | m_GameObject: {fileID: 3102432233350894391} 134 | m_Enabled: 1 135 | m_CastShadows: 1 136 | m_ReceiveShadows: 1 137 | m_DynamicOccludee: 1 138 | m_MotionVectors: 1 139 | m_LightProbeUsage: 1 140 | m_ReflectionProbeUsage: 1 141 | m_RenderingLayerMask: 1 142 | m_RendererPriority: 0 143 | m_Materials: 144 | - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} 145 | m_StaticBatchInfo: 146 | firstSubMesh: 0 147 | subMeshCount: 0 148 | m_StaticBatchRoot: {fileID: 0} 149 | m_ProbeAnchor: {fileID: 0} 150 | m_LightProbeVolumeOverride: {fileID: 0} 151 | m_ScaleInLightmap: 1 152 | m_PreserveUVs: 0 153 | m_IgnoreNormalsForChartDetection: 0 154 | m_ImportantGI: 0 155 | m_StitchLightmapSeams: 0 156 | m_SelectedEditorRenderState: 3 157 | m_MinimumChartSize: 4 158 | m_AutoUVMaxDistance: 0.5 159 | m_AutoUVMaxAngle: 89 160 | m_LightmapParameters: {fileID: 0} 161 | m_SortingLayerID: 0 162 | m_SortingLayer: 0 163 | m_SortingOrder: 0 164 | --- !u!102 &1879798519975959354 165 | TextMesh: 166 | serializedVersion: 3 167 | m_ObjectHideFlags: 0 168 | m_CorrespondingSourceObject: {fileID: 0} 169 | m_PrefabInstance: {fileID: 0} 170 | m_PrefabAsset: {fileID: 0} 171 | m_GameObject: {fileID: 3102432233350894391} 172 | m_Text: Hello World 173 | m_OffsetZ: 0 174 | m_CharacterSize: 1 175 | m_LineSpacing: 1 176 | m_Anchor: 4 177 | m_Alignment: 0 178 | m_TabSize: 4 179 | m_FontSize: 100 180 | m_FontStyle: 0 181 | m_RichText: 1 182 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 183 | m_Color: 184 | serializedVersion: 2 185 | rgba: 4294967295 186 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/DropDown/Color Item.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 72db25b7240113d40af1cca49b7ed049 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/DropDown/ColorChanging.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: ColorChanging 11 | m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: 2050 17 | stringTagMap: 18 | RenderType: Opaque 19 | disabledShaderPasses: [] 20 | m_SavedProperties: 21 | serializedVersion: 3 22 | m_TexEnvs: 23 | - _BaseMap: 24 | m_Texture: {fileID: 0} 25 | m_Scale: {x: 1, y: 1} 26 | m_Offset: {x: 0, y: 0} 27 | - _BumpMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _EmissionMap: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _MainTex: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _MetallicGlossMap: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _OcclusionMap: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _SpecGlossMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | m_Floats: 52 | - _AlphaClip: 0 53 | - _Blend: 0 54 | - _BumpScale: 1 55 | - _Cull: 2 56 | - _Cutoff: 0.5 57 | - _DstBlend: 0 58 | - _EnvironmentReflections: 1 59 | - _GlossMapScale: 1 60 | - _Glossiness: 0.5 61 | - _GlossyReflections: 1 62 | - _Metallic: 0 63 | - _OcclusionStrength: 1 64 | - _QueueOffset: 0 65 | - _ReceiveShadows: 1 66 | - _Smoothness: 0.5 67 | - _SmoothnessTextureChannel: 0 68 | - _SpecularHighlights: 1 69 | - _SrcBlend: 1 70 | - _Surface: 0 71 | - _WorkflowMode: 1 72 | - _ZWrite: 1 73 | m_Colors: 74 | - _BaseColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 75 | - _Color: {r: 0.5, g: 0.5, b: 0.5, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 77 | - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} 78 | --- !u!114 &3012553347363835116 79 | MonoBehaviour: 80 | m_ObjectHideFlags: 11 81 | m_CorrespondingSourceObject: {fileID: 0} 82 | m_PrefabInstance: {fileID: 0} 83 | m_PrefabAsset: {fileID: 0} 84 | m_GameObject: {fileID: 0} 85 | m_Enabled: 1 86 | m_EditorHideFlags: 0 87 | m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} 88 | m_Name: 89 | m_EditorClassIdentifier: 90 | version: 1 91 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/DropDown/ColorChanging.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4d526b67b905aa469f091f966dfd381 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/DropDown/DropDownControl.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c60d6b415149f9f41814c89d04febc7d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/DropDown/Example prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 46afcbb64f5e71c4485a4da4daf4d35e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/DropDown/Example prefabs/Template.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1265482634745180} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1017566972376806 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 5 20 | m_Component: 21 | - component: {fileID: 4558855136159990} 22 | - component: {fileID: 23421742757599186} 23 | - component: {fileID: 102348342592584490} 24 | m_Layer: 8 25 | m_Name: ItemLabel 26 | m_TagString: Untagged 27 | m_Icon: {fileID: 0} 28 | m_NavMeshLayer: 0 29 | m_StaticEditorFlags: 0 30 | m_IsActive: 1 31 | --- !u!1 &1040627561532440 32 | GameObject: 33 | m_ObjectHideFlags: 0 34 | m_PrefabParentObject: {fileID: 0} 35 | m_PrefabInternal: {fileID: 100100000} 36 | serializedVersion: 5 37 | m_Component: 38 | - component: {fileID: 4025509399756230} 39 | - component: {fileID: 33420196605800446} 40 | - component: {fileID: 65779081403348092} 41 | - component: {fileID: 23660034834392556} 42 | m_Layer: 8 43 | m_Name: Item 44 | m_TagString: Untagged 45 | m_Icon: {fileID: 0} 46 | m_NavMeshLayer: 0 47 | m_StaticEditorFlags: 0 48 | m_IsActive: 1 49 | --- !u!1 &1265482634745180 50 | GameObject: 51 | m_ObjectHideFlags: 0 52 | m_PrefabParentObject: {fileID: 0} 53 | m_PrefabInternal: {fileID: 100100000} 54 | serializedVersion: 5 55 | m_Component: 56 | - component: {fileID: 224964904102867956} 57 | m_Layer: 8 58 | m_Name: Template 59 | m_TagString: Untagged 60 | m_Icon: {fileID: 0} 61 | m_NavMeshLayer: 0 62 | m_StaticEditorFlags: 0 63 | m_IsActive: 1 64 | --- !u!4 &4025509399756230 65 | Transform: 66 | m_ObjectHideFlags: 1 67 | m_PrefabParentObject: {fileID: 0} 68 | m_PrefabInternal: {fileID: 100100000} 69 | m_GameObject: {fileID: 1040627561532440} 70 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 71 | m_LocalPosition: {x: 0, y: 0, z: 0} 72 | m_LocalScale: {x: 0.6, y: 0.1, z: 0.1} 73 | m_Children: [] 74 | m_Father: {fileID: 224964904102867956} 75 | m_RootOrder: 0 76 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 77 | --- !u!4 &4558855136159990 78 | Transform: 79 | m_ObjectHideFlags: 1 80 | m_PrefabParentObject: {fileID: 0} 81 | m_PrefabInternal: {fileID: 100100000} 82 | m_GameObject: {fileID: 1017566972376806} 83 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 84 | m_LocalPosition: {x: 0, y: 0, z: 0} 85 | m_LocalScale: {x: 1, y: 1, z: 1} 86 | m_Children: [] 87 | m_Father: {fileID: 224964904102867956} 88 | m_RootOrder: 1 89 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 90 | --- !u!23 &23421742757599186 91 | MeshRenderer: 92 | m_ObjectHideFlags: 1 93 | m_PrefabParentObject: {fileID: 0} 94 | m_PrefabInternal: {fileID: 100100000} 95 | m_GameObject: {fileID: 1017566972376806} 96 | m_Enabled: 1 97 | m_CastShadows: 1 98 | m_ReceiveShadows: 1 99 | m_DynamicOccludee: 1 100 | m_MotionVectors: 1 101 | m_LightProbeUsage: 1 102 | m_ReflectionProbeUsage: 1 103 | m_Materials: 104 | - {fileID: 10100, guid: 0000000000000000e000000000000000, type: 0} 105 | m_StaticBatchInfo: 106 | firstSubMesh: 0 107 | subMeshCount: 0 108 | m_StaticBatchRoot: {fileID: 0} 109 | m_ProbeAnchor: {fileID: 0} 110 | m_LightProbeVolumeOverride: {fileID: 0} 111 | m_ScaleInLightmap: 1 112 | m_PreserveUVs: 0 113 | m_IgnoreNormalsForChartDetection: 0 114 | m_ImportantGI: 0 115 | m_StitchLightmapSeams: 0 116 | m_SelectedEditorRenderState: 3 117 | m_MinimumChartSize: 4 118 | m_AutoUVMaxDistance: 0.5 119 | m_AutoUVMaxAngle: 89 120 | m_LightmapParameters: {fileID: 0} 121 | m_SortingLayerID: 0 122 | m_SortingLayer: 0 123 | m_SortingOrder: 0 124 | --- !u!23 &23660034834392556 125 | MeshRenderer: 126 | m_ObjectHideFlags: 1 127 | m_PrefabParentObject: {fileID: 0} 128 | m_PrefabInternal: {fileID: 100100000} 129 | m_GameObject: {fileID: 1040627561532440} 130 | m_Enabled: 1 131 | m_CastShadows: 1 132 | m_ReceiveShadows: 1 133 | m_DynamicOccludee: 1 134 | m_MotionVectors: 1 135 | m_LightProbeUsage: 1 136 | m_ReflectionProbeUsage: 1 137 | m_Materials: 138 | - {fileID: 2100000, guid: 3071d020594b5af4bbb610cf443891f5, type: 2} 139 | m_StaticBatchInfo: 140 | firstSubMesh: 0 141 | subMeshCount: 0 142 | m_StaticBatchRoot: {fileID: 0} 143 | m_ProbeAnchor: {fileID: 0} 144 | m_LightProbeVolumeOverride: {fileID: 0} 145 | m_ScaleInLightmap: 1 146 | m_PreserveUVs: 1 147 | m_IgnoreNormalsForChartDetection: 0 148 | m_ImportantGI: 0 149 | m_StitchLightmapSeams: 0 150 | m_SelectedEditorRenderState: 3 151 | m_MinimumChartSize: 4 152 | m_AutoUVMaxDistance: 0.5 153 | m_AutoUVMaxAngle: 89 154 | m_LightmapParameters: {fileID: 0} 155 | m_SortingLayerID: 0 156 | m_SortingLayer: 0 157 | m_SortingOrder: 0 158 | --- !u!33 &33420196605800446 159 | MeshFilter: 160 | m_ObjectHideFlags: 1 161 | m_PrefabParentObject: {fileID: 0} 162 | m_PrefabInternal: {fileID: 100100000} 163 | m_GameObject: {fileID: 1040627561532440} 164 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 165 | --- !u!65 &65779081403348092 166 | BoxCollider: 167 | m_ObjectHideFlags: 1 168 | m_PrefabParentObject: {fileID: 0} 169 | m_PrefabInternal: {fileID: 100100000} 170 | m_GameObject: {fileID: 1040627561532440} 171 | m_Material: {fileID: 0} 172 | m_IsTrigger: 1 173 | m_Enabled: 1 174 | serializedVersion: 2 175 | m_Size: {x: 1, y: 1, z: 1} 176 | m_Center: {x: 0, y: 0, z: 0} 177 | --- !u!102 &102348342592584490 178 | TextMesh: 179 | serializedVersion: 3 180 | m_ObjectHideFlags: 1 181 | m_PrefabParentObject: {fileID: 0} 182 | m_PrefabInternal: {fileID: 100100000} 183 | m_GameObject: {fileID: 1017566972376806} 184 | m_Text: Hello World 185 | m_OffsetZ: 0 186 | m_CharacterSize: 1 187 | m_LineSpacing: 1 188 | m_Anchor: 0 189 | m_Alignment: 0 190 | m_TabSize: 4 191 | m_FontSize: 0 192 | m_FontStyle: 0 193 | m_RichText: 1 194 | m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} 195 | m_Color: 196 | serializedVersion: 2 197 | rgba: 4294967295 198 | --- !u!224 &224964904102867956 199 | RectTransform: 200 | m_ObjectHideFlags: 1 201 | m_PrefabParentObject: {fileID: 0} 202 | m_PrefabInternal: {fileID: 100100000} 203 | m_GameObject: {fileID: 1265482634745180} 204 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 205 | m_LocalPosition: {x: 0, y: 0, z: 0} 206 | m_LocalScale: {x: 1, y: 1, z: 1} 207 | m_Children: 208 | - {fileID: 4025509399756230} 209 | - {fileID: 4558855136159990} 210 | m_Father: {fileID: 0} 211 | m_RootOrder: 0 212 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 213 | m_AnchorMin: {x: 0.5, y: 0.5} 214 | m_AnchorMax: {x: 0.5, y: 0.5} 215 | m_AnchoredPosition: {x: 0, y: -0.018999998} 216 | m_SizeDelta: {x: 100, y: 100} 217 | m_Pivot: {x: 0.5, y: 0.5} 218 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/DropDown/Example prefabs/Template.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fc5dcc80071190f47a9522b2058d5f89 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/DropDown/Example prefabs/bounding box 1.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1001 &100100000 4 | Prefab: 5 | m_ObjectHideFlags: 1 6 | serializedVersion: 2 7 | m_Modification: 8 | m_TransformParent: {fileID: 0} 9 | m_Modifications: [] 10 | m_RemovedComponents: [] 11 | m_ParentPrefab: {fileID: 0} 12 | m_RootGameObject: {fileID: 1457739548457746} 13 | m_IsPrefabParent: 1 14 | --- !u!1 &1094153644791532 15 | GameObject: 16 | m_ObjectHideFlags: 0 17 | m_PrefabParentObject: {fileID: 0} 18 | m_PrefabInternal: {fileID: 100100000} 19 | serializedVersion: 5 20 | m_Component: 21 | - component: {fileID: 4424373524906090} 22 | - component: {fileID: 33356862192658268} 23 | - component: {fileID: 65861507972562462} 24 | - component: {fileID: 23062398672842850} 25 | m_Layer: 0 26 | m_Name: bounding box 27 | m_TagString: Untagged 28 | m_Icon: {fileID: 0} 29 | m_NavMeshLayer: 0 30 | m_StaticEditorFlags: 0 31 | m_IsActive: 1 32 | --- !u!1 &1457739548457746 33 | GameObject: 34 | m_ObjectHideFlags: 0 35 | m_PrefabParentObject: {fileID: 0} 36 | m_PrefabInternal: {fileID: 100100000} 37 | serializedVersion: 5 38 | m_Component: 39 | - component: {fileID: 4678974059951906} 40 | m_Layer: 0 41 | m_Name: bounding box 1 42 | m_TagString: Untagged 43 | m_Icon: {fileID: 0} 44 | m_NavMeshLayer: 0 45 | m_StaticEditorFlags: 0 46 | m_IsActive: 1 47 | --- !u!4 &4424373524906090 48 | Transform: 49 | m_ObjectHideFlags: 1 50 | m_PrefabParentObject: {fileID: 0} 51 | m_PrefabInternal: {fileID: 100100000} 52 | m_GameObject: {fileID: 1094153644791532} 53 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 54 | m_LocalPosition: {x: 0, y: -0.3, z: 0.1} 55 | m_LocalScale: {x: 0.7, y: 0.8, z: 0.1} 56 | m_Children: [] 57 | m_Father: {fileID: 4678974059951906} 58 | m_RootOrder: 0 59 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 60 | --- !u!4 &4678974059951906 61 | Transform: 62 | m_ObjectHideFlags: 1 63 | m_PrefabParentObject: {fileID: 0} 64 | m_PrefabInternal: {fileID: 100100000} 65 | m_GameObject: {fileID: 1457739548457746} 66 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 67 | m_LocalPosition: {x: 0, y: 0, z: 0} 68 | m_LocalScale: {x: 1, y: 1, z: 1} 69 | m_Children: 70 | - {fileID: 4424373524906090} 71 | m_Father: {fileID: 0} 72 | m_RootOrder: 0 73 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 74 | --- !u!23 &23062398672842850 75 | MeshRenderer: 76 | m_ObjectHideFlags: 1 77 | m_PrefabParentObject: {fileID: 0} 78 | m_PrefabInternal: {fileID: 100100000} 79 | m_GameObject: {fileID: 1094153644791532} 80 | m_Enabled: 1 81 | m_CastShadows: 1 82 | m_ReceiveShadows: 1 83 | m_DynamicOccludee: 1 84 | m_MotionVectors: 1 85 | m_LightProbeUsage: 1 86 | m_ReflectionProbeUsage: 1 87 | m_Materials: 88 | - {fileID: 10303, guid: 0000000000000000f000000000000000, type: 0} 89 | m_StaticBatchInfo: 90 | firstSubMesh: 0 91 | subMeshCount: 0 92 | m_StaticBatchRoot: {fileID: 0} 93 | m_ProbeAnchor: {fileID: 0} 94 | m_LightProbeVolumeOverride: {fileID: 0} 95 | m_ScaleInLightmap: 1 96 | m_PreserveUVs: 1 97 | m_IgnoreNormalsForChartDetection: 0 98 | m_ImportantGI: 0 99 | m_StitchLightmapSeams: 0 100 | m_SelectedEditorRenderState: 3 101 | m_MinimumChartSize: 4 102 | m_AutoUVMaxDistance: 0.5 103 | m_AutoUVMaxAngle: 89 104 | m_LightmapParameters: {fileID: 0} 105 | m_SortingLayerID: 0 106 | m_SortingLayer: 0 107 | m_SortingOrder: 0 108 | --- !u!33 &33356862192658268 109 | MeshFilter: 110 | m_ObjectHideFlags: 1 111 | m_PrefabParentObject: {fileID: 0} 112 | m_PrefabInternal: {fileID: 100100000} 113 | m_GameObject: {fileID: 1094153644791532} 114 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 115 | --- !u!65 &65861507972562462 116 | BoxCollider: 117 | m_ObjectHideFlags: 1 118 | m_PrefabParentObject: {fileID: 0} 119 | m_PrefabInternal: {fileID: 100100000} 120 | m_GameObject: {fileID: 1094153644791532} 121 | m_Material: {fileID: 0} 122 | m_IsTrigger: 0 123 | m_Enabled: 1 124 | serializedVersion: 2 125 | m_Size: {x: 1, y: 1, z: 1} 126 | m_Center: {x: 0, y: 0, z: 0} 127 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/DropDown/Example prefabs/bounding box 1.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c39fceb8487404479cbf564ffd3a39b 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/DropDown/README.md: -------------------------------------------------------------------------------- 1 | DropDowns 2 | 3 | To make a DropDown place The DropDownControl on a object, a newbuttonscript on the object with a collider set to trigger, and a textmeshpro component in its children 4 | 5 | Drop Down Box refers to the actual box that the user clicks to open the drop down 6 | Drop Down Item refers to all the items in the drop down list 7 | 8 | You require a few peices that have the requirements listed below: 9 | BoundingBox: No requirements, this will be spawned and should bound you items 10 | Template: This must have a textmeshpro, a newbuttonscript, and a collider set to trigger as a prefab 11 | Extras: object that are spawned with the corresponding item in the dropdown 12 | 13 | inspector details: 14 | defaultString: The default string for the dropdown when nothing is selected. 15 | defaultnumber: The index at which that defualt string appears in the results of the dropdown. 16 | Use -1 if it will not appear in the options shown. 17 | maxOptionsShown: number of options shown until a slider is used, for now, 18 | this is set to the number of options total since sliders are not fully implemented. 19 | 20 | Change In Height: difference in height between items in the drop down 21 | Hang Percentage: how much over the discrete cutoff a item can go and still be shown 22 | Drop Down Gradient: Weather the dropdown box will use the Grad gradient 23 | Drop Down Item Gradient: Weather the dropdown items will use the gradient or instant color switch. 24 | Grad: gradient for the Drop Down 25 | Box gradient: The gradient for color changing based on hovering. 26 | useGradient: If we use the given gradient. 27 | startColor: The color we start with if we instantly change the color. 28 | endColor: The color we end with if we instantly change color. 29 | boxFade: How long the color transition takes when hovered on the dropdownbox. 30 | itemFade: How long the color transition takes when hovered on the dropdownitems. 31 | delay: how long no input must be sent for after which input will be considered valid. 32 | onEnterUseForHover: Determines if we use onEnter events for hovering. 33 | onEnterUseForActivation: Determines if we use onEnter events for activating. 34 | onStayUseForHover: Determines if we use onStay events for hovering. 35 | onStayUseForActivation: Determines if we use onStay events for activating. 36 | onExitUseForHover: Determines if we use onExit events for hovering. 37 | onExitUseForActivation: Determines if we use onExit events for activating. 38 | detectOnEnter: Determines if we use any event on enter. 39 | detectOnHover: Determines if we use any events on hover. 40 | detectOnExit: Determines if we use any events on exit. 41 | 42 | Options: This is the list of items that will be in your item 43 | list Label: The string for this item 44 | Button Grad: The gradient used for this button 45 | Pressed, Disabled, Hovered: internals that can be toggled to change state 46 | extras: gameobjects that are rendered when the botton is in no other state. 47 | extrasHovered: gameobjects that are rendered when the botton is in the hovered state. 48 | extrasPressed: gameobjects that are rendered when the botton is in the pressed state. 49 | extrasDisabled: gameobjects that are rendered when the botton is in the disabled state. 50 | Extras: These items will be spawned at the item's position when in the right state. 51 | If normal, then Extras is placed. If pressed, then Extras pressed is placed. 52 | If hovered, then Extras Hovered is placed. If disabled, the extras disabled is placed 53 | There are 4 states: normal < pressed < hovered < diabled these correspond to the items 54 | that are placed each item suppercedes the ones on the left so the system is in the state furthest right that it can be. 55 | 56 | Unity Events: 57 | 58 | onValueChange(int): The index of the item that was selected. 59 | onDropClick: Called when the drop down box is clicked. 60 | onSelectClick: Called when an item is selected. 61 | onHover: Called when the dropdown box has an collider stay in it; 62 | onEnter: Called when the dropdown box has an collider enter in it; 63 | onExit: Called when the dropdown box has an collider exit in it; 64 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/DropDown/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 26f9aff1576f94049a7353f518e0691c 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/DropDown/bounding box.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &844035974959520863 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 1277006903619489330} 12 | m_Layer: 0 13 | m_Name: bounding box 14 | m_TagString: Untagged 15 | m_Icon: {fileID: 0} 16 | m_NavMeshLayer: 0 17 | m_StaticEditorFlags: 0 18 | m_IsActive: 1 19 | --- !u!4 &1277006903619489330 20 | Transform: 21 | m_ObjectHideFlags: 0 22 | m_CorrespondingSourceObject: {fileID: 0} 23 | m_PrefabInstance: {fileID: 0} 24 | m_PrefabAsset: {fileID: 0} 25 | m_GameObject: {fileID: 844035974959520863} 26 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 27 | m_LocalPosition: {x: -5.6200895, y: 0.43115425, z: 14.094471} 28 | m_LocalScale: {x: 1, y: 1, z: 1} 29 | m_Children: 30 | - {fileID: 1013351748862361189} 31 | m_Father: {fileID: 0} 32 | m_RootOrder: 0 33 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 34 | --- !u!1 &7930317042346353391 35 | GameObject: 36 | m_ObjectHideFlags: 0 37 | m_CorrespondingSourceObject: {fileID: 0} 38 | m_PrefabInstance: {fileID: 0} 39 | m_PrefabAsset: {fileID: 0} 40 | serializedVersion: 6 41 | m_Component: 42 | - component: {fileID: 1013351748862361189} 43 | - component: {fileID: 8128304991946100287} 44 | - component: {fileID: 1825104183499395788} 45 | - component: {fileID: 6560626986720043156} 46 | m_Layer: 0 47 | m_Name: Cube 48 | m_TagString: Untagged 49 | m_Icon: {fileID: 0} 50 | m_NavMeshLayer: 0 51 | m_StaticEditorFlags: 0 52 | m_IsActive: 1 53 | --- !u!4 &1013351748862361189 54 | Transform: 55 | m_ObjectHideFlags: 0 56 | m_CorrespondingSourceObject: {fileID: 0} 57 | m_PrefabInstance: {fileID: 0} 58 | m_PrefabAsset: {fileID: 0} 59 | m_GameObject: {fileID: 7930317042346353391} 60 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 61 | m_LocalPosition: {x: 0, y: -0.2, z: 0.05} 62 | m_LocalScale: {x: 0.6, y: 0.6, z: 0.1} 63 | m_Children: [] 64 | m_Father: {fileID: 1277006903619489330} 65 | m_RootOrder: 0 66 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 67 | --- !u!33 &8128304991946100287 68 | MeshFilter: 69 | m_ObjectHideFlags: 0 70 | m_CorrespondingSourceObject: {fileID: 0} 71 | m_PrefabInstance: {fileID: 0} 72 | m_PrefabAsset: {fileID: 0} 73 | m_GameObject: {fileID: 7930317042346353391} 74 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 75 | --- !u!23 &1825104183499395788 76 | MeshRenderer: 77 | m_ObjectHideFlags: 0 78 | m_CorrespondingSourceObject: {fileID: 0} 79 | m_PrefabInstance: {fileID: 0} 80 | m_PrefabAsset: {fileID: 0} 81 | m_GameObject: {fileID: 7930317042346353391} 82 | m_Enabled: 1 83 | m_CastShadows: 1 84 | m_ReceiveShadows: 1 85 | m_DynamicOccludee: 1 86 | m_MotionVectors: 1 87 | m_LightProbeUsage: 1 88 | m_ReflectionProbeUsage: 1 89 | m_RenderingLayerMask: 1 90 | m_RendererPriority: 0 91 | m_Materials: 92 | - {fileID: 2100000, guid: 4ebb8f14063f19a45af503eee3cb70cb, type: 2} 93 | m_StaticBatchInfo: 94 | firstSubMesh: 0 95 | subMeshCount: 0 96 | m_StaticBatchRoot: {fileID: 0} 97 | m_ProbeAnchor: {fileID: 0} 98 | m_LightProbeVolumeOverride: {fileID: 0} 99 | m_ScaleInLightmap: 1 100 | m_PreserveUVs: 0 101 | m_IgnoreNormalsForChartDetection: 0 102 | m_ImportantGI: 0 103 | m_StitchLightmapSeams: 0 104 | m_SelectedEditorRenderState: 3 105 | m_MinimumChartSize: 4 106 | m_AutoUVMaxDistance: 0.5 107 | m_AutoUVMaxAngle: 89 108 | m_LightmapParameters: {fileID: 0} 109 | m_SortingLayerID: 0 110 | m_SortingLayer: 0 111 | m_SortingOrder: 0 112 | --- !u!65 &6560626986720043156 113 | BoxCollider: 114 | m_ObjectHideFlags: 0 115 | m_CorrespondingSourceObject: {fileID: 0} 116 | m_PrefabInstance: {fileID: 0} 117 | m_PrefabAsset: {fileID: 0} 118 | m_GameObject: {fileID: 7930317042346353391} 119 | m_Material: {fileID: 0} 120 | m_IsTrigger: 0 121 | m_Enabled: 1 122 | serializedVersion: 2 123 | m_Size: {x: 1, y: 1, z: 1} 124 | m_Center: {x: 0, y: 0, z: 0} 125 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/DropDown/bounding box.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8500d9bb8c8b83c439ff2f0ea8b72252 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/DropDown/null object.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &5914390045787288905 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 8625934228315986776} 12 | m_Layer: 0 13 | m_Name: null object 14 | m_TagString: Untagged 15 | m_Icon: {fileID: 0} 16 | m_NavMeshLayer: 0 17 | m_StaticEditorFlags: 0 18 | m_IsActive: 1 19 | --- !u!4 &8625934228315986776 20 | Transform: 21 | m_ObjectHideFlags: 0 22 | m_CorrespondingSourceObject: {fileID: 0} 23 | m_PrefabInstance: {fileID: 0} 24 | m_PrefabAsset: {fileID: 0} 25 | m_GameObject: {fileID: 5914390045787288905} 26 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 27 | m_LocalPosition: {x: -5.6200895, y: 1.0311543, z: 14.094471} 28 | m_LocalScale: {x: 1, y: 1, z: 1} 29 | m_Children: [] 30 | m_Father: {fileID: 0} 31 | m_RootOrder: 0 32 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 33 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/DropDown/null object.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fb6561c1ffea1404f90b84eb90ee210b 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Keyboard.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 347c5b92417c6c74a8a5f418d3906a6d 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Keyboard/Keyboard.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 97f98020e6af39d40b167e35494a7e00 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Keyboard/TextScript.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | namespace OSVR.UI 7 | { 8 | /// 9 | /// Script attachable to a keyboard key that enables that key add onto a text object any user specified key 10 | /// 11 | public class TextScript : MonoBehaviour 12 | { 13 | /// 14 | /// Text object that the script will modify 15 | /// 16 | public Text text; 17 | /// 18 | /// User specifies character that the key will input 19 | /// 20 | public char key; 21 | /// 22 | /// Timer for input delay 23 | /// 24 | private float timer = -1; 25 | /// 26 | /// User specified float for seconds to delay before accepting more input 27 | /// 28 | public float timeDelay = 0.25f; 29 | public enum Text_Type {Normal, Enter, Backspace}; 30 | public Text_Type TextType; 31 | void Start() 32 | { 33 | } 34 | 35 | // Update is called once per frame 36 | void Update() 37 | { 38 | } 39 | 40 | public void AddText() 41 | { 42 | if (Time.time - timer > timeDelay) 43 | { 44 | 45 | switch (TextType) 46 | { 47 | case Text_Type.Backspace: 48 | text.text = text.text.Substring(0, text.text.Length - 1); 49 | break; 50 | case Text_Type.Enter: 51 | text.text += "\r\n"; 52 | break; 53 | default: 54 | text.text += key; 55 | break; 56 | } 57 | timer = Time.time; 58 | } 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Keyboard/TextScript.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a167dbe6132b9004ba7769806e510320 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ffd318dbb37362c4f8d87863d082b2fd 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Materials/Default.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Default 11 | m_Shader: {fileID: 4800000, guid: 48beaeaa511bfe6439e83497a857e2fa, type: 3} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 1, g: 1, b: 1, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Materials/Default.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4ebb8f14063f19a45af503eee3cb70cb 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Materials/Default.shader: -------------------------------------------------------------------------------- 1 | Shader "Custom/ShadeMe" 2 | { 3 | Properties 4 | { 5 | _Color ("Color", Color) = (1,1,1,1) 6 | _MainTex ("Albedo (RGB)", 2D) = "white" {} 7 | _Glossiness ("Smoothness", Range(0,1)) = 0.5 8 | _Metallic ("Metallic", Range(0,1)) = 0.0 9 | } 10 | SubShader 11 | { 12 | Tags { "RenderType"="Opaque" } 13 | LOD 200 14 | 15 | CGPROGRAM 16 | // Physically based Standard lighting model, and enable shadows on all light types 17 | #pragma surface surf Standard fullforwardshadows 18 | 19 | // Use shader model 3.0 target, to get nicer looking lighting 20 | #pragma target 3.0 21 | 22 | sampler2D _MainTex; 23 | 24 | struct Input 25 | { 26 | float2 uv_MainTex; 27 | }; 28 | 29 | half _Glossiness; 30 | half _Metallic; 31 | fixed4 _Color; 32 | 33 | // Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader. 34 | // See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing. 35 | // #pragma instancing_options assumeuniformscaling 36 | UNITY_INSTANCING_BUFFER_START(Props) 37 | // put more per-instance properties here 38 | UNITY_INSTANCING_BUFFER_END(Props) 39 | 40 | void surf (Input IN, inout SurfaceOutputStandard o) 41 | { 42 | // Albedo comes from a texture tinted by color 43 | fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color; 44 | o.Albedo = c.rgb; 45 | // Metallic and smoothness come from slider variables 46 | o.Metallic = _Metallic; 47 | o.Smoothness = _Glossiness; 48 | o.Alpha = c.a; 49 | } 50 | ENDCG 51 | } 52 | FallBack "Diffuse" 53 | } 54 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Materials/Default.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 48beaeaa511bfe6439e83497a857e2fa 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Materials/Green.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Green 11 | m_Shader: {fileID: 4800000, guid: 48beaeaa511bfe6439e83497a857e2fa, type: 3} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0, g: 1, b: 0.103219986, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Materials/Green.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: feeca369d1c33f24ab1e4772d0c689f9 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Materials/Ground.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Ground 11 | m_Shader: {fileID: 4800000, guid: da24ea0f072c8c64985c103432f1db4c, type: 3} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: 100 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 300, y: 300} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0.3584906, g: 0.3584906, b: 0.3584906, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Materials/Ground.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10700199f92785d48840a5e5a6aa82fd 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Materials/Ground.shader: -------------------------------------------------------------------------------- 1 | Shader "Custom/Ground" 2 | { 3 | Properties 4 | { 5 | _Color ("Color", Color) = (1,1,1,1) 6 | _MainTex ("Albedo (RGB)", 2D) = "white" {} 7 | _Glossiness ("Smoothness", Range(0,1)) = 0.5 8 | _Metallic ("Metallic", Range(0,1)) = 0.0 9 | } 10 | SubShader 11 | { 12 | Tags { "RenderType"="Opaque" } 13 | LOD 200 14 | 15 | CGPROGRAM 16 | // Physically based Standard lighting model, and enable shadows on all light types 17 | #pragma surface surf Standard fullforwardshadows 18 | 19 | // Use shader model 3.0 target, to get nicer looking lighting 20 | #pragma target 3.0 21 | 22 | sampler2D _MainTex; 23 | 24 | struct Input 25 | { 26 | float2 uv_MainTex; 27 | }; 28 | 29 | half _Glossiness; 30 | half _Metallic; 31 | fixed4 _Color; 32 | 33 | // Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader. 34 | // See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing. 35 | // #pragma instancing_options assumeuniformscaling 36 | UNITY_INSTANCING_BUFFER_START(Props) 37 | // put more per-instance properties here 38 | UNITY_INSTANCING_BUFFER_END(Props) 39 | 40 | void surf (Input IN, inout SurfaceOutputStandard o) 41 | { 42 | // Albedo comes from a texture tinted by color 43 | fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color; 44 | o.Albedo = c.rgb; 45 | // Metallic and smoothness come from slider variables 46 | o.Metallic = _Metallic; 47 | o.Smoothness = _Glossiness; 48 | o.Alpha = c.a; 49 | } 50 | ENDCG 51 | } 52 | FallBack "Diffuse" 53 | } 54 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Materials/Ground.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da24ea0f072c8c64985c103432f1db4c 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Materials/Skybox_Mat.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_PrefabParentObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: Skybox_Mat 10 | m_Shader: {fileID: 106, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: _METALLIC_SETUP _SUNDISK_HIGH_QUALITY 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | - _SpecGlossMap: 58 | m_Texture: {fileID: 0} 59 | m_Scale: {x: 1, y: 1} 60 | m_Offset: {x: 0, y: 0} 61 | m_Floats: 62 | - _AtmosphereThickness: 0.53 63 | - _BumpScale: 1 64 | - _Cutoff: 0.5 65 | - _DetailNormalMapScale: 1 66 | - _DstBlend: 0 67 | - _Exposure: 1.25 68 | - _GlossMapScale: 1 69 | - _Glossiness: 0.5 70 | - _GlossyReflections: 1 71 | - _Metallic: 0 72 | - _Mode: 0 73 | - _OcclusionStrength: 1 74 | - _Parallax: 0.02 75 | - _SmoothnessTextureChannel: 0 76 | - _SpecularHighlights: 1 77 | - _SrcBlend: 1 78 | - _SunDisk: 2 79 | - _SunSize: 0.04 80 | - _SunSizeConvergence: 5 81 | - _UVSec: 0 82 | - _WorkflowMode: 1 83 | - _ZWrite: 1 84 | m_Colors: 85 | - _Color: {r: 1, g: 1, b: 1, a: 1} 86 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 87 | - _GroundColor: {r: 0.6392157, g: 0.6901961, b: 0.7411765, a: 1} 88 | - _SkyTint: {r: 1, g: 1, b: 1, a: 1} 89 | - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} 90 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Materials/Skybox_Mat.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0ffaa0b7117ba8c47a9d05ae701d4b4d 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Materials/Wall.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: Wall 11 | m_Shader: {fileID: 4800000, guid: 852ac80eb0580d1409325a0f05f7483f, type: 3} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 30, y: 30} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 0, g: 0.031918272, b: 0.2735849, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Materials/Wall.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: af44088bb7482944ca1e09c4392f485b 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Materials/Wall.shader: -------------------------------------------------------------------------------- 1 | Shader "Custom/Wall" 2 | { 3 | Properties 4 | { 5 | _Color ("Color", Color) = (1,1,1,1) 6 | _MainTex ("Albedo (RGB)", 2D) = "white" {} 7 | _Glossiness ("Smoothness", Range(0,1)) = 0.5 8 | _Metallic ("Metallic", Range(0,1)) = 0.0 9 | } 10 | SubShader 11 | { 12 | Tags { "RenderType"="Opaque" } 13 | LOD 200 14 | 15 | CGPROGRAM 16 | // Physically based Standard lighting model, and enable shadows on all light types 17 | #pragma surface surf Standard fullforwardshadows 18 | 19 | // Use shader model 3.0 target, to get nicer looking lighting 20 | #pragma target 3.0 21 | 22 | sampler2D _MainTex; 23 | 24 | struct Input 25 | { 26 | float2 uv_MainTex; 27 | }; 28 | 29 | half _Glossiness; 30 | half _Metallic; 31 | fixed4 _Color; 32 | 33 | // Add instancing support for this shader. You need to check 'Enable Instancing' on materials that use the shader. 34 | // See https://docs.unity3d.com/Manual/GPUInstancing.html for more information about instancing. 35 | // #pragma instancing_options assumeuniformscaling 36 | UNITY_INSTANCING_BUFFER_START(Props) 37 | // put more per-instance properties here 38 | UNITY_INSTANCING_BUFFER_END(Props) 39 | 40 | void surf (Input IN, inout SurfaceOutputStandard o) 41 | { 42 | // Albedo comes from a texture tinted by color 43 | fixed4 c = tex2D (_MainTex, IN.uv_MainTex) * _Color; 44 | o.Albedo = c.rgb; 45 | // Metallic and smoothness come from slider variables 46 | o.Metallic = _Metallic; 47 | o.Smoothness = _Glossiness; 48 | o.Alpha = c.a; 49 | } 50 | ENDCG 51 | } 52 | FallBack "Diffuse" 53 | } 54 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Materials/Wall.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 852ac80eb0580d1409325a0f05f7483f 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 26059737d2c9a3347bbc098fa4c35df1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Scenes/ExampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bcdc7984cd63d904d9e1741ddc799758 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 02a3527b6b33a924e8ec66aa805ea717 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Scripts/ChangeColor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEngine.UI; 5 | 6 | /// 7 | /// A simple script to change the color of an object 8 | /// 9 | 10 | public class ChangeColor : MonoBehaviour 11 | { 12 | Renderer rend; 13 | public Color[] colors; 14 | // Start is called before the first frame update 15 | void Start() 16 | { 17 | rend = this.GetComponent(); 18 | } 19 | public void ColorChange(int color) 20 | { 21 | rend.material.color = colors[color]; 22 | } 23 | // Update is called once per frame 24 | void Update() 25 | { 26 | 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Scripts/ChangeColor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d05fb63e9c199714889e59850e0de20c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Scripts/DisappearAtDistance.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace OSVR.UI 6 | { 7 | /// 8 | /// controls the visibility of text based on distance, both close and long range. 9 | /// 10 | /// 11 | /// ensures the screen is not cluttered since most items you care about must be within a certian range to be relevant. 12 | /// 13 | public class DisappearAtDistance : MonoBehaviour 14 | { 15 | /// 16 | /// Camera for doing vector calculations. The camera that the user uses to see the world 17 | /// 18 | [Tooltip("The camera that the user uses to see the world")] 19 | public GameObject userCamera; 20 | /// 21 | /// What this object will use as the second point to determine distance and scale, use is center to use this object 22 | /// 23 | [Tooltip("What this object will use as the second point to determine distance and scale, use is center to use this object")] 24 | public GameObject pivotPoint; 25 | /// 26 | /// Is this object the second point to determine the distance and scale? 27 | /// 28 | [Tooltip("Is this object the second point to determine the distance and scale?")] 29 | public bool isCenter; 30 | /// 31 | /// How close the user should be when this item disappears 32 | /// 33 | [Tooltip("How close the user should be when this item disappears")] 34 | public float disappearAtCloseDistance = -1; 35 | /// 36 | /// Should this item disappear if the user gets to far away? 37 | /// 38 | [Tooltip("Should this item disappear if the user gets to far away?")] 39 | public bool disappearWhenFarAway = false; 40 | /// 41 | /// The distance at which this item should disapear 42 | /// 43 | [Tooltip("The distance at which this item should disappear")] 44 | public float disappearAtFarDistance = 1000; 45 | 46 | /// 47 | /// Renderers that will turn on or off as stated by the script 48 | /// 49 | [Tooltip("Renderers that will turn on or off as stated by the script")] 50 | public ArrayList renderList = new ArrayList(); 51 | /// 52 | /// Use all renderers in this item 53 | /// 54 | [Tooltip("Use all renderers in this item")] 55 | public bool itemRenderer = true; 56 | /// 57 | /// Use all renderers in children 58 | /// 59 | [Tooltip("Use all renderers in children")] 60 | public bool childrenRenderer = true; 61 | /// 62 | /// Is this item visible? 63 | /// 64 | [Tooltip("Is this item visible?")] 65 | public bool isVisible = true; 66 | /// 67 | /// use this to know how large items whould be at the scale distance 68 | /// 69 | Vector3 sizeAtScaleDist; 70 | /// 71 | /// Use this for initialization 72 | /// 73 | void Start() 74 | { 75 | //handle renderers in children 76 | if (childrenRenderer) 77 | { 78 | foreach (Renderer r in this.gameObject.GetComponentsInChildren()) 79 | { 80 | renderList.Add(r); 81 | } 82 | if (!itemRenderer) 83 | { 84 | renderList.Remove(this.gameObject.GetComponent()); 85 | } 86 | } 87 | else 88 | { 89 | if (itemRenderer) 90 | { 91 | renderList.Add(this.gameObject.GetComponent()); 92 | } 93 | else 94 | { 95 | Debug.Log("None of the renderers are requested to be assigned, so this means the item will not disappear. Set the disappearAtNearDistance to a negative distance and turn DisappearAtFarDistance to false instead"); 96 | } 97 | } 98 | if (renderList.Count == 0 && (itemRenderer || childrenRenderer)) 99 | { 100 | Debug.Log("No renderers are selected dispite the fact that the options were selected. Check if the renderers are in the right place."); 101 | } 102 | } 103 | /// 104 | /// Add renderer to the list of renderers to turn on and off 105 | /// 106 | /// the renderer you need to add 107 | void addRenderer(Renderer r) 108 | { 109 | renderList.Add(r); 110 | r.enabled = isVisible; 111 | } 112 | /// 113 | /// Remove renderer to the list of renderers to turn on and off 114 | /// 115 | /// the renderer you need to remove 116 | void removeRenderer(Renderer r) 117 | { 118 | renderList.Remove(r); 119 | } 120 | /// 121 | /// Update is called once per frame 122 | /// 123 | void Update() 124 | { 125 | //get distance between obejcts 126 | float distance = (userCamera.transform.position - pivotPoint.transform.position).magnitude; 127 | print(distance); 128 | if (distance < disappearAtCloseDistance) 129 | { 130 | //check if you need to set visibility 131 | if (isVisible) 132 | { 133 | //set visibility 134 | isVisible = false; 135 | foreach (Renderer r in renderList) 136 | { 137 | r.enabled = false; 138 | } 139 | } 140 | //check if you are not close enough to be invisible 141 | } 142 | else 143 | { 144 | //check if you need to check for invisibility at distance 145 | if (disappearWhenFarAway) 146 | { 147 | //check if you are far enough to be invisible 148 | if (distance > disappearAtFarDistance) 149 | { 150 | //check if you need to change visibility 151 | if (isVisible) 152 | { 153 | //set visibility 154 | isVisible = false; 155 | foreach (Renderer r in renderList) 156 | { 157 | r.enabled = false; 158 | } 159 | } 160 | //if close enough to be visibile 161 | } 162 | else 163 | { 164 | //check if visibility needs to be changed 165 | if (!isVisible) 166 | { 167 | //set visibility 168 | isVisible = true; 169 | foreach (Renderer r in renderList) 170 | { 171 | r.enabled = true; 172 | } 173 | } 174 | } 175 | //if not close enough to be invisible and doesn't disappear at range, then it is visibile 176 | } 177 | else 178 | { 179 | //check if you need to set visibility 180 | if (!isVisible) 181 | { 182 | //set visibility 183 | isVisible = true; 184 | foreach (Renderer r in renderList) 185 | { 186 | r.enabled = true; 187 | } 188 | } 189 | } 190 | } 191 | } 192 | } 193 | } 194 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Scripts/DisappearAtDistance.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fdff2c15584a4c94d83cd4d6fdbce97d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Scripts/Pointer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | public class Pointer : MonoBehaviour 6 | { 7 | public LayerMask initialLayer; 8 | public LayerMask layerForCollision; 9 | private int initLayer; 10 | private int collLayer; 11 | private LineRenderer pointerLine; 12 | private SphereCollider pointerCollider; 13 | public float maxDrawDistance = 10.0f; 14 | public OVRInput.Controller controllerType; 15 | public OVRInput.Button activationButton; 16 | 17 | void Start() 18 | { 19 | initLayer = (int)Mathf.Log(initialLayer.value, 2); 20 | collLayer = (int)Mathf.Log(layerForCollision.value, 2); 21 | 22 | gameObject.layer = initLayer; 23 | pointerLine = GetComponent(); 24 | pointerCollider = GetComponent(); 25 | } 26 | 27 | void Update() 28 | { 29 | 30 | if(pointerLine != null) { 31 | RaycastHit info; 32 | Vector3 pos = gameObject.transform.position; 33 | Vector3 forward = gameObject.transform.forward; 34 | Vector3 hitPoint = pos + maxDrawDistance*forward; 35 | if (Physics.Raycast(new Ray(pos, forward), out info, maxDrawDistance, initLayer|collLayer)) { 36 | hitPoint = info.point; 37 | } 38 | 39 | pointerLine.SetPosition(0, pos); 40 | pointerLine.SetPosition(1, hitPoint); 41 | 42 | float height = Vector3.Distance(pos, hitPoint) / transform.lossyScale.z; 43 | pointerCollider.center = Vector3.forward * height; 44 | 45 | } 46 | 47 | if (OVRInput.Get(activationButton, controllerType)) 48 | { 49 | gameObject.layer = collLayer; 50 | } 51 | else 52 | { 53 | gameObject.layer = initLayer; 54 | } 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Scripts/Pointer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7d1dcb4d1f74d2747af78aec8da7e2c2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Scripts/README.md: -------------------------------------------------------------------------------- 1 | ## ScaleToUser 2 | 3 | To make this script work, put this script on the item you want to scale and set the following: 4 | 5 | **userCamera**: The camera that we use to do calculations of distance from the item. 6 | 7 | **pivotPoint**: The object that will be used to find disance between user and item for scale. 8 | 9 | **isCenter**: Determines if this item is the item we use for determining distance for scaling. 10 | 11 | **ScaleDist**: Distance at which we expect the item to be the original scale, any item further away than this will scale at the far scale rate, any item closer will scale at the nearScale rate. 12 | 13 | **farScale/nearScale**: Determines the rate of linear change in size based on distance. 14 | a value of 1 will make the item stay the same size, more than 1 will make the item grow, 15 | a value of less will make the items shrink as you move away but at a lower speed. 16 | 17 | 18 | 19 | ## RotateToUser 20 | 21 | To make this script work, put this script on the item you want to face the user and set the following: 22 | 23 | **userCamera**: The camera that we use to do calculations of rotation from the item. 24 | 25 | **pivotPoint**: The object that will be used to find rotation between user and item. 26 | 27 | **distanceFromPivotPoint**: This will make sure the item is orbiting at the correct distance. 28 | 29 | note: If your object moves inaddition to rotating to user, make the pivot point the object that moves, 30 | and make sure the rotating object is not a child of that object. 31 | 32 | 33 | 34 | ## DisappearAtDistance 35 | 36 | To make this script work, put this script on the item you want to disappear 37 | when outside of a certian range of distances from the user and set the following: 38 | 39 | **userCamera**: The camera that we use to do calculations of distance to item. 40 | 41 | **pivotPoint**: The object that will be used to find distance between user and item. 42 | 43 | **isCenter**: Determines if this item is the item we use for determining distance for distance finding. 44 | 45 | **disappearAtCloseDistance**: The item will disappear if it is closer than that distance. 46 | 47 | **disapearWhenFarAway**: Determines if the item will disappear at beyond a certian distance. 48 | 49 | **disapearAtFarDistance**: The item will disappear if it is further than this distance if disapearWhenFarAway is true 50 | 51 | note: This manually turns off the renders, so if any other scripts modify visibility this may turn off renderes 52 | and turn them on depending on what would be needed to fit the constraints. This could lead to renderers you set to off being turned on. 53 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Scripts/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e4e1ebf821e391c46b06fdf65b3b7b17 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Scripts/RotateToUser.cs: -------------------------------------------------------------------------------- 1 | 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | namespace OSVR.UI 6 | { 7 | /// 8 | /// ensures the items are turned in the right direction, intended to keep text readable at all angles. 9 | /// 10 | public class RotateToUser : MonoBehaviour 11 | { 12 | /// 13 | /// The camera that the user uses to see the world 14 | /// 15 | [Tooltip("The camera that the user uses to see the world")] 16 | public GameObject userCamera; 17 | /// 18 | /// What this object will orbit around 19 | /// 20 | [Tooltip("What this object will orbit around")] 21 | public GameObject pivotPoint; 22 | /// 23 | /// boolean for if this object is the second point to determine the distance and scale 24 | /// 25 | [Tooltip("Is this object the second point to determine the rotation?")] 26 | public bool isCenter; 27 | /// 28 | /// Distance this object will orbit around the pivotPoint 29 | /// 30 | [Tooltip("Distance this object will orbit around the pivotPoint")] 31 | public float distanceFromPivotPoint; 32 | /// 33 | /// used when there is no valid up, updates when applicable. 34 | /// 35 | Vector3 lastUp = new Vector3(0, 1, 0); 36 | /// 37 | /// FixedUpdate is called once per frame 38 | /// 39 | void Start() 40 | { 41 | if (isCenter) 42 | { 43 | pivotPoint = this.gameObject; 44 | } 45 | if (pivotPoint == null) 46 | { 47 | Debug.LogError("No pivot point specified"); 48 | } 49 | } 50 | void FixedUpdate() 51 | { 52 | //vector between objects 53 | Vector3 direction = pivotPoint.transform.position - userCamera.transform.position; 54 | //up according to camera 55 | Vector3 up = userCamera.transform.up; 56 | //up is normalized to the plane of the screen 57 | up = (up - Vector3.Project(up, direction)).normalized; 58 | //angle when up is in line with direction, leading to up = 0 59 | if (up.magnitude != 0) 60 | { 61 | //update lastUp 62 | lastUp = up; 63 | } 64 | else 65 | { 66 | //set up 67 | up = lastUp; 68 | } 69 | //find and set rotation 70 | Quaternion Look = Quaternion.LookRotation(direction, up); 71 | transform.rotation = Look; 72 | //set position 73 | transform.position = pivotPoint.transform.position - (distanceFromPivotPoint * direction.normalized); 74 | } 75 | } 76 | } 77 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Scripts/RotateToUser.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d448a88e41118f7479d25bfaa38c8d46 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Scripts/ScaleToUser.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using System; 5 | namespace OSVR.UI{ 6 | /// 7 | /// Makes items, typically text, change size based on distance from user. 8 | /// Items still foreshorten, but not at a rate that makes them hard to see. 9 | /// 10 | /// 11 | /// Changes the physical size, in relation to a given object relative to the user. 12 | /// 13 | /// 14 | public class ScaleToUser : MonoBehaviour 15 | { 16 | /// 17 | /// The camera that the user uses to see the world 18 | /// 19 | [Tooltip("The camera that the user uses to see the world")] 20 | public GameObject userCamera; 21 | /// 22 | /// What this object will use as the second point to determine distance and scale, use is center to use this object 23 | /// 24 | [Tooltip("What this object will use as the second point to determine distance and scale, use is center to use this object")] 25 | public GameObject pivotPoint; 26 | /// 27 | /// boolean for if this object is the second point to determine the distance and scale 28 | /// 29 | [Tooltip("Is this object the second point to determine the distance and scale?")] 30 | public bool isCenter; 31 | /// 32 | /// The linear scaling past the scaleDist 33 | /// 34 | [Tooltip("The linear scaling past the scaleDist")] 35 | public float farScale = 0.1f; 36 | /// 37 | /// The linear scaling between the scaleDist and the pivotPoint 38 | /// 39 | [Tooltip("The linear scaling between the scaleDist and the pivotPoint")] 40 | public float nearScale = 0.1f; 41 | /// 42 | /// Where the object should have its original size 43 | /// 44 | [Tooltip("Where the object should have its original size")] 45 | public float scaleDist = 1; 46 | /// 47 | /// gets the original dimentions 48 | /// 49 | Vector3 sizeAtScaleDist; 50 | /// 51 | /// initializes the object 52 | /// 53 | void Start() 54 | { 55 | 56 | if (isCenter) 57 | { 58 | pivotPoint = this.gameObject; 59 | } 60 | if (pivotPoint == null) 61 | { 62 | Debug.LogError("No pivot point specified"); 63 | } 64 | if (farScale > 1) 65 | { 66 | Debug.LogError("FarScale is incredibly large, please check the function that supplies this number"); 67 | } 68 | if (nearScale > 1) 69 | { 70 | Debug.LogError("nearScale is incredibly large, please check the function that supplies this number"); 71 | } 72 | //scale at scale dist is the original scale 73 | sizeAtScaleDist = this.transform.localScale; 74 | } 75 | /// 76 | /// Update is called once per frame 77 | /// 78 | void Update() 79 | { 80 | //get distance between obejcts 81 | float distance = (userCamera.transform.position - pivotPoint.transform.position).magnitude; 82 | //do the appropriate scaling 83 | if (distance > scaleDist) 84 | { 85 | distance = (((distance - scaleDist) * farScale) + 1); 86 | } 87 | else 88 | { 89 | distance = (((distance - scaleDist) * nearScale) + 1); 90 | } 91 | //set scale 92 | this.transform.localScale = distance * sizeAtScaleDist; 93 | } 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Scripts/ScaleToUser.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 71bd0e21f09e4af41812a4b9189e1df2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Scripts/SetCorrectCameraHeight.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using UnityEngine.XR; 3 | 4 | public class SetCorrectCameraHeight : MonoBehaviour 5 | { 6 | enum TrackingSpace 7 | { 8 | Stationary, 9 | RoomScale 10 | } 11 | 12 | [Header("Camera Settings")] 13 | 14 | [SerializeField] 15 | [Tooltip("Decide if experience is Room Scale or Stationary. Note this option does nothing for mobile VR experiences, these experience will default to Stationary")] 16 | TrackingSpace m_TrackingSpace = TrackingSpace.Stationary; 17 | 18 | [SerializeField] 19 | [Tooltip("Camera Height - overwritten by device settings when using Room Scale ")] 20 | float m_StationaryCameraYOffset = 1.36144f; 21 | 22 | [SerializeField] 23 | [Tooltip("GameObject to move to desired height off the floor (defaults to this object if none provided)")] 24 | GameObject m_CameraFloorOffsetObject; 25 | 26 | void Awake() 27 | { 28 | if (!m_CameraFloorOffsetObject) 29 | { 30 | Debug.LogWarning("No camera container specified for VR Rig, using attached GameObject"); 31 | m_CameraFloorOffsetObject = this.gameObject; 32 | } 33 | 34 | } 35 | 36 | void Start() 37 | { 38 | SetCameraHeight(); 39 | } 40 | 41 | void SetCameraHeight() 42 | { 43 | float cameraYOffset = m_StationaryCameraYOffset; 44 | if (m_TrackingSpace == TrackingSpace.Stationary) 45 | { 46 | XRDevice.SetTrackingSpaceType(TrackingSpaceType.Stationary); 47 | InputTracking.Recenter(); 48 | } 49 | else if (m_TrackingSpace == TrackingSpace.RoomScale) 50 | { 51 | if (XRDevice.SetTrackingSpaceType(TrackingSpaceType.RoomScale)) 52 | cameraYOffset = 0; 53 | } 54 | 55 | //Move camera to correct height 56 | if (m_CameraFloorOffsetObject) 57 | m_CameraFloorOffsetObject.transform.localPosition = new Vector3(m_CameraFloorOffsetObject.transform.localPosition.x, cameraYOffset, m_CameraFloorOffsetObject.transform.localPosition.z); 58 | } 59 | } 60 | 61 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Scripts/SetCorrectCameraHeight.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 99810d6c41db3ef47b4c63dd83298b8f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Scripts/SimpleHand.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | /// 6 | /// Extremely simple class for setting up a hand that moves with the position and rotation of an Oculus Touch Controller. 7 | /// 8 | public class SimpleHand : MonoBehaviour { 9 | 10 | public OVRInput.Controller controllerType; 11 | 12 | void Update () { 13 | transform.localPosition = OVRInput.GetLocalControllerPosition(controllerType); 14 | transform.localRotation = OVRInput.GetLocalControllerRotation(controllerType); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/Scripts/SimpleHand.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ea8717d62a91f534a8f73db66020cad9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/UIREADME.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/os-vr/OSVR-Senior-Project/a71e806af8e7d25aec8c3d1dd0d1d53c02307395/UI/Assets/OSVR_GUI/UIREADME.pdf -------------------------------------------------------------------------------- /UI/Assets/OSVR_GUI/UIREADME.pdf.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d92afa99cbaa71f41a46d45bab187365 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /UI/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ads": "2.0.8", 4 | "com.unity.analytics": "3.3.2", 5 | "com.unity.collab-proxy": "1.2.16", 6 | "com.unity.multiplayer-hlapi": "1.0.2", 7 | "com.unity.package-manager-ui": "2.1.2", 8 | "com.unity.purchasing": "2.0.6", 9 | "com.unity.render-pipelines.lightweight": "5.7.2", 10 | "com.unity.textmeshpro": "2.0.0", 11 | "com.unity.timeline": "1.0.0", 12 | "com.unity.xr.legacyinputhelpers": "2.0.2", 13 | "com.unity.xr.oculus.standalone": "1.29.1", 14 | "com.unity.modules.ai": "1.0.0", 15 | "com.unity.modules.animation": "1.0.0", 16 | "com.unity.modules.assetbundle": "1.0.0", 17 | "com.unity.modules.audio": "1.0.0", 18 | "com.unity.modules.cloth": "1.0.0", 19 | "com.unity.modules.director": "1.0.0", 20 | "com.unity.modules.imageconversion": "1.0.0", 21 | "com.unity.modules.imgui": "1.0.0", 22 | "com.unity.modules.jsonserialize": "1.0.0", 23 | "com.unity.modules.particlesystem": "1.0.0", 24 | "com.unity.modules.physics": "1.0.0", 25 | "com.unity.modules.physics2d": "1.0.0", 26 | "com.unity.modules.screencapture": "1.0.0", 27 | "com.unity.modules.terrain": "1.0.0", 28 | "com.unity.modules.terrainphysics": "1.0.0", 29 | "com.unity.modules.tilemap": "1.0.0", 30 | "com.unity.modules.ui": "1.0.0", 31 | "com.unity.modules.uielements": "1.0.0", 32 | "com.unity.modules.umbra": "1.0.0", 33 | "com.unity.modules.unityanalytics": "1.0.0", 34 | "com.unity.modules.unitywebrequest": "1.0.0", 35 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 36 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 37 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 38 | "com.unity.modules.unitywebrequestwww": "1.0.0", 39 | "com.unity.modules.vehicles": "1.0.0", 40 | "com.unity.modules.video": "1.0.0", 41 | "com.unity.modules.vr": "1.0.0", 42 | "com.unity.modules.wind": "1.0.0", 43 | "com.unity.modules.xr": "1.0.0" 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /UI/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 1024 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: OculusSpatializer 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /UI/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /UI/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 1 23 | m_ClothInterCollisionSettingsToggle: 0 24 | m_ContactPairsMode: 0 25 | m_BroadphaseType: 0 26 | m_WorldBounds: 27 | m_Center: {x: 0, y: 0, z: 0} 28 | m_Extent: {x: 250, y: 250, z: 250} 29 | m_WorldSubdivisions: 8 30 | -------------------------------------------------------------------------------- /UI/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: 8 | - enabled: 1 9 | path: Assets/Scenes/SampleScene.unity 10 | guid: d1c3109bdb54ad54c8a2b2838528e640 11 | m_configObjects: {} 12 | -------------------------------------------------------------------------------- /UI/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_SpritePackerMode: 0 12 | m_SpritePackerPaddingPower: 1 13 | m_EtcTextureCompressorBehavior: 1 14 | m_EtcTextureFastCompressor: 1 15 | m_EtcTextureNormalCompressor: 2 16 | m_EtcTextureBestCompressor: 4 17 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 18 | m_ProjectGenerationRootNamespace: 19 | m_UserGeneratedProjectSuffix: 20 | m_CollabEditorSettings: 21 | inProgressEnabled: 1 22 | -------------------------------------------------------------------------------- /UI/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | m_PreloadedShaders: [] 39 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 40 | type: 0} 41 | m_CustomRenderPipeline: {fileID: 11400000, guid: 7973e303b707b774faaaf3d91dec1dbc, 42 | type: 2} 43 | m_TransparencySortMode: 0 44 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 45 | m_DefaultRenderingPath: 1 46 | m_DefaultMobileRenderingPath: 1 47 | m_TierSettings: [] 48 | m_LightmapStripping: 0 49 | m_FogStripping: 0 50 | m_InstancingStripping: 0 51 | m_LightmapKeepPlain: 1 52 | m_LightmapKeepDirCombined: 1 53 | m_LightmapKeepDynamicPlain: 1 54 | m_LightmapKeepDynamicDirCombined: 1 55 | m_LightmapKeepShadowMask: 1 56 | m_LightmapKeepSubtractive: 1 57 | m_FogKeepLinear: 1 58 | m_FogKeepExp: 1 59 | m_FogKeepExp2: 1 60 | m_AlbedoSwatchInfos: [] 61 | m_LightsUseLinearIntensity: 1 62 | m_LightsUseColorTemperature: 0 63 | -------------------------------------------------------------------------------- /UI/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /UI/ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /UI/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 3 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 1 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_AutoSyncTransforms: 1 28 | m_AlwaysShowColliders: 0 29 | m_ShowColliderSleep: 1 30 | m_ShowColliderContacts: 0 31 | m_ShowColliderAABB: 0 32 | m_ContactArrowScale: 0.2 33 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 34 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 35 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 36 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 37 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 38 | -------------------------------------------------------------------------------- /UI/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: 7 | - type: 8 | m_NativeTypeID: 108 9 | m_ManagedTypePPtr: {fileID: 0} 10 | m_ManagedTypeFallback: 11 | defaultPresets: 12 | - m_Preset: {fileID: 2655988077585873504, guid: 463065d4f17d1d94d848aa127b94dd43, 13 | type: 2} 14 | - type: 15 | m_NativeTypeID: 1006 16 | m_ManagedTypePPtr: {fileID: 0} 17 | m_ManagedTypeFallback: 18 | defaultPresets: 19 | - m_Preset: {fileID: 2655988077585873504, guid: e638c0a99ead192429620acaff45cccb, 20 | type: 2} 21 | - type: 22 | m_NativeTypeID: 1020 23 | m_ManagedTypePPtr: {fileID: 0} 24 | m_ManagedTypeFallback: 25 | defaultPresets: 26 | - m_Preset: {fileID: 2655988077585873504, guid: fbe3044078845df4eafe8ccd620d0ac9, 27 | type: 2} 28 | -------------------------------------------------------------------------------- /UI/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.1.0f2 2 | m_EditorVersionWithRevision: 2019.1.0f2 (292b93d75a2c) 3 | -------------------------------------------------------------------------------- /UI/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 3 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | particleRaycastBudget: 4 33 | asyncUploadTimeSlice: 2 34 | asyncUploadBufferSize: 4 35 | resolutionScalingFixedDPIFactor: 1 36 | excludedTargetPlatforms: [] 37 | - serializedVersion: 2 38 | name: Low 39 | pixelLightCount: 0 40 | shadows: 0 41 | shadowResolution: 0 42 | shadowProjection: 1 43 | shadowCascades: 1 44 | shadowDistance: 20 45 | shadowNearPlaneOffset: 3 46 | shadowCascade2Split: 0.33333334 47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 48 | shadowmaskMode: 0 49 | blendWeights: 2 50 | textureQuality: 0 51 | anisotropicTextures: 0 52 | antiAliasing: 4 53 | softParticles: 0 54 | softVegetation: 0 55 | realtimeReflectionProbes: 0 56 | billboardsFaceCameraPosition: 0 57 | vSyncCount: 0 58 | lodBias: 0.4 59 | maximumLODLevel: 0 60 | particleRaycastBudget: 16 61 | asyncUploadTimeSlice: 2 62 | asyncUploadBufferSize: 4 63 | resolutionScalingFixedDPIFactor: 1 64 | excludedTargetPlatforms: [] 65 | - serializedVersion: 2 66 | name: Medium 67 | pixelLightCount: 1 68 | shadows: 1 69 | shadowResolution: 0 70 | shadowProjection: 1 71 | shadowCascades: 1 72 | shadowDistance: 20 73 | shadowNearPlaneOffset: 3 74 | shadowCascade2Split: 0.33333334 75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 76 | shadowmaskMode: 0 77 | blendWeights: 2 78 | textureQuality: 0 79 | anisotropicTextures: 1 80 | antiAliasing: 0 81 | softParticles: 0 82 | softVegetation: 0 83 | realtimeReflectionProbes: 0 84 | billboardsFaceCameraPosition: 0 85 | vSyncCount: 1 86 | lodBias: 0.7 87 | maximumLODLevel: 0 88 | particleRaycastBudget: 64 89 | asyncUploadTimeSlice: 2 90 | asyncUploadBufferSize: 4 91 | resolutionScalingFixedDPIFactor: 1 92 | excludedTargetPlatforms: [] 93 | - serializedVersion: 2 94 | name: High 95 | pixelLightCount: 2 96 | shadows: 2 97 | shadowResolution: 1 98 | shadowProjection: 1 99 | shadowCascades: 2 100 | shadowDistance: 40 101 | shadowNearPlaneOffset: 3 102 | shadowCascade2Split: 0.33333334 103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 104 | shadowmaskMode: 1 105 | blendWeights: 2 106 | textureQuality: 0 107 | anisotropicTextures: 1 108 | antiAliasing: 4 109 | softParticles: 0 110 | softVegetation: 1 111 | realtimeReflectionProbes: 1 112 | billboardsFaceCameraPosition: 1 113 | vSyncCount: 1 114 | lodBias: 1 115 | maximumLODLevel: 0 116 | particleRaycastBudget: 256 117 | asyncUploadTimeSlice: 2 118 | asyncUploadBufferSize: 4 119 | resolutionScalingFixedDPIFactor: 1 120 | excludedTargetPlatforms: [] 121 | - serializedVersion: 2 122 | name: Very High 123 | pixelLightCount: 3 124 | shadows: 2 125 | shadowResolution: 2 126 | shadowProjection: 1 127 | shadowCascades: 2 128 | shadowDistance: 70 129 | shadowNearPlaneOffset: 3 130 | shadowCascade2Split: 0.33333334 131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 132 | shadowmaskMode: 1 133 | blendWeights: 4 134 | textureQuality: 0 135 | anisotropicTextures: 1 136 | antiAliasing: 4 137 | softParticles: 1 138 | softVegetation: 1 139 | realtimeReflectionProbes: 1 140 | billboardsFaceCameraPosition: 1 141 | vSyncCount: 1 142 | lodBias: 1.5 143 | maximumLODLevel: 0 144 | particleRaycastBudget: 1024 145 | asyncUploadTimeSlice: 2 146 | asyncUploadBufferSize: 4 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Ultra 151 | pixelLightCount: 4 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 4 156 | shadowDistance: 150 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 1 164 | antiAliasing: 4 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 2 171 | maximumLODLevel: 0 172 | particleRaycastBudget: 4096 173 | asyncUploadTimeSlice: 2 174 | asyncUploadBufferSize: 4 175 | resolutionScalingFixedDPIFactor: 1 176 | excludedTargetPlatforms: [] 177 | m_PerPlatformDefaultQuality: 178 | Android: 2 179 | Nintendo 3DS: 5 180 | Nintendo Switch: 5 181 | PS4: 5 182 | PSP2: 2 183 | Standalone: 5 184 | Tizen: 2 185 | WebGL: 3 186 | WiiU: 5 187 | Windows Store Apps: 5 188 | XboxOne: 5 189 | iPhone: 2 190 | tvOS: 2 191 | -------------------------------------------------------------------------------- /UI/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: 7 | - FloorCollide 8 | - ExcludeTeleport 9 | - TeleportIgnore 10 | - IsClicked 11 | layers: 12 | - Default 13 | - TransparentFX 14 | - Ignore Raycast 15 | - 16 | - Water 17 | - UI 18 | - 19 | - 20 | - PostProcessing 21 | - Activation 22 | - Hover 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | - 41 | - 42 | - 43 | - 44 | m_SortingLayers: 45 | - name: Default 46 | uniqueID: 0 47 | locked: 0 48 | -------------------------------------------------------------------------------- /UI/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.1 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /UI/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | m_Enabled: 0 7 | m_TestMode: 0 8 | m_TestEventUrl: 9 | m_TestConfigUrl: 10 | m_TestInitMode: 0 11 | CrashReportingSettings: 12 | m_EventUrl: https://perf-events.cloud.unity3d.com/api/events/crashes 13 | m_NativeEventUrl: https://perf-events.cloud.unity3d.com/symbolicate 14 | m_Enabled: 1 15 | m_CaptureEditorExceptions: 1 16 | UnityPurchasingSettings: 17 | m_Enabled: 0 18 | m_TestMode: 0 19 | UnityAnalyticsSettings: 20 | m_Enabled: 1 21 | m_InitializeOnStartup: 1 22 | m_TestMode: 0 23 | m_TestEventUrl: 24 | m_TestConfigUrl: 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /UI/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /UI/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } -------------------------------------------------------------------------------- /UIREADME.md: -------------------------------------------------------------------------------- 1 | # Open Source VR Project 2 | [![Build Status](https://travis-ci.org/os-vr/OSVR-Senior-Project.svg?branch=master)](https://travis-ci.org/os-vr/OSVR-Senior-Project) 3 | [API Documentation](https://os-vr.github.io/OSVR-Senior-Project/namespace_gestures.html) 4 | 5 | 6 | # OSVR User Interface Installation Guide 7 | 8 | > **Requires** the Unity software version 2019.1 (or above). 9 | 10 | > **Requires** the Oculus Integration plugin from the Unity Asset Store. 11 | 12 | 13 | 14 | ## Getting Started 15 | 16 | ### Documentation 17 | 18 | Visit [Full Documentation](https://os-vr.github.io/OSVR-Senior-Project/namespace_gestures.html) for a detailed API 19 | 20 | ### Setting up the project 21 | * Create a new project in the Unity software version 2019.1 using 3D Template or open an existing project. 22 | 23 | * Ensure `Virtual Reality Supported` is checked: 24 | 25 | * In the Unity software select `Main Menu -> Edit -> Project Settings` to open the `Project Settings` window. 26 | 27 | * Select `Player` from the left hand menu in the `Project Settings` window. 28 | 29 | * In the `Player` settings panel expand `XR Settings`. 30 | 31 | * In `XR Settings` ensure the `Virtual Reality Supported` option is checked. 32 | 33 | * Ensure the project `Scripting Runtime Version` is set to `.NET 4.x Equivalent`: 34 | 35 | * In the Unity software select `Main Menu -> Edit -> Project Settings` to open the `Project Settings` inspector. 36 | 37 | * Select `Player` from the left hand menu in the `Project Settings` window. 38 | 39 | * In the `Player` settings panel expand `Other Settings`. 40 | 41 | * Ensure the `Scripting Runtime Version` is set to `.NET 4.x Equivalent`. 42 | 43 | * Download the `OSVR User Interface Framework` asset from the Unity Asset Store 44 | * Open the `UI/ExampleScenes/UIDemoScene` scene. 45 | 46 | ### Getting Started 47 | 48 | * Buttons 49 | * add a collider to the object you want to be a button 50 | * set the collider istrigger to True 51 | * add a button script to that object 52 | * set the activating and hovering layers to the layers you want them to interact with 53 | * ensure that the object can collide with these layers, you may need to check 'edit -> project settings -> physics' 54 | to see if the layers intersect 55 | * set the parameters to the desired number to change how the button reacts to hovering, if at all. 56 | * set the game objects that will be spawned based on the status of the button 57 | * set the unity events to have the correct delegates so they fire when the event occurs 58 | 59 | * DropDowns 60 | * place a button script on the object you want to be a dropdown (follow the full guide above) 61 | * set the Hovering and activating layers in the dropdown 62 | * ensure that the object can collide with these layers, you may need to check 'edit -> project settings -> physics' 63 | * ensure that your chosen template has a button script and a text mesh 64 | * set template to the gameobject that will be spawned for every button the dropdown makes 65 | * set Change In Height to an appropriate value for the spacing of the template between other buttons 66 | * set first offset to an appropriate value for the template to be spawned away from the main dropdown button 67 | * set Use Gradient or Use Instant Transition to true if you want all the buttons made by the drop down to have the same hovering effect 68 | * set the values below that to the values you want the spawned buttons to have when they are hovered. 69 | * if neither Use Gradient or Use Instant Transition are set to true the buttons will have the values specified on their option 70 | * go to options and set the number of options you want to display 71 | * set The label to the string you want to have displayed on the button's text mesh 72 | * set the parameters in option in the same manner as a button for all the extras gradients and colors 73 | * color fade of the gradient can only be set as the item fade in the dropdown script 74 | 75 | * Keyboard 76 | * drag the keyboard prefab into your scene 77 | * the keys are made using our ButtonScript where the events firing are tied to script modifying a Text object 78 | * To set the keys' text object to the one you want to modify, click on the key or shift click and select multiple keys, and within the attached TextScript, select the text object you want to be modified by the keys 79 | * Rotate To User 80 | * attach to the Game Object you want to rotate 81 | * set user camera to the camera the user uses to see the world 82 | * set is center to true if it should rotate in place if you set this to true ignore the rest of the set up guide 83 | * set the pivot point the object you want this object to orbit 84 | * set distance from pivot point to a reasonable value 85 | * Scale to user 86 | * attach to the Game Object you want to scale 87 | * set user camera to the camera the user uses to see the world 88 | * set ScaleDist to the distance at which this object should be at its starting size 89 | * set near scale and far scale to the appropriate value for how quickly you want them to scale 90 | * set is center to true if it should scale based on its current position if you set this to true ignore the rest of the set up guide 91 | * set the pivot point the object you want this object to do the distance scaling based on 92 | * Disappear At Distance 93 | * attach to the Game Object you want to toggle the visibility of 94 | * set user camera to the camera the user uses to see the world 95 | * set Disappear at Close Distance to a positive number if you want it to disappear when you get within that distance 96 | * set Disappear When Far Away and Disappear At Far Distance to True and the right value if you want it to disappear at a certain distance 97 | * set Item Renderer and Child Renderer to true if you want to have the renderer of the item and or the children of the item affected 98 | * set is center to true if it should scale based on its current position if you set this to true ignore the rest of the set up guide 99 | * set the pivot point the object you want this object to do the distance scaling based on 100 | -------------------------------------------------------------------------------- /docs/issue_templates/issue_template.md: -------------------------------------------------------------------------------- 1 | # Acceptance Criteria 2 | 3 | - [ ] CHECKLIST_ITEM_1 4 | - [ ] CHECKLIST_ITEM_2 5 | - [ ] CHECKLIST_ITEM_3 6 | 7 | ## Notes 8 | 9 | NOTES_FOR_ASSIGNEE 10 | -------------------------------------------------------------------------------- /docs/pull_request_templates/pull_request_template.md: -------------------------------------------------------------------------------- 1 | # Addressed Issue(s) 2 | 3 | (ISSUE_NUMBER e.g. #10) 4 | 5 | # Goals 6 | 7 | (WHAT PROBLEMS IS IT TRYING TO SOLVE? ...) 8 | 9 | # Special Considerations 10 | 11 | (WHAT DO THE REVIEWERS ALSO NEED TO KNOW? ...) 12 | 13 | # Acceptance Criteria 14 | 15 | (WHAT ARE THE OUTCOMES? ...) 16 | 17 | # Testing 18 | 19 | (HOW DO THE REVIEWERS VERIFY IT WORKS? ...) 20 | -------------------------------------------------------------------------------- /docs/read_me_templates/read_me_template.md: -------------------------------------------------------------------------------- 1 | template goes here 2 | -------------------------------------------------------------------------------- /images/UIInspector.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/os-vr/OSVR-Senior-Project/a71e806af8e7d25aec8c3d1dd0d1d53c02307395/images/UIInspector.png -------------------------------------------------------------------------------- /images/XORGesture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/os-vr/OSVR-Senior-Project/a71e806af8e7d25aec8c3d1dd0d1d53c02307395/images/XORGesture.png -------------------------------------------------------------------------------- /images/XORVisual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/os-vr/OSVR-Senior-Project/a71e806af8e7d25aec8c3d1dd0d1d53c02307395/images/XORVisual.png -------------------------------------------------------------------------------- /scripts/deploy.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | set -ev 3 | echo "Testing Build Process" 4 | 5 | doxygen Doxyfile 6 | 7 | shopt -s extglob 8 | rm -rf !(html) 9 | cd html 10 | mv * ../ 11 | cd .. 12 | rm -rf html 13 | 14 | if [ "$TRAVIS_BRANCH" = "master" ]; then 15 | echo "Running API Docs, push to gh-pages" 16 | 17 | git config --global user.email "travis@travis-ci.org" 18 | git config --global user.name "Travis CI" 19 | 20 | git checkout -b gh-pages 21 | echo "Test" > doc.txt 22 | git add . 23 | git commit -m "Travis build: $TRAVIS_BUILD_NUMBER" 24 | 25 | ls 26 | 27 | git push -f https://${GITHUB_API_KEY}@github.com/os-vr/OSVR-Senior-Project.git 28 | 29 | fi 30 | 31 | --------------------------------------------------------------------------------