├── .github └── CODE_OF_CONDUCT.md ├── LICENSE.md ├── LICENSE.md.meta ├── README.md ├── README.md.meta ├── Runtime.meta └── Runtime ├── Tracking.meta └── Tracking ├── Velocity.meta └── Velocity ├── OVRAnchorVelocityEstimator.cs └── OVRAnchorVelocityEstimator.cs.meta /.github/CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Code of Conduct 2 | 3 | Contact: hello@extendreality.io 4 | 5 | ## Why have a Code of Conduct? 6 | 7 | As contributors and maintainers of this project, we are committed to providing a friendly, safe and welcoming environment for all, regardless of age, disability, gender, nationality, race, religion, sexuality, or similar personal characteristic. 8 | 9 | The goal of the Code of Conduct is to specify a baseline standard of behavior so that people with different social values and communication styles can talk about Extend Reality Ltd products and repositories effectively, productively, and respectfully, even in face of disagreements. The Code of Conduct also provides a mechanism for resolving conflicts in the community when they arise. 10 | 11 | ## Our Values 12 | 13 | These are the values Extend Reality Ltd developers and repository contributors should aspire to: 14 | 15 | * Be friendly and welcoming 16 | * Be patient 17 | * Remember that people have varying communication styles and that not everyone is using their native language. (Meaning and tone can be lost in translation.) 18 | * Be thoughtful 19 | * Productive communication requires effort. Think about how your words will be interpreted. 20 | * Remember that sometimes it is best to refrain entirely from commenting. 21 | * Be respectful 22 | * In particular, respect differences of opinion. It is important that we resolve disagreements and differing views constructively. 23 | * Avoid destructive behavior 24 | * Derailing: stay on topic; if you want to talk about something else, start a new conversation. 25 | * Unconstructive criticism: don't merely decry the current state of affairs; offer (or at least solicit) suggestions as to how things may be improved. 26 | * Snarking (pithy, unproductive, sniping comments). 27 | 28 | The following actions are explicitly forbidden: 29 | 30 | * Insulting, demeaning, hateful, or threatening remarks. 31 | * Discrimination based on age, disability, gender, nationality, race, religion, sexuality, or similar personal characteristic. 32 | * Bullying or systematic harassment. 33 | * Unwelcome sexual advances. 34 | * Incitement to any of these. 35 | 36 | ## Where does the Code of Conduct apply? 37 | 38 | If you participate in or contribute to the Extend Reality Ltd ecosystem in any way, you are encouraged to follow the Code of Conduct while doing so. 39 | 40 | Explicit enforcement of the Code of Conduct applies to the official mediums operated by the Extend Reality Ltd project: 41 | 42 | * The official GitHub projects and code reviews. 43 | * The official slack channels. 44 | * The official forums. 45 | 46 | Other Extend Reality Ltd product and company activities (such as conferences, meetups, and other unofficial forums) are encouraged to adopt this Code of Conduct. Such groups must provide their own contact information. 47 | 48 | Project maintainers may remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. 49 | 50 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by emailing: hello@extendreality.io. All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. **All reports will be kept confidential**. 51 | 52 | **The goal of the Code of Conduct is to resolve conflicts in the most harmonious way possible**. We hope that in most cases issues may be resolved through polite discussion and mutual agreement. Bannings and other forceful measures are to be employed only as a last resort. **Do not** post about the issue publicly or try to rally sentiment against a particular individual or group. 53 | 54 | ## Acknowledgments 55 | 56 | This document was based on the Code of Conduct from the Elixir project. -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2019 Extend Reality Ltd 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. -------------------------------------------------------------------------------- /LICENSE.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9018960d906964b47ae737704219becc 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ## Deprecated Repository 2 | 3 | This tutorial has been deprecated in place of newer tutorials and how to guides included with the [Tilia.SDK.OculusIntegration.Unity](https://github.com/ExtendRealityLtd/Tilia.SDK.OculusIntegration.Unity) repository. Please see the [Documentation](https://github.com/ExtendRealityLtd/Tilia.SDK.OculusIntegration.Unity/tree/master/Documentation) located on that repository. 4 | 5 | # VRTK Tutorials - Oculus Integration 6 | 7 | ## Introduction 8 | 9 | Prefabs and code for use with the [Oculus Integration] [Unity] Package. 10 | 11 | The written tutorials can be found at the [VRTK Academy -> Tutorials -> Working With 3rd Party SDKs -> Using Oculus Integration]. 12 | 13 | ## Getting Started 14 | 15 | The intention of this repository is to support the tutorials on the [VRTK Academy], however it can simply be checked out into an existing [VRTK] project and used as is. 16 | 17 | ### Cloning the VRTK.Tutorials.OculusIntegration repo into a project 18 | 19 | * Navigate to the `Assets/` directory of your project. 20 | * Git clone this repo into the `Assets/` directory: 21 | * `git clone https://github.com/ExtendRealityLtd/VRTK.Tutorials.OculusIntegration.git` - [How To Clone A Repo] 22 | * Wait for the Unity software to finish importing the cloned files. 23 | 24 | ## Contributing 25 | 26 | We're not currently in a place where accepting contributions would be helpful. But as soon as we're ready we'll let you know! 27 | 28 | ## License 29 | 30 | Code released under the [MIT License]. 31 | 32 | ## Disclaimer 33 | 34 | These materials are not sponsored by or affiliated with Unity Technologies or its affiliates. "Unity" is a trademark or registered trademark of Unity Technologies or its affiliates in the U.S. and elsewhere. 35 | 36 | [VRTK]: https://github.com/ExtendRealityLtd/VRTK 37 | [VRTK Academy]: https://academy.vrtk.io 38 | [VRTK Academy -> Tutorials -> Working With 3rd Party SDKs -> Using Oculus Integration]: https://academy.vrtk.io/Documentation/Tutorials/WorkingWith3rdPartySDKs/UsingOculusIntegration/ 39 | [Oculus Integration]: https://developer.oculus.com/downloads/package/unity-integration/ 40 | [How To Clone A Repo]: https://help.github.com/articles/cloning-a-repository/ 41 | [Unity]: https://unity3d.com/ 42 | [MIT License]: LICENSE.md 43 | -------------------------------------------------------------------------------- /README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65605751846783148a820f136ed9a4d7 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c457443384f181a4791cee85bc50c11f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Tracking.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85b8b0e9e6c117d40974e6f5a19a2d74 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Tracking/Velocity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 245430c9838f1f749987e6c8ecaf1332 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Runtime/Tracking/Velocity/OVRAnchorVelocityEstimator.cs: -------------------------------------------------------------------------------- 1 | namespace OculusIntegrationForVRTK.Tracking.Velocity 2 | { 3 | using UnityEngine; 4 | using Zinnia.Tracking.Velocity; 5 | 6 | public class OVRAnchorVelocityEstimator : VelocityTracker 7 | { 8 | [Tooltip("The anchor from the OVRCameraRig to track velocity for.")] 9 | public GameObject trackedGameObject; 10 | [Tooltip("An optional object to consider the source relative to when retrieving velocities.")] 11 | public GameObject relativeTo; 12 | 13 | public override bool IsActive() 14 | { 15 | return trackedGameObject != null && trackedGameObject.activeInHierarchy && isActiveAndEnabled; 16 | } 17 | 18 | protected override Vector3 DoGetAngularVelocity() 19 | { 20 | switch (trackedGameObject.name) 21 | { 22 | case "CenterEyeAnchor": 23 | return trackedGameObject.transform.rotation * (OVRManager.isHmdPresent ? OVRPlugin.GetNodeAngularVelocity(OVRPlugin.Node.EyeCenter, OVRPlugin.Step.Render).FromFlippedZVector3f() : Vector3.zero); 24 | case "LeftHandAnchor": 25 | return trackedGameObject.transform.rotation * OVRInput.GetLocalControllerAngularVelocity(OVRInput.Controller.LTouch); 26 | case "RightHandAnchor": 27 | return trackedGameObject.transform.rotation * OVRInput.GetLocalControllerAngularVelocity(OVRInput.Controller.RTouch); 28 | } 29 | return Vector3.zero; 30 | } 31 | 32 | protected override Vector3 DoGetVelocity() 33 | { 34 | switch (trackedGameObject.name) 35 | { 36 | case "CenterEyeAnchor": 37 | return relativeTo.transform.rotation * (OVRManager.isHmdPresent ? OVRPlugin.GetNodeVelocity(OVRPlugin.Node.EyeCenter, OVRPlugin.Step.Render).FromFlippedZVector3f() : Vector3.zero); 38 | case "LeftHandAnchor": 39 | return relativeTo.transform.rotation * OVRInput.GetLocalControllerVelocity(OVRInput.Controller.LTouch); 40 | case "RightHandAnchor": 41 | return relativeTo.transform.rotation * OVRInput.GetLocalControllerVelocity(OVRInput.Controller.RTouch); 42 | } 43 | return Vector3.zero; 44 | } 45 | } 46 | } -------------------------------------------------------------------------------- /Runtime/Tracking/Velocity/OVRAnchorVelocityEstimator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c06287e101a7c024185227cd4d1c239f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | --------------------------------------------------------------------------------