diff --git a/com.htc.upm.wave.essence/Editor/EssenceSettingsProvider.cs b/com.htc.upm.wave.essence/Editor/EssenceSettingsProvider.cs index a6057752..c9967b6a 100644 --- a/com.htc.upm.wave.essence/Editor/EssenceSettingsProvider.cs +++ b/com.htc.upm.wave.essence/Editor/EssenceSettingsProvider.cs @@ -63,7 +63,7 @@ private static void CheckingWavePackagePath() } } - #region Essence.Controller.Model asset + #region Essence.Controller.Model asset const string kControllerModelAsset = "/ControllerModel.asset"; public static void UpdateAssetControllerModel(bool importedControllerModelPackage) { @@ -94,9 +94,9 @@ internal static bool IsControllerModelPackageOnceImported() PackageEssenceAsset asset = AssetDatabase.LoadAssetAtPath(WaveEssencePath + kControllerModelAsset, typeof(PackageEssenceAsset)) as PackageEssenceAsset; return asset.importedControllerModelPackage; } - #endregion + #endregion - #region Essence.InputModule asset + #region Essence.InputModule asset const string kInputModuleAsset = "/InputModule.asset"; public static void UpdateAssetInputModule(bool importedInputModulePackage) { @@ -123,9 +123,9 @@ internal static bool IsInputModulePackageOnceImported() PackageEssenceAsset asset = AssetDatabase.LoadAssetAtPath(WaveEssencePath + kInputModuleAsset, typeof(PackageEssenceAsset)) as PackageEssenceAsset; return asset.importedInputModulePackage; } - #endregion + #endregion - #region Essence.Hand.Model asset + #region Essence.Hand.Model asset const string kHandModelAsset = "/HandModel.asset"; public static void UpdateAssetHandModel(bool importedHandModelPackage) { @@ -152,9 +152,9 @@ internal static bool IsHandModelPackageOnceImported() PackageEssenceAsset asset = AssetDatabase.LoadAssetAtPath(WaveEssencePath + kHandModelAsset, typeof(PackageEssenceAsset)) as PackageEssenceAsset; return asset.importedHandModelPackage; } - #endregion + #endregion - #region Essence.Interaction.Mode asset + #region Essence.Interaction.Mode asset const string kInteractionModeAsset = "/InteractionMode.asset"; public static void UpdateAssetInteractionMode(bool importedInteractionModePackage) { @@ -181,9 +181,9 @@ internal static bool IsInteractionModePackageOnceImported() PackageEssenceAsset asset = AssetDatabase.LoadAssetAtPath(WaveEssencePath + kInteractionModeAsset, typeof(PackageEssenceAsset)) as PackageEssenceAsset; return asset.importedInteractionModePackage; } - #endregion + #endregion - #region BodyTracking asset + #region BodyTracking asset const string kBodyTrackingAsset = "/BodyTracking.asset"; public static void UpdateAssetBodyTracking(bool importedBodyTrackingPackage) { @@ -210,7 +210,36 @@ internal static bool IsBodyTrackingPackageOnceImported() PackageEssenceAsset asset = AssetDatabase.LoadAssetAtPath(WaveEssencePath + kBodyTrackingAsset, typeof(PackageEssenceAsset)) as PackageEssenceAsset; return asset.importedBodyTrackingPackage; } - #endregion + #endregion + + #region FacialExpressionMaker asset + const string kFacialExpressionMakerAsset = "/FacialExpressionMaker.asset"; + public static void UpdateAssetFacialExpressionMaker(bool importedFacialExpressionMakerPackage) + { + PackageEssenceAsset asset = null; + if (File.Exists(WaveEssencePath + kFacialExpressionMakerAsset)) + { + asset = AssetDatabase.LoadAssetAtPath(WaveEssencePath + kFacialExpressionMakerAsset, typeof(PackageEssenceAsset)) as PackageEssenceAsset; + asset.importedFacialExpressionMakerPackage = importedFacialExpressionMakerPackage; + } + else + { + asset = ScriptableObject.CreateInstance(typeof(PackageEssenceAsset)) as PackageEssenceAsset; + asset.importedFacialExpressionMakerPackage = importedFacialExpressionMakerPackage; + AssetDatabase.CreateAsset(asset, WaveEssencePath + kFacialExpressionMakerAsset); + } + AssetDatabase.SaveAssets(); + Debug.Log("UpdateAssetFacialExpressionMaker() " + WaveEssencePath + kFacialExpressionMakerAsset + ", importedFacialExpressionMakerPackage: " + asset.importedFacialExpressionMakerPackage); + } + internal static bool IsFacialExpressionMakerPackageOnceImported() + { + if (!File.Exists(WaveEssencePath + kFacialExpressionMakerAsset)) + return false; + + PackageEssenceAsset asset = AssetDatabase.LoadAssetAtPath(WaveEssencePath + kFacialExpressionMakerAsset, typeof(PackageEssenceAsset)) as PackageEssenceAsset; + return asset.importedFacialExpressionMakerPackage; + } + #endregion private static readonly string[] essenceKeywords = new string[] { @@ -229,21 +258,25 @@ internal static bool IsBodyTrackingPackageOnceImported() "URPMaterials", "Spectator", "BodyTracking", + "FacialExpressionMaker", }; internal static UnityEditor.PackageManager.PackageInfo pi = null; + internal static UnityEditor.PackageManager.PackageInfo piXrsdk = null; - public EssenceSettingsProvider(string path, SettingsScope scope = SettingsScope.Project) + public EssenceSettingsProvider(string path, SettingsScope scope = SettingsScope.Project) : base(path, scope, essenceKeywords) { CheckingWavePackagePath(); pi = SearchInPackageList(Constants.EssencePackageName); + piXrsdk = SearchInPackageList(Constants.SDKPackageName); } internal static void Init() { CheckingWavePackagePath(); pi = SearchInPackageList(Constants.EssencePackageName); + piXrsdk = SearchInPackageList(Constants.SDKPackageName); } private const string FAKE_VERSION = "0.0.0"; @@ -254,6 +287,8 @@ internal static void Init() internal const string kInputModulePackage = "wave_essence_inputmodule.unitypackage"; internal const string kHandModelPath = "/Hand/Model"; internal const string kHandModelPackage = "wave_essence_hand_model.unitypackage"; + internal const string kHandInteractionPath = "/Hand/Interaction"; + internal const string kHandInteractionPackage = "wave_essence_hand_interaction.unitypackage"; internal const string kInteractionModePath = "/Interaction/Mode"; internal const string kInteractionModePackage = "wave_essence_interaction_mode.unitypackage"; internal const string kInteractionToolkitPath = "/Interaction/Toolkit"; @@ -269,19 +304,23 @@ internal static void Init() internal const string kTrackerModelPath = "/Tracker/Model"; internal const string kTrackerModelPackage = "wave_essence_tracker_model.unitypackage"; internal const string kScenePerceptionPath = "/ScenePerception"; - internal const string kScenePerceptionPackage = "wave_essence_sceneperception.unitypackage"; - internal const string kTrackableMarkerPath = "/TrackableMarker"; + internal const string kScenePerceptionPackage = "wave_essence_sceneperception.unitypackage"; + internal const string kScenePerceptionDemoPackage = "wave_essence_sceneperception.demo.unitypackage"; + internal const string kTrackableMarkerPath = "/TrackableMarker"; internal const string kTrackableMarkerPackage = "wave_essence_trackablemarker.unitypackage"; internal const string kURPMaterialsPackage = "wave_essence_urpmaterials.unitypackage"; internal const string kSpectatorPath = "/Spectator"; internal const string kSpectatorPackage = "wave_essence_spectator.unitypackage"; internal const string kBodyTrackingPath = "/BodyTracking"; internal const string kBodyTrackingPackage = "wave_essence_bodytracking.unitypackage"; + internal const string kFacialExpressionMakerPath = "/FacialExpression/Maker"; + internal const string kFacialExpressionMakerPackage = "wave_essence_facialexpressionmaker.unitypackage"; internal const string kVrm1Package = "VRM-0.109.0_7aff.unitypackage"; internal static bool featureControllerModelImported = false; internal static bool featureInputModuleImported = false; internal static bool featureHandModelImported = false; + internal static bool featureHandInteractionImported = false; internal static bool featureInteractionModeImported = false; internal static bool featureInteractionToolkitImported = false; internal static bool featureCameraTextureImported = false; @@ -290,13 +329,16 @@ internal static void Init() internal static bool featureRenderDocImported = false; internal static bool featureTrackerModelImported = false; internal static bool featureScenePerceptionImported = false; - internal static bool featureTrackableMarkerImported = false; + internal static bool featureScenePerceptionDemoImported = false; + internal static bool featureTrackableMarkerImported = false; internal static bool featureSpectatorImported = false; internal static bool featureBodyTrackingImported = false; + internal static bool featureFacialExpressionMakerImported = false; internal static bool featureControllerModelNeedUpdate = false; internal static bool featureInputModuleNeedUpdate = false; internal static bool featureHandModelNeedUpdate = false; + internal static bool featureHandInteractionlNeedUpdate = false; internal static bool featureInteractionModeNeedUpdate = false; internal static bool featureInteractionToolkitNeedUpdate = false; internal static bool featureCameraTextureNeedUpdate = false; @@ -308,6 +350,7 @@ internal static void Init() internal static bool featureTrackableMarkerNeedUpdate = false; internal static bool featureSpectatorNeedUpdate = false; internal static bool featureBodyTrackingNeedUpdate = false; + internal static bool featureFacialExpressionMakerNeedUpdate = false; internal static bool hasFeatureNeedUpdate = false; @@ -316,6 +359,7 @@ internal static bool checkFeaturePackages() featureControllerModelImported = Directory.Exists(WaveEssencePath + kControllerModelPath); featureInputModuleImported = Directory.Exists(WaveEssencePath + kInputModulePath); featureHandModelImported = Directory.Exists(WaveEssencePath + kHandModelPath); + featureHandInteractionImported = Directory.Exists(WaveEssencePath + kHandInteractionPath); featureInteractionModeImported = Directory.Exists(WaveEssencePath + kInteractionModePath); featureInteractionToolkitImported = Directory.Exists(WaveEssencePath + kInteractionToolkitPath); featureCameraTextureImported = Directory.Exists(WaveEssencePath + kCameraTexturePath); @@ -324,19 +368,26 @@ internal static bool checkFeaturePackages() featureRenderDocImported = Directory.Exists(WaveEssencePath + kRenderDocPath); featureTrackerModelImported = Directory.Exists(WaveEssencePath + kTrackerModelPath); featureScenePerceptionImported = Directory.Exists(WaveEssencePath + kScenePerceptionPath); - featureTrackableMarkerImported = Directory.Exists(WaveEssencePath + kTrackableMarkerPath); + featureTrackableMarkerImported = Directory.Exists(WaveEssencePath + kTrackableMarkerPath); featureSpectatorImported = Directory.Exists(WaveEssencePath + kSpectatorPath); featureBodyTrackingImported = Directory.Exists(WaveEssencePath + kBodyTrackingPath); + featureFacialExpressionMakerImported = Directory.Exists(WaveEssencePath + kFacialExpressionMakerPath); if (pi == null) return false; + + featureScenePerceptionDemoImported = featureScenePerceptionImported && (Directory.Exists(WaveEssencePath + kScenePerceptionPath + "/" + pi.version + "/Demo") || +Directory.Exists(WaveEssencePath + kScenePerceptionPath + "/" + FAKE_VERSION + "/Demo")); + - featureControllerModelNeedUpdate = featureControllerModelImported && !Directory.Exists(WaveEssencePath + kControllerModelPath + "/" + pi.version) && + featureControllerModelNeedUpdate = featureControllerModelImported && !Directory.Exists(WaveEssencePath + kControllerModelPath + "/" + pi.version) && !Directory.Exists(WaveEssencePath + kControllerModelPath + "/" + FAKE_VERSION); featureInputModuleNeedUpdate = featureInputModuleImported && !Directory.Exists(WaveEssencePath + kInputModulePath + "/" + pi.version) && !Directory.Exists(WaveEssencePath + kInputModulePath + "/" + FAKE_VERSION); featureHandModelNeedUpdate = featureHandModelImported && !Directory.Exists(WaveEssencePath + kHandModelPath + "/" + pi.version) && !Directory.Exists(WaveEssencePath + kHandModelPath + "/" + FAKE_VERSION); + featureHandInteractionlNeedUpdate = featureHandInteractionImported && !Directory.Exists(WaveEssencePath + kHandInteractionPath + "/" + pi.version) && + !Directory.Exists(WaveEssencePath + kHandInteractionPath + "/" + FAKE_VERSION); featureInteractionModeNeedUpdate = featureInteractionModeImported && !Directory.Exists(WaveEssencePath + kInteractionModePath + "/" + pi.version) && !Directory.Exists(WaveEssencePath + kInteractionModePath + "/" + FAKE_VERSION); featureInteractionToolkitNeedUpdate = featureInteractionToolkitImported && !Directory.Exists(WaveEssencePath + kInteractionToolkitPath + "/" + pi.version) && @@ -353,14 +404,16 @@ internal static bool checkFeaturePackages() !Directory.Exists(WaveEssencePath + kTrackerModelPath + "/" + FAKE_VERSION); featureScenePerceptionNeedUpdate = featureScenePerceptionImported && !Directory.Exists(WaveEssencePath + kScenePerceptionPath + "/" + pi.version) && !Directory.Exists(WaveEssencePath + kScenePerceptionPath + "/" + FAKE_VERSION); - featureTrackableMarkerNeedUpdate = featureTrackableMarkerImported && !Directory.Exists(WaveEssencePath + kTrackableMarkerPath + "/" + pi.version) && + featureTrackableMarkerNeedUpdate = featureTrackableMarkerImported && !Directory.Exists(WaveEssencePath + kTrackableMarkerPath + "/" + pi.version) && !Directory.Exists(WaveEssencePath + kTrackableMarkerPath + "/" + FAKE_VERSION); featureSpectatorNeedUpdate = featureSpectatorImported && !Directory.Exists(WaveEssencePath + kSpectatorPath + "/" + pi.version) && !Directory.Exists(WaveEssencePath + kSpectatorPath + "/" + FAKE_VERSION); featureBodyTrackingNeedUpdate = featureBodyTrackingImported && !Directory.Exists(WaveEssencePath + kBodyTrackingPath + "/" + pi.version) && !Directory.Exists(WaveEssencePath + kBodyTrackingPath + "/" + FAKE_VERSION); + featureFacialExpressionMakerNeedUpdate = featureFacialExpressionMakerImported && !Directory.Exists(WaveEssencePath + kFacialExpressionMakerPath + "/" + pi.version) && + !Directory.Exists(WaveEssencePath + kFacialExpressionMakerPath + "/" + FAKE_VERSION); - hasFeatureNeedUpdate = featureControllerModelNeedUpdate || featureInputModuleNeedUpdate || featureHandModelNeedUpdate || featureInteractionModeNeedUpdate || featureInteractionToolkitNeedUpdate || - featureCameraTextureNeedUpdate || featureCompositorLayerNeedUpdate || featureBundlePreviewNeedUpdate || featureRenderDocNeedUpdate || featureScenePerceptionNeedUpdate || featureTrackableMarkerNeedUpdate || featureSpectatorNeedUpdate || featureBodyTrackingNeedUpdate; + hasFeatureNeedUpdate = featureControllerModelNeedUpdate || featureInputModuleNeedUpdate || featureHandModelNeedUpdate || featureHandInteractionlNeedUpdate || featureInteractionModeNeedUpdate || featureInteractionToolkitNeedUpdate || + featureCameraTextureNeedUpdate || featureCompositorLayerNeedUpdate || featureBundlePreviewNeedUpdate || featureRenderDocNeedUpdate || featureScenePerceptionNeedUpdate || featureTrackableMarkerNeedUpdate || featureSpectatorNeedUpdate || featureBodyTrackingNeedUpdate || featureFacialExpressionMakerNeedUpdate; return hasFeatureNeedUpdate; } @@ -374,6 +427,8 @@ public static void UpdateAllModules() UpdateModule(WaveEssencePath + kInputModulePath, kInputModulePackage); if (featureHandModelNeedUpdate) UpdateModule(WaveEssencePath + kHandModelPath, kHandModelPackage); + if (featureHandInteractionlNeedUpdate) + UpdateModule(WaveEssencePath + kHandInteractionPath, kHandInteractionPackage); if (featureInteractionModeNeedUpdate) UpdateModule(WaveEssencePath + kInteractionModePath, kInteractionModePackage); if (featureCameraTextureNeedUpdate) @@ -396,8 +451,112 @@ public static void UpdateAllModules() UpdateModule(WaveEssencePath + kSpectatorPath, kSpectatorPackage); if (featureBodyTrackingNeedUpdate) UpdateModule(WaveEssencePath + kBodyTrackingPath, kBodyTrackingPackage); + if (featureFacialExpressionMakerNeedUpdate) + UpdateModule(WaveEssencePath + kFacialExpressionMakerPath, kFacialExpressionMakerPackage); } + string GetSamplePath(string displayName, string version, string sampleFolder) + { + return Path.Combine("Assets", "Samples", piXrsdk.displayName, pi.version, sampleFolder); + } + + public bool IsXRSDKSamplesInstalled() + { + string xrsdkname; + if (piXrsdk == null) + xrsdkname = "VIVE Wave XR Plugin"; + else + xrsdkname = piXrsdk.displayName; + + string version; + if (piXrsdk == null) + version = pi.version; + else + version = piXrsdk.version; + + return Directory.Exists(GetSamplePath(xrsdkname, version, "XR")); + } + + public bool IsPureUnitySamplesInstalled() + { + string xrsdkname; + if (piXrsdk == null) + xrsdkname = "VIVE Wave XR Plugin"; + else + xrsdkname = piXrsdk.displayName; + + string version; + if (piXrsdk == null) + version = pi.version; + else + version = piXrsdk.version; + + return Directory.Exists(GetSamplePath(xrsdkname, version, "PureUnity")); + } + + private static void CopyDirectoryRecursively(string sourceDir, string targetDir) + { + // Create target directory if it doesn't exist + if (!Directory.Exists(targetDir)) + { + Directory.CreateDirectory(targetDir); + } + + // Copy each file into the new directory + foreach (string file in Directory.GetFiles(sourceDir)) + { + string targetFile = Path.Combine(targetDir, Path.GetFileName(file)); + File.Copy(file, targetFile, true); + } + + // Copy each subdirectory using recursion + foreach (string subdir in Directory.GetDirectories(sourceDir)) + { + string targetSubdir = Path.Combine(targetDir, Path.GetFileName(subdir)); + CopyDirectoryRecursively(subdir, targetSubdir); + } + } + + public void InstallSample(string path, string target, bool needRefresh = true) + { + Debug.Log($"Copy Assets from {path} to {target}"); + CopyDirectoryRecursively(path, target); + + if (needRefresh) + AssetDatabase.Refresh(); + } + + public bool InstallXRSDKSample(bool needRefresh) + { + if (piXrsdk == null) return false; + + var target = Path.Combine("Assets", "Samples", piXrsdk.displayName, piXrsdk.version); + if (!Directory.Exists(target)) + { + Directory.CreateDirectory(target); + } + var xrsdkSample = Path.Combine(piXrsdk.assetPath, "Samples~", "XR"); + + InstallSample(xrsdkSample, target, needRefresh); + return true; + } + + public bool InstallPureUnitySample(bool needRefresh) + { + if (piXrsdk == null) return false; + + var target = Path.Combine("Assets", "Samples", piXrsdk.displayName, piXrsdk.version); + if (!Directory.Exists(target)) + { + Directory.CreateDirectory(target); + } + var xrsdkSample = Path.Combine(piXrsdk.assetPath, "Samples~", "PureUnity"); + + InstallSample(xrsdkSample, target, needRefresh); + return true; + } + + public override void OnGUI(string searchContext) { bool hasKeyword = false; @@ -416,6 +575,7 @@ public override void OnGUI(string searchContext) bool showURPMaterials = searchContext.Contains("URPMaterials"); bool showSpectator = searchContext.Contains("Spectator"); bool showBodyTracking = searchContext.Contains("BodyTracking"); + bool showFacialExpressionMaker = searchContext.Contains("FacialExpressionMaker"); if (showControllerModel || showInputModule || @@ -431,7 +591,8 @@ public override void OnGUI(string searchContext) showTrackableMarker || showURPMaterials || showSpectator || - showBodyTracking) + showBodyTracking || + showFacialExpressionMaker) { hasKeyword = true; } @@ -453,6 +614,7 @@ public override void OnGUI(string searchContext) * 13. URP Materials * 14. Spectator * 15. Body Tracking + * 16. Facial Expression Maker **/ checkFeaturePackages(); @@ -576,6 +738,29 @@ public override void OnGUI(string searchContext) GUI.enabled = true; } GUILayout.EndVertical(); + + GUILayout.BeginVertical(EditorStyles.helpBox); + { + GUILayout.Label("Hand Interaction (Beta)", EditorStyles.boldLabel); + GUILayout.Label("Note: This feature is currenty in Beta.\n\n" + + "The Hand Interaction feature provides the near interaction of hand.", new GUIStyle(EditorStyles.label) { wordWrap = true }); + GUILayout.Label("The feature will be imported at " + WaveEssencePath + "/Hand/Interaction.", EditorStyles.label); + GUILayout.Space(5f); + GUI.enabled = !featureHandInteractionImported || featureHandInteractionlNeedUpdate; + if (featureHandInteractionlNeedUpdate) + { + if (GUILayout.Button("Update Feature - Hand Interaction", GUILayout.ExpandWidth(false))) + UpdateModule(WaveEssencePath + kHandInteractionPath, kHandInteractionPackage); + } + else + { + if (GUILayout.Button("Import Feature - Hand Interaction", GUILayout.ExpandWidth(false))) + ImportModule(kHandInteractionPackage); + } + GUILayout.Space(5f); + GUI.enabled = true; + } + GUILayout.EndVertical(); } if (!PackageInfo.IsImporting && @@ -781,6 +966,8 @@ public override void OnGUI(string searchContext) "The aspects of this feature that are currently supported are Scene Planes, Scene Mesh and Spatial Anchors.", new GUIStyle(EditorStyles.label) { wordWrap = true }); GUILayout.Label("The feature will be imported at " + WaveEssencePath + kScenePerceptionPath, EditorStyles.label); GUILayout.Space(5f); + bool isXRSDKSampleInstalled = IsXRSDKSamplesInstalled(); + bool isPUSampleInstalled = IsPureUnitySamplesInstalled(); GUI.enabled = !featureScenePerceptionImported || featureScenePerceptionNeedUpdate; if (featureScenePerceptionNeedUpdate) { @@ -792,8 +979,27 @@ public override void OnGUI(string searchContext) if (GUILayout.Button("Import Feature - Scene Perception", GUILayout.ExpandWidth(false))) ImportModule(kScenePerceptionPackage); } - GUILayout.Space(5f); - GUI.enabled = true; + GUI.enabled = true; + GUI.enabled = featureScenePerceptionImported && !featureScenePerceptionDemoImported; + string demoButtonStr = featureScenePerceptionImported ? "Import Demo - Scene Perception" : "Import Demo - import feature first"; + + if (GUILayout.Button(demoButtonStr, GUILayout.ExpandWidth(false))) + { + if ((!isXRSDKSampleInstalled || !isPUSampleInstalled) && + EditorUtility.DisplayDialog("Import Scene Perception Demo", + "Scene Perception Demo will need both Pure Unity and XRSDK samples of VIVE Wave XRSDK package imported. " + + "Do you want to install these samples now?", + "Yes", "Only install this Demo")) + { + if (!isPUSampleInstalled) + InstallPureUnitySample(false); + if (!isXRSDKSampleInstalled) + InstallXRSDKSample(false); + } + ImportModule(kScenePerceptionDemoPackage); + } + GUI.enabled = true; + GUILayout.Space(5f); } GUILayout.EndVertical(); } @@ -920,6 +1126,42 @@ public override void OnGUI(string searchContext) } GUILayout.EndVertical(); } + + if (showFacialExpressionMaker || !hasKeyword) + { + GUILayout.BeginVertical(EditorStyles.helpBox); + { + GUILayout.Label("Facial Expression Maker", EditorStyles.boldLabel); + GUILayout.Label( + "The Facial Expression Maker feature depends on Humanoid VRM plugin.\n" + + "You can import the Humanoid VRM package (VRM-0.109.0_7aff.unitypackage) at\n" + + "Library > PackageCache > com.htc.upm.wave.essence > UnityPackages~", + new GUIStyle(EditorStyles.label) { wordWrap = true }); + GUILayout.Label( + "Note: Must using Unity Editor 2020.3.40f1 or newer version.", + new GUIStyle(EditorStyles.label) { wordWrap = true }); + GUILayout.Label("This feature will be imported at " + WaveEssencePath + "/FacialExpression/Maker.\n" + + "Import the Facial Model package first before using this feature.", EditorStyles.label); + GUILayout.Space(5f); + GUI.enabled = (!featureFacialExpressionMakerImported || featureFacialExpressionMakerNeedUpdate); + if (featureFacialExpressionMakerNeedUpdate) + { + if (GUILayout.Button("Update Feature - Facial Expression Maker", GUILayout.ExpandWidth(false))) + UpdateModule(WaveEssencePath + kFacialExpressionMakerPath, kFacialExpressionMakerPackage); + } + else + { + if (GUILayout.Button("Import Feature - Facial Expression Maker", GUILayout.ExpandWidth(false))) + { + //ImportModule(kVrm1Package); + ImportModule(kFacialExpressionMakerPackage); + } + } + GUILayout.Space(5f); + GUI.enabled = true; + } + GUILayout.EndVertical(); + } } public static void DeleteFolder(string path) @@ -1203,6 +1445,13 @@ static List GetItems() GetCurrent = () => { return EssenceSettingsProvider.featureHandModelNeedUpdate.ToString(); }, }; + var HandInteracion = new Item("Hand Interaction") + { + IsShow = () => { return EssenceSettingsProvider.featureHandInteractionImported; }, + IsReady = () => { return !EssenceSettingsProvider.featureHandInteractionlNeedUpdate; }, + GetCurrent = () => { return EssenceSettingsProvider.featureHandInteractionlNeedUpdate.ToString(); }, + }; + var InteractionMode = new Item("Interaction Mode") { IsShow = () => { return EssenceSettingsProvider.featureInteractionModeImported; }, @@ -1280,11 +1529,19 @@ static List GetItems() GetCurrent = () => { return EssenceSettingsProvider.featureBodyTrackingNeedUpdate.ToString(); }, }; + var FacialExpressionMaker = new Item("Facial Expression Maker") + { + IsShow = () => { return EssenceSettingsProvider.featureFacialExpressionMakerImported; }, + IsReady = () => { return !EssenceSettingsProvider.featureFacialExpressionMakerNeedUpdate; }, + GetCurrent = () => { return EssenceSettingsProvider.featureFacialExpressionMakerNeedUpdate.ToString(); }, + }; + return new List() { ControllerModel, InputModule, HandModel, + HandInteracion, InteractionMode, CameraTexture, CompositorLayer, @@ -1296,6 +1553,7 @@ static List GetItems() URPMaterials, Spectator, BodyTracking, + FacialExpressionMaker, }; } diff --git a/com.htc.upm.wave.essence/Editor/PackageEssenceAsset.cs b/com.htc.upm.wave.essence/Editor/PackageEssenceAsset.cs index 29d778ee..ca4ec505 100644 --- a/com.htc.upm.wave.essence/Editor/PackageEssenceAsset.cs +++ b/com.htc.upm.wave.essence/Editor/PackageEssenceAsset.cs @@ -13,6 +13,7 @@ public class PackageEssenceAsset : ScriptableObject public bool importedInteractionModePackage = false; public bool importedTrackerModelPackage = false; public bool importedBodyTrackingPackage = false; + public bool importedFacialExpressionMakerPackage = false; } } #endif diff --git a/com.htc.upm.wave.essence/Runtime/Editor/Tracker/TrackerManagerEditor.cs b/com.htc.upm.wave.essence/Runtime/Editor/Tracker/TrackerManagerEditor.cs index 647a5dc0..922005c3 100644 --- a/com.htc.upm.wave.essence/Runtime/Editor/Tracker/TrackerManagerEditor.cs +++ b/com.htc.upm.wave.essence/Runtime/Editor/Tracker/TrackerManagerEditor.cs @@ -35,10 +35,19 @@ public static void AddTrackerManager() } SerializedProperty m_InitialStartTracker/*, m_UseXRDevice*/; + SerializedProperty m_OnSwipeToRight; + SerializedProperty m_OnSwipeToLeft; + SerializedProperty m_OnSwipeToUp; + SerializedProperty m_OnSwipeToDown; + bool swipeEvent = false; private void OnEnable() { //m_UseXRDevice = serializedObject.FindProperty("m_UseXRDevice"); m_InitialStartTracker = serializedObject.FindProperty("m_InitialStartTracker"); + m_OnSwipeToRight = serializedObject.FindProperty("m_OnSwipeToRight"); + m_OnSwipeToLeft = serializedObject.FindProperty("m_OnSwipeToLeft"); + m_OnSwipeToUp = serializedObject.FindProperty("m_OnSwipeToUp"); + m_OnSwipeToDown = serializedObject.FindProperty("m_OnSwipeToDown"); } public override void OnInspectorGUI() @@ -52,6 +61,20 @@ public override void OnInspectorGUI() MessageType.Info); EditorGUILayout.PropertyField(m_InitialStartTracker); + swipeEvent = EditorGUILayout.Foldout(swipeEvent, "Swipe Event"); + if (swipeEvent) + { + GUILayout.Space(5); + EditorGUILayout.HelpBox( + "When received value 0, it means TrackId 0.", + MessageType.Info); + GUILayout.Space(5); + EditorGUILayout.PropertyField(m_OnSwipeToRight); + EditorGUILayout.PropertyField(m_OnSwipeToLeft); + EditorGUILayout.PropertyField(m_OnSwipeToUp); + EditorGUILayout.PropertyField(m_OnSwipeToDown); + } + /*GUILayout.Space(5); EditorGUILayout.HelpBox( "Retrieve the Tracker data from UnityEngine.XR.InputDevice.", diff --git a/com.htc.upm.wave.essence/Runtime/Scripts/Definitions.cs b/com.htc.upm.wave.essence/Runtime/Scripts/Definitions.cs index c365d09b..23934b98 100644 --- a/com.htc.upm.wave.essence/Runtime/Scripts/Definitions.cs +++ b/com.htc.upm.wave.essence/Runtime/Scripts/Definitions.cs @@ -45,10 +45,16 @@ public class XR_Feature public static readonly InputFeatureUsage secondaryTouch = CommonUsages.secondaryTouch; // A binary value representing the Grip press state. public static readonly InputFeatureUsage gripButton = CommonUsages.gripButton; + // A binary value representing the Grip touch state. + public static readonly InputFeatureUsage gripTouch = new InputFeatureUsage("GripTouch"); // A binary value representing the Trigger press state. public static readonly InputFeatureUsage triggerButton = CommonUsages.triggerButton; + // A binary value representing the Trigger touch state. + public static readonly InputFeatureUsage triggerTouch = new InputFeatureUsage("TriggerTouch"); // A binary value representing the Menu press state. public static readonly InputFeatureUsage menuButton = CommonUsages.menuButton; + // A binary value representing the Menu touch state. + public static readonly InputFeatureUsage menuTouch = new InputFeatureUsage("MenuTouch"); // A binary value representing the Touchpad or Thumbstick press state. public static readonly InputFeatureUsage primary2DAxisClick = CommonUsages.primary2DAxisClick; // A binary value representing the Touchpad or Thumbstick touch state. @@ -58,7 +64,6 @@ public class XR_Feature // A binary value representing the Thumbstick touch state. public static readonly InputFeatureUsage secondary2DAxisTouch = CommonUsages.secondary2DAxisTouch; - public static readonly InputFeatureUsage triggerTouch = new InputFeatureUsage("TriggerTouch"); // A float value representing the Trigger axis. public static readonly InputFeatureUsage trigger = CommonUsages.trigger; // A float value representing the Grip axis. diff --git a/com.htc.upm.wave.essence/Runtime/Scripts/DynamicResolution.cs b/com.htc.upm.wave.essence/Runtime/Scripts/DynamicResolution.cs index 7d5ea7e9..5c1c44b9 100644 --- a/com.htc.upm.wave.essence/Runtime/Scripts/DynamicResolution.cs +++ b/com.htc.upm.wave.essence/Runtime/Scripts/DynamicResolution.cs @@ -8,436 +8,468 @@ // conditions signed by you and all SDK and API requirements, // specifications, and documentation provided by HTC to You." +using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.XR; using Wave.XR.Settings; using Wave.Native; using Wave.Essence.Events; +using System; +using System.Linq; namespace Wave.Essence.Render { - using System; - using System.Linq; #if UNITY_EDITOR - using UnityEditor; - - [CustomEditor(typeof(DynamicResolution))] - public class DynamicResolutionEditor : Editor - { - public override void OnInspectorGUI() - { - serializedObject.Update(); - DynamicResolution myScript = target as DynamicResolution; - - WaveXRSettings waveXRSettings = WaveXRSettings.GetInstance(); - if (waveXRSettings != null) - { - if (waveXRSettings.adaptiveQualityMode == WaveXRSettings.AdaptiveQualityMode.CustomizationMode) - { - EditorGUILayout.PropertyField(serializedObject.FindProperty("overrideXRSettings")); - serializedObject.ApplyModifiedProperties(); - if (myScript.overrideXRSettings) - { - EditorGUILayout.HelpBox("Dynamic Resolution is feature to help adjust the Resolution Scale of the application according to usage of system resources. " + - "\nIt also helps determining a lower bound for the Resolution Scale to maintain text readability at certain text size.", MessageType.None); - EditorGUILayout.HelpBox("Specify the smallest size of text that you will use in your application. " + - "This parameter will be used while determining the lower bound for maintaining text readability.", MessageType.Info); - EditorGUILayout.PropertyField(serializedObject.FindProperty("textSize")); - serializedObject.ApplyModifiedProperties(); - - EditorGUILayout.HelpBox("You can define a set of Resolution Scale values which will be applied according to the events triggered by AdaptiveQuality, " + - "adjust the default Resolution Scale by changing the deafult index value.", MessageType.Info); - EditorGUILayout.PropertyField(serializedObject.FindProperty("resolutionScaleList"), true); - serializedObject.ApplyModifiedProperties(); - EditorGUILayout.PropertyField(serializedObject.FindProperty("defaultIndex")); - serializedObject.ApplyModifiedProperties(); - } - } - else if (waveXRSettings.adaptiveQualityMode == WaveXRSettings.AdaptiveQualityMode.Disabled) - { - EditorGUILayout.HelpBox("Adaptive Quality is disabled.\nTo use Dynamic Resolution, enable Adaptive Quality in WaveXRSettings.", MessageType.Warning); - } - else - { - EditorGUILayout.HelpBox("Adaptive Quality Mode is set to Quality/Performance Oriented Mode." + - "\nDynamic Resolution is currently controlled by the mode preset." + - "\nTo set scene specific settings, choose Customization Mode.", MessageType.Info); - } - } - } - } + using UnityEditor; + + [CustomEditor(typeof(DynamicResolution))] + public class DynamicResolutionEditor : Editor + { + public override void OnInspectorGUI() + { + serializedObject.Update(); + DynamicResolution myScript = target as DynamicResolution; + + WaveXRSettings waveXRSettings = WaveXRSettings.GetInstance(); + if (waveXRSettings != null) + { + if (waveXRSettings.adaptiveQualityMode == WaveXRSettings.AdaptiveQualityMode.CustomizationMode) + { + EditorGUILayout.PropertyField(serializedObject.FindProperty("overrideXRSettings")); + serializedObject.ApplyModifiedProperties(); + if (myScript.overrideXRSettings) + { + EditorGUILayout.HelpBox("Dynamic Resolution is feature to help adjust the Resolution Scale of the application according to usage of system resources. " + + "\nIt also helps determining a lower bound for the Resolution Scale to maintain text readability at certain text size.", MessageType.None); + EditorGUILayout.HelpBox("Specify the smallest size of text that you will use in your application. " + + "This parameter will be used while determining the lower bound for maintaining text readability.", MessageType.Info); + EditorGUILayout.PropertyField(serializedObject.FindProperty("textSize")); + serializedObject.ApplyModifiedProperties(); + + EditorGUILayout.HelpBox("You can define a set of Resolution Scale values which will be applied according to the events triggered by AdaptiveQuality, " + + "adjust the default Resolution Scale by changing the deafult index value.", MessageType.Info); + EditorGUILayout.PropertyField(serializedObject.FindProperty("resolutionScaleList"), true); + serializedObject.ApplyModifiedProperties(); + EditorGUILayout.PropertyField(serializedObject.FindProperty("defaultIndex")); + serializedObject.ApplyModifiedProperties(); + } + } + else if (waveXRSettings.adaptiveQualityMode == WaveXRSettings.AdaptiveQualityMode.Disabled) + { + EditorGUILayout.HelpBox("Adaptive Quality is disabled.\nTo use Dynamic Resolution, enable Adaptive Quality in WaveXRSettings.", MessageType.Warning); + } + else + { + EditorGUILayout.HelpBox("Adaptive Quality Mode is set to Quality/Performance Oriented Mode." + + "\nDynamic Resolution is currently controlled by the mode preset." + + "\nTo set scene specific settings, choose Customization Mode.", MessageType.Info); + } + } + } + } #endif - // The DynamicResolution will be triggered by AdaptiveQuality. If AdaptiveQuality is not enabled, this feature will not work. - [DisallowMultipleComponent] - public class DynamicResolution : MonoBehaviour - { - [SerializeField] - public bool overrideXRSettings = false; - - [Tooltip("The ResolutionScale help set a scaled resolution to be lower than the default. An index will go higher or lower according to the AdaptiveQuality's event. You can choose one of resolution scale from this list as a default resolution scale by setting the default index.")] - [SerializeField] - private List resolutionScaleList = new List(); - - [Tooltip("You can choose one of resolution scale from this list as a default resolution scale by setting the default index.")] - [SerializeField] - private int defaultIndex = 0; - private int index = 0; - - [Tooltip("The unit used for measuring text size here is dmm (Distance-Independent Millimeter). The method of conversion from Unity text size into dmm can be found in the documentation of the SDK.")] - [SerializeField] - [Range(20, 40)] - private int textSize = 20; - - public float CurrentScale { get { return resolutionScaleList[index]; } } - private float currentUpperBound = 1f; - private float currentLowerBound = 0.1f; - private bool isInitialized = false; - private WaveXRSettings.AdaptiveQualityMode currentAdaptiveQualityMode; - private const string LOG_TAG = "WaveEssenceDynRes"; - - private const float qualityOrientedModeLowerBound = 1f; - private const float performanceOrientedModeUpperBound = 1f; - - public static DynamicResolution instance; - - public enum AQEvent - { - None, - ManualHigher, - ManualLower, - Higher, - Lower, - }; - - public AQEvent CurrentAQEvent { get; private set; } - - private void Awake() - { - if (instance == null) - { - Log.d(LOG_TAG, "New DR Instance"); - instance = this; - } - else - { - if (instance != this) //Another instance of DR exists - { - Log.d(LOG_TAG, "Found another DR Instance"); - if (!overrideXRSettings) //Current instance uses global settings - { - Log.d(LOG_TAG, "Destroy this DR Instance"); - Destroy(this); - } - else //Current instance overrides global settings (higher priority) - { - Log.d(LOG_TAG, "Destroy other DR Instance and replace it"); - Destroy(instance); - instance = this; - } - } - } - } - - void OnEnable() - { - WaveXRSettings waveXRSettings = WaveXRSettings.GetInstance(); - currentAdaptiveQualityMode = waveXRSettings.adaptiveQualityMode; - - Log.d(LOG_TAG, "currentAdaptiveQualityMode: " + currentAdaptiveQualityMode.ToString()); - if (currentAdaptiveQualityMode == WaveXRSettings.AdaptiveQualityMode.Disabled) - { - Log.e(LOG_TAG, "Destroying component as Dynamic Resolution is not enabled in WaveXRSettings."); - instance = null; - Destroy(this); - return; - } - - bool useGlobalSettings = currentAdaptiveQualityMode == WaveXRSettings.AdaptiveQualityMode.QualityOrientedMode || - currentAdaptiveQualityMode == WaveXRSettings.AdaptiveQualityMode.PerformanceOrientedMode || - (currentAdaptiveQualityMode == WaveXRSettings.AdaptiveQualityMode.CustomizationMode && !overrideXRSettings); - - if (useGlobalSettings) - { - defaultIndex = waveXRSettings.DR_DefaultIndex; - textSize = waveXRSettings.DR_TextSize; - resolutionScaleList = waveXRSettings.DR_ResolutionScaleList; - } - - if (resolutionScaleList.Count < 2) - { - Log.e(LOG_TAG, "Resolution Scale List contains less than 2 elements, Resolution Scale will not changed"); - return; - } - - SystemEvent.Listen(HigherHandler); // Listen to all event - SystemEvent.Listen(WVR_EventType.WVR_EventType_RecommendedQuality_Lower, LowerHandler); - index = defaultIndex; - CurrentAQEvent = AQEvent.None; - - FormatResolutionScaleList(); - - DefineUpperBound(); - DefineLowerBound(); - - SetListUpperBound(); - SetListLowerBound(); - - isInitialized = true; - Log.d(LOG_TAG, "Finalilzed Resolution Scale List: " + string.Join(",", resolutionScaleList.ToArray())); - } - - void OnDisable() - { - SystemEvent.Remove(HigherHandler); - SystemEvent.Remove(WVR_EventType.WVR_EventType_RecommendedQuality_Lower, LowerHandler); - index = defaultIndex; - - SetResolutionScale(1); - } - - private void SetResolutionScale(float rs) - { - XRSettings.eyeTextureResolutionScale = rs; - } - - // Let the function can be access by script. - public void Higher() - { - WVR_Event_t e = new WVR_Event_t(); - e.common.type = WVR_EventType.WVR_EventType_RecommendedQuality_Higher; - HigherHandler(e); - CurrentAQEvent = AQEvent.ManualHigher; - } - - private void HigherHandler(WVR_Event_t systemEvent) - { - if (!isInitialized) return; - if (systemEvent.common.type != WVR_EventType.WVR_EventType_RecommendedQuality_Higher) - return; - - if (--index < 0) - index = 0; - - SetResolutionScale(resolutionScaleList[index]); - CurrentAQEvent = AQEvent.Higher; - Log.d(LOG_TAG, "Event Higher: [" + index + "]=" + resolutionScaleList[index]); - } - - // Let the function can be access by script. - public void Lower() - { - WVR_Event_t e = new WVR_Event_t(); - LowerHandler(e); - CurrentAQEvent = AQEvent.ManualLower; - } - - private void LowerHandler(WVR_Event_t systemEvent) - { - if (!isInitialized) return; - - if (++index >= resolutionScaleList.Count) - index = resolutionScaleList.Count - 1; - - SetResolutionScale(resolutionScaleList[index]); - CurrentAQEvent = AQEvent.Lower; - Log.d(LOG_TAG, "Event Lower: [" + index + "]=" + resolutionScaleList[index]); - } - - // Set the scale back to default. - public void ResetResolutionScale() - { - CurrentAQEvent = AQEvent.None; - - if (!enabled) - return; - index = defaultIndex; - SetResolutionScale(resolutionScaleList[index]); - Log.d(LOG_TAG, "Event Reset: [" + index + "]=" + resolutionScaleList[index]); - } - - private void SetListUpperBound() - { - //Remove values that are higher than the defined upper bound - while (resolutionScaleList.Count > 0 && resolutionScaleList[0] > currentUpperBound) - { - resolutionScaleList.RemoveAt(0); - } - resolutionScaleList.Insert(0, currentUpperBound); - - //Sort and reset index - FormatResolutionScaleList(); - if (index > resolutionScaleList.Count - 1) - { - index = defaultIndex = resolutionScaleList.Count - 1; - } - - SetResolutionScale(resolutionScaleList[index]); - } - - private void SetListLowerBound() - { - //Remove values that are lower than the defined lower bound - int counter = Math.Max(0, resolutionScaleList.Count - 1); - while (counter > -1 && resolutionScaleList[counter] < currentLowerBound) - { - resolutionScaleList.RemoveAt(counter); - counter--; - } - resolutionScaleList.Add(currentLowerBound); - - //Sort and reset index - FormatResolutionScaleList(); - counter = Math.Max(0, counter); - if (index > counter) - { - index = defaultIndex = counter; - } - - SetResolutionScale(resolutionScaleList[index]); - } - - private float GetResScaleFromDMM() - { + // The DynamicResolution will be triggered by AdaptiveQuality. If AdaptiveQuality is not enabled, this feature will not work. + [DisallowMultipleComponent] + public class DynamicResolution : MonoBehaviour + { + [SerializeField] + public bool overrideXRSettings = false; + + [Tooltip("The ResolutionScale help set a scaled resolution to be lower than the default. An index will go higher or lower according to the AdaptiveQuality's event. You can choose one of resolution scale from this list as a default resolution scale by setting the default index.")] + [SerializeField] + private List resolutionScaleList = new List(); + + [Tooltip("You can choose one of resolution scale from this list as a default resolution scale by setting the default index.")] + [SerializeField] + private int defaultIndex = 0; + private int index = 0; + + [Tooltip("The unit used for measuring text size here is dmm (Distance-Independent Millimeter). The method of conversion from Unity text size into dmm can be found in the documentation of the SDK.")] + [SerializeField] + [Range(20, 40)] + private int textSize = 20; + + public float CurrentScale { get { return resolutionScaleList[index]; } } + private float currentUpperBound = 1f; + private float currentLowerBound = 0.1f; + private bool isInitialized = false; + private bool isInitRunning = false; + private WaveXRSettings.AdaptiveQualityMode currentAdaptiveQualityMode; + private const string LOG_TAG = "WaveEssenceDynRes"; + + private const float qualityOrientedModeLowerBound = 1f; + private const float performanceOrientedModeUpperBound = 1f; + + public static DynamicResolution instance; + + public enum AQEvent + { + None, + ManualHigher, + ManualLower, + Higher, + Lower, + }; + + public AQEvent CurrentAQEvent { get; private set; } + + private void Awake() + { + if (instance == null) + { + Log.d(LOG_TAG, "New DR Instance"); + instance = this; + } + else + { + if (instance != this) //Another instance of DR exists + { + Log.d(LOG_TAG, "Found another DR Instance"); + if (!overrideXRSettings) //Current instance uses global settings + { + Log.d(LOG_TAG, "Destroy this DR Instance"); + Destroy(this); + } + else //Current instance overrides global settings (higher priority) + { + Log.d(LOG_TAG, "Destroy other DR Instance and replace it"); + Destroy(instance); + instance = this; + } + } + } + } + + // An issue is eyeTextureWidth and Height are 0 when the application is launched. + // To avoid this issue, we need to wait until eyeTextureWidth and Height are set. + IEnumerator Init() + { + Log.d(LOG_TAG, "Init", true); + if (isInitialized || isInitRunning) yield break; + + isInitRunning = true; + + if (XRSettings.eyeTextureWidth <= 0 || XRSettings.eyeTextureHeight <= 0) + { + Log.d(LOG_TAG, "Waiting for XRSettings.eyeTextureWidth and XRSettings.eyeTextureHeight to be set", true); + yield return new WaitUntil(() => XRSettings.eyeTextureWidth > 0 && XRSettings.eyeTextureHeight > 0); + } + + FormatResolutionScaleList(); + + DefineUpperBound(); + DefineLowerBound(); + + SetListUpperBound(); + SetListLowerBound(); + + Log.d(LOG_TAG, "Finalized Resolution Scale List: " + string.Join(",", resolutionScaleList.ToArray()), true); + + isInitialized = true; + isInitRunning = false; + } + + + void OnEnable() + { + WaveXRSettings waveXRSettings = WaveXRSettings.GetInstance(); + currentAdaptiveQualityMode = waveXRSettings.adaptiveQualityMode; + + Log.d(LOG_TAG, "currentAdaptiveQualityMode: " + currentAdaptiveQualityMode.ToString()); + if (currentAdaptiveQualityMode == WaveXRSettings.AdaptiveQualityMode.Disabled) + { + Log.e(LOG_TAG, "Destroying component as Dynamic Resolution is not enabled in WaveXRSettings."); + instance = null; + Destroy(this); + return; + } + + bool useGlobalSettings = currentAdaptiveQualityMode == WaveXRSettings.AdaptiveQualityMode.QualityOrientedMode || + currentAdaptiveQualityMode == WaveXRSettings.AdaptiveQualityMode.PerformanceOrientedMode || + (currentAdaptiveQualityMode == WaveXRSettings.AdaptiveQualityMode.CustomizationMode && !overrideXRSettings); + + if (useGlobalSettings) + { + defaultIndex = waveXRSettings.DR_DefaultIndex; + textSize = waveXRSettings.DR_TextSize; + resolutionScaleList = waveXRSettings.DR_ResolutionScaleList; + } + + if (resolutionScaleList.Count < 2) + { + Log.e(LOG_TAG, "Resolution Scale List contains less than 2 elements, Resolution Scale will not changed"); + return; + } + + SystemEvent.Listen(HigherHandler); // Listen to all event + SystemEvent.Listen(WVR_EventType.WVR_EventType_RecommendedQuality_Lower, LowerHandler); + index = defaultIndex; + CurrentAQEvent = AQEvent.None; + + StartCoroutine("Init"); + } + + void OnDisable() + { + isInitialized = false; + if (isInitRunning) + { + StopCoroutine("Init"); + isInitRunning = false; + } + SystemEvent.Remove(HigherHandler); + SystemEvent.Remove(WVR_EventType.WVR_EventType_RecommendedQuality_Lower, LowerHandler); + index = defaultIndex; + + SetResolutionScale(1); + } + + private void SetResolutionScale(float rs) + { + // Set hard limit to avoid Unity problem. + rs = Mathf.Clamp(rs, 0.005f, 4); + Log.d(LOG_TAG, $"SetResolutionScale({rs})"); + XRSettings.eyeTextureResolutionScale = rs; + } + + // Let the function can be access by script. + public void Higher() + { + WVR_Event_t e = new WVR_Event_t(); + e.common.type = WVR_EventType.WVR_EventType_RecommendedQuality_Higher; + HigherHandler(e); + CurrentAQEvent = AQEvent.ManualHigher; + } + + private void HigherHandler(WVR_Event_t systemEvent) + { + if (!isInitialized) return; + if (systemEvent.common.type != WVR_EventType.WVR_EventType_RecommendedQuality_Higher) + return; + + if (--index < 0) + index = 0; + + SetResolutionScale(resolutionScaleList[index]); + CurrentAQEvent = AQEvent.Higher; + Log.d(LOG_TAG, "Event Higher: [" + index + "]=" + resolutionScaleList[index]); + } + + // Let the function can be access by script. + public void Lower() + { + WVR_Event_t e = new WVR_Event_t(); + LowerHandler(e); + CurrentAQEvent = AQEvent.ManualLower; + } + + private void LowerHandler(WVR_Event_t systemEvent) + { + if (!isInitialized) return; + + if (++index >= resolutionScaleList.Count) + index = resolutionScaleList.Count - 1; + + SetResolutionScale(resolutionScaleList[index]); + CurrentAQEvent = AQEvent.Lower; + Log.d(LOG_TAG, "Event Lower: [" + index + "]=" + resolutionScaleList[index]); + } + + // Set the scale back to default. + public void ResetResolutionScale() + { + CurrentAQEvent = AQEvent.None; + + if (!enabled) + return; + index = defaultIndex; + SetResolutionScale(resolutionScaleList[index]); + Log.d(LOG_TAG, "Event Reset: [" + index + "]=" + resolutionScaleList[index]); + } + + private void SetListUpperBound() + { + //Remove values that are higher than the defined upper bound + while (resolutionScaleList.Count > 0 && resolutionScaleList[0] > currentUpperBound) + { + resolutionScaleList.RemoveAt(0); + } + resolutionScaleList.Insert(0, currentUpperBound); + + //Sort and reset index + FormatResolutionScaleList(); + if (index > resolutionScaleList.Count - 1) + { + index = defaultIndex = resolutionScaleList.Count - 1; + } + + SetResolutionScale(resolutionScaleList[index]); + } + + private void SetListLowerBound() + { + //Remove values that are lower than the defined lower bound + int counter = Math.Max(0, resolutionScaleList.Count - 1); + while (counter > -1 && resolutionScaleList[counter] < currentLowerBound) + { + resolutionScaleList.RemoveAt(counter); + counter--; + } + resolutionScaleList.Add(currentLowerBound); + + //Sort and reset index + FormatResolutionScaleList(); + counter = Math.Max(0, counter); + if (index > counter) + { + index = defaultIndex = counter; + } + + SetResolutionScale(resolutionScaleList[index]); + } + + private float GetResScaleFromDMM() + { #if UNITY_EDITOR - return 0.1f; + return 0.1f; #endif - float P60D = 178.15f * (textSize * textSize) - 14419f * textSize + 356704f; - - Log.d(LOG_TAG, "Get P60D from DMM: " + P60D); - float halfWidth = XRSettings.eyeTextureWidth / 2; - float halfHeight = XRSettings.eyeTextureHeight / 2; - float[] projection = GetProjection(); - - float tan30 = Mathf.Tan(Mathf.Deg2Rad * 30f); - - float resolutionScale = Mathf.Sqrt(P60D / (Mathf.Pow(tan30, 2) * halfHeight * halfWidth * (1 / Mathf.Abs(projection[0]) + 1 / Mathf.Abs(projection[1])) * (1 / Mathf.Abs(projection[2]) + 1 / Mathf.Abs(projection[3])))); - - Log.d(LOG_TAG, "Eye Buffer Width: " + halfWidth + " Eye Buffer Height: " + halfHeight); - //Log.d(LOG_TAG, "Projection: " + string.Join(", ", projection.Select(p => p.ToString()).ToArray())); - Log.d(LOG_TAG, "Get Resolution Scale from P60D: " + resolutionScale); - - return resolutionScale; - } - - private void DefineUpperBound() - { - switch (currentAdaptiveQualityMode) - { - case WaveXRSettings.AdaptiveQualityMode.QualityOrientedMode: - case WaveXRSettings.AdaptiveQualityMode.CustomizationMode: - currentUpperBound = Mathf.Min(Interop.WVR_GetResolutionMaxScale(), resolutionScaleList[0]); - break; - case WaveXRSettings.AdaptiveQualityMode.PerformanceOrientedMode: - currentUpperBound = Mathf.Min(performanceOrientedModeUpperBound, resolutionScaleList[0]); - break; - case WaveXRSettings.AdaptiveQualityMode.Disabled: - default: - break; - } - } - - private void DefineLowerBound() - { - switch (currentAdaptiveQualityMode) - { - case WaveXRSettings.AdaptiveQualityMode.QualityOrientedMode: - currentLowerBound = Mathf.Max(qualityOrientedModeLowerBound, resolutionScaleList[resolutionScaleList.Count - 1]); - break; - case WaveXRSettings.AdaptiveQualityMode.CustomizationMode: - case WaveXRSettings.AdaptiveQualityMode.PerformanceOrientedMode: - currentLowerBound = Mathf.Max(GetResScaleFromDMM(), resolutionScaleList[resolutionScaleList.Count - 1]); - break; - case WaveXRSettings.AdaptiveQualityMode.Disabled: - default: - break; - } - } - - private void FormatResolutionScaleList() - { - //Sort List - FloatComparer floatComparer = new FloatComparer(); - resolutionScaleList.Sort(floatComparer); - //Remove duplicate values - resolutionScaleList = resolutionScaleList.Distinct().ToList(); - } - - private float[] GetProjection() - { - try - { - var displays = new List(); - SubsystemManager.GetInstances(displays); - - float[] projLRaw = new float[4]; - if (displays.Count <= 0 || displays[0].GetRenderPassCount() <= 0 || Camera.main == null) - { - Log.d(LOG_TAG, "Using WVR_GetClippingPlaneBoundary for projection"); - Interop.WVR_GetClippingPlaneBoundary(WVR_Eye.WVR_Eye_Left, ref projLRaw[0], ref projLRaw[1], ref projLRaw[2], ref projLRaw[3]); - } - else - { - //Get first render parameter from display 0 (VR display) - //Single pass: 1 pass with 2 render parameters - //Multi pass: 2 pass with 1 render parameter each - //First render parameter for both Stereo Rendering Paths - - displays[0].GetRenderPass(0, out XRDisplaySubsystem.XRRenderPass renderPasses); - renderPasses.GetRenderParameter(Camera.main, 0, out XRDisplaySubsystem.XRRenderParameter renderParametersL); - - Matrix4x4 projL = renderParametersL.projection; - Matrix4x4 inverseProjL = projL.inverse; - - projLRaw[0] = (Coordinate.MatrixMulVector(inverseProjL, new Vector4(-1, 0, 1, 1)).x); - projLRaw[1] = (Coordinate.MatrixMulVector(inverseProjL, new Vector4(1, 0, 1, 1)).x); - projLRaw[2] = (Coordinate.MatrixMulVector(inverseProjL, new Vector4(0, 1, 1, 1)).y); - projLRaw[3] = (Coordinate.MatrixMulVector(inverseProjL, new Vector4(0, -1, 1, 1)).y); - } - Log.d(LOG_TAG, "projLRaw: " + string.Join(" ", projLRaw)); - return projLRaw; - } - catch (Exception e) - { - Debug.LogException(e); - return new float[4] { 0, 0, 0, 0 }; - } - } - - void OnValidate() - { - ResetResolutionScaleListToValidState(); - } - - private void ResetResolutionScaleListToValidState() - { - if (resolutionScaleList.Count < 2) - { - resolutionScaleList.Add(0.1f); - resolutionScaleList.Add(1); - } - - defaultIndex = Mathf.Clamp(defaultIndex, 0, resolutionScaleList.Count - 1); - } - - public float GetCurrentUpperBound() - { - return currentUpperBound; - } - - public float GetCurrentLowerBound() - { - return currentLowerBound; - } - } - - class FloatComparer : IComparer - { - public int Compare(float x, float y) - { - return y.CompareTo(x); - } - } + float P60D = 178.15f * (textSize * textSize) - 14419f * textSize + 356704f; + + Log.d(LOG_TAG, "Get P60D from DMM: " + P60D); + float halfWidth = XRSettings.eyeTextureWidth / 2; + float halfHeight = XRSettings.eyeTextureHeight / 2; + float[] projection = GetProjection(); + + float tan30 = Mathf.Tan(Mathf.Deg2Rad * 30f); + + float resolutionScale = Mathf.Sqrt(P60D / (Mathf.Pow(tan30, 2) * halfHeight * halfWidth * (1 / Mathf.Abs(projection[0]) + 1 / Mathf.Abs(projection[1])) * (1 / Mathf.Abs(projection[2]) + 1 / Mathf.Abs(projection[3])))); + + Log.d(LOG_TAG, "Eye Buffer Width: " + halfWidth * 2 + " Eye Buffer Height: " + halfHeight * 2); + //Log.d(LOG_TAG, "Projection: " + string.Join(", ", projection.Select(p => p.ToString()).ToArray())); + Log.d(LOG_TAG, "Get Resolution Scale from P60D: " + resolutionScale); + + return resolutionScale; + } + + private void DefineUpperBound() + { + switch (currentAdaptiveQualityMode) + { + case WaveXRSettings.AdaptiveQualityMode.QualityOrientedMode: + case WaveXRSettings.AdaptiveQualityMode.CustomizationMode: + currentUpperBound = Mathf.Min(Interop.WVR_GetResolutionMaxScale(), resolutionScaleList[0]); + break; + case WaveXRSettings.AdaptiveQualityMode.PerformanceOrientedMode: + currentUpperBound = Mathf.Min(performanceOrientedModeUpperBound, resolutionScaleList[0]); + break; + case WaveXRSettings.AdaptiveQualityMode.Disabled: + default: + break; + } + } + + private void DefineLowerBound() + { + switch (currentAdaptiveQualityMode) + { + case WaveXRSettings.AdaptiveQualityMode.QualityOrientedMode: + currentLowerBound = Mathf.Max(qualityOrientedModeLowerBound, resolutionScaleList[resolutionScaleList.Count - 1]); + break; + case WaveXRSettings.AdaptiveQualityMode.CustomizationMode: + case WaveXRSettings.AdaptiveQualityMode.PerformanceOrientedMode: + currentLowerBound = Mathf.Max(GetResScaleFromDMM(), resolutionScaleList[resolutionScaleList.Count - 1]); + break; + case WaveXRSettings.AdaptiveQualityMode.Disabled: + default: + break; + } + } + + private void FormatResolutionScaleList() + { + //Sort List + FloatComparer floatComparer = new FloatComparer(); + resolutionScaleList.Sort(floatComparer); + //Remove duplicate values + resolutionScaleList = resolutionScaleList.Distinct().ToList(); + } + + private float[] GetProjection() + { + try + { + var displays = new List(); + SubsystemManager.GetInstances(displays); + + float[] projLRaw = new float[4]; + if (displays.Count <= 0 || displays[0].GetRenderPassCount() <= 0 || Camera.main == null) + { + Log.d(LOG_TAG, "Using WVR_GetClippingPlaneBoundary for projection"); + Interop.WVR_GetClippingPlaneBoundary(WVR_Eye.WVR_Eye_Left, ref projLRaw[0], ref projLRaw[1], ref projLRaw[2], ref projLRaw[3]); + } + else + { + //Get first render parameter from display 0 (VR display) + //Single pass: 1 pass with 2 render parameters + //Multi pass: 2 pass with 1 render parameter each + //First render parameter for both Stereo Rendering Paths + + displays[0].GetRenderPass(0, out XRDisplaySubsystem.XRRenderPass renderPasses); + renderPasses.GetRenderParameter(Camera.main, 0, out XRDisplaySubsystem.XRRenderParameter renderParametersL); + + Matrix4x4 projL = renderParametersL.projection; + Matrix4x4 inverseProjL = projL.inverse; + + projLRaw[0] = (Coordinate.MatrixMulVector(inverseProjL, new Vector4(-1, 0, 1, 1)).x); + projLRaw[1] = (Coordinate.MatrixMulVector(inverseProjL, new Vector4(1, 0, 1, 1)).x); + projLRaw[2] = (Coordinate.MatrixMulVector(inverseProjL, new Vector4(0, 1, 1, 1)).y); + projLRaw[3] = (Coordinate.MatrixMulVector(inverseProjL, new Vector4(0, -1, 1, 1)).y); + } + Log.d(LOG_TAG, "projLRaw: " + string.Join(" ", projLRaw)); + return projLRaw; + } + catch (Exception e) + { + Debug.LogException(e); + return new float[4] { 0, 0, 0, 0 }; + } + } + + void OnValidate() + { + ResetResolutionScaleListToValidState(); + } + + private void ResetResolutionScaleListToValidState() + { + if (resolutionScaleList.Count < 2) + { + resolutionScaleList.Add(0.1f); + resolutionScaleList.Add(1); + } + + defaultIndex = Mathf.Clamp(defaultIndex, 0, resolutionScaleList.Count - 1); + } + + public float GetCurrentUpperBound() + { + return currentUpperBound; + } + + public float GetCurrentLowerBound() + { + return currentLowerBound; + } + } + + class FloatComparer : IComparer + { + public int Compare(float x, float y) + { + return y.CompareTo(x); + } + } } diff --git a/com.htc.upm.wave.essence/Runtime/Scripts/EyeTracking/EyeManager.cs b/com.htc.upm.wave.essence/Runtime/Scripts/EyeTracking/EyeManager.cs index 7677e48b..c0db475c 100644 --- a/com.htc.upm.wave.essence/Runtime/Scripts/EyeTracking/EyeManager.cs +++ b/com.htc.upm.wave.essence/Runtime/Scripts/EyeTracking/EyeManager.cs @@ -25,13 +25,22 @@ namespace Wave.Essence.Eye [DisallowMultipleComponent] public sealed class EyeManager : MonoBehaviour { + #region Log const string LOG_TAG = "Wave.Essence.Eye.EyeManager"; void DEBUG(string msg) { Log.d(LOG_TAG, msg, true); } - void DEBUG(StringBuilder sb) { Log.d(LOG_TAG, sb, true); } + StringBuilder m_sb = null; + StringBuilder sb { + get { + if (m_sb == null) { m_sb = new StringBuilder(); } + return m_sb; + } + } + void DEBUG(StringBuilder msg) { Log.d(LOG_TAG, msg, true); } bool printIntervalLog = false; int logFrame = 0; void INTERVAL(string msg) { if (printIntervalLog) { DEBUG(msg); } } void INFO(string msg) { Log.i(LOG_TAG, msg, true); } + void INFO(StringBuilder msg) { Log.i(LOG_TAG, msg, true); } private StringBuilder m_EyeManagerStringBuilder = null; internal StringBuilder EyeManagerStringBuilder { @@ -40,6 +49,7 @@ internal StringBuilder EyeManagerStringBuilder { return m_EyeManagerStringBuilder; } } + #endregion private static EyeManager m_Instance = null; public static EyeManager Instance { get { return m_Instance; } } @@ -52,6 +62,7 @@ public enum EyeType Right, Left } + public delegate void EyeTrackingResultDelegate(object sender, bool result); public enum EyeTrackingStatus { // Initial, can call Start API in this state. @@ -76,7 +87,7 @@ public enum EyeSpace : UInt32 #endregion #region Inspector - private bool m_EnableEyeTrackingEx = true; + private bool m_EnableEyeTrackingEx = false; [Tooltip("Enables or disables the eye tracking.")] [SerializeField] private bool m_EnableEyeTracking = true; @@ -120,24 +131,18 @@ private void Awake() SetEyeTrackingStatus(EyeTrackingStatus.UNSUPPORT); } } - private bool mEnabled = false; private void OnEnable() { - if (!mEnabled) - { - m_EnableEyeTrackingEx = m_EnableEyeTracking; - if (m_EnableEyeTracking) - StartEyeTracking(); - - mEnabled = true; - } + SystemEvent.Listen(WVR_EventType.WVR_EventType_DeviceConnected, OnDeviceConnected); + SystemEvent.Listen(WVR_EventType.WVR_EventType_DeviceDisconnected, OnDeviceDisconnected); } private void OnDisable() { - if (mEnabled) - { - mEnabled = false; - } + SystemEvent.Remove(WVR_EventType.WVR_EventType_DeviceConnected, OnDeviceConnected); + SystemEvent.Remove(WVR_EventType.WVR_EventType_DeviceDisconnected, OnDeviceDisconnected); + + // We don't stop eye tracking in this function since OnDisable may be called when ap is stopping. + // AP would crash if the ap process ended before the stop thread finished. } void Update() { @@ -185,8 +190,40 @@ void Update() } } } + + private bool m_EyeTrackingDeviceConnected = false; + + private void Start() + { + m_EyeTrackingDeviceConnected = Interop.WVR_IsDeviceConnected(WVR_DeviceType.WVR_DeviceType_EyeTracking); + sb.Clear().Append("Start() m_EyeTrackingDeviceConnected: ").Append(m_EyeTrackingDeviceConnected); INFO(sb); + } + void OnApplicationPause(bool pauseStatus) + { + sb.Clear().Append("OnApplicationPause() pauseStatus: ").Append(pauseStatus); INFO(sb); + if (!pauseStatus) + { + m_EyeTrackingDeviceConnected = Interop.WVR_IsDeviceConnected(WVR_DeviceType.WVR_DeviceType_EyeTracking); + sb.Clear().Append("OnApplicationPause() m_EyeTrackingDeviceConnected: ").Append(m_EyeTrackingDeviceConnected); INFO(sb); + } + } #endregion + private void OnDeviceConnected(WVR_Event_t systemEvent) + { + WVR_DeviceType device = systemEvent.device.type; + sb.Clear().Append("OnDeviceConnected() ").Append(device.Name()); DEBUG(sb); + if (device == WVR_DeviceType.WVR_DeviceType_EyeTracking) + m_EyeTrackingDeviceConnected = true; + } + private void OnDeviceDisconnected(WVR_Event_t systemEvent) + { + WVR_DeviceType device = systemEvent.device.type; + sb.Clear().Append("OnDeviceDisconnected() ").Append(device.Name()); DEBUG(sb); + if (device == WVR_DeviceType.WVR_DeviceType_EyeTracking) + m_EyeTrackingDeviceConnected = false; + } + #region Eye Tracking Lifecycle private EyeTrackingStatus m_EyeTrackingStatus = EyeTrackingStatus.NOT_START; private static ReaderWriterLockSlim m_EyeTrackingStatusRWLock = new ReaderWriterLockSlim(); @@ -230,19 +267,24 @@ private bool CanStopEyeTracking() return false; } - public delegate void EyeTrackingResultDelegate(object sender, bool result); + private uint m_EyeTrackingRefCount = 0; private object m_EyeTrackingThreadLock = new object(); private event EyeTrackingResultDelegate m_EyeTrackingResultCB = null; private void StartEyeTrackingLock() { + if (!CanStartEyeTracking()) { return; } + if (UseXRData()) { DEBUG("StartEyeTrackingLock() XR"); + + #region Input Device InputDeviceEye.ActivateEyeTracking(true); + #endregion + + if (m_EyeTrackingResultCB != null) { m_EyeTrackingResultCB = null; } // Don't support callback when using XR data. return; } - if (!CanStartEyeTracking()) - return; SetEyeTrackingStatus(EyeTrackingStatus.STARTING); WVR_Result result = Interop.WVR_StartEyeTracking(); @@ -280,9 +322,16 @@ private void StartEyeTrackingThread() private void StartEyeTracking() { if (!CanStartEyeTracking()) + { + INFO("StartEyeTracking() can NOT start eye tracking."); + if (m_EyeTrackingResultCB != null) { m_EyeTrackingResultCB = null; } return; + } + + string caller = Misc.GetCaller(); + m_EyeTrackingRefCount++; + INFO("StartEyeTracking(" + m_EyeTrackingRefCount + ") from " + caller); - INFO("StartEyeTracking()"); Thread eye_tracking_t = new Thread(StartEyeTrackingThread); eye_tracking_t.Name = "StartEyeTrackingThread"; eye_tracking_t.Start(); @@ -290,21 +339,25 @@ private void StartEyeTracking() private void StopEyeTrackingLock() { + if (!CanStopEyeTracking()) { return; } + if (UseXRData()) { DEBUG("StopEyeTrackingLock() XR"); + + #region Input Device InputDeviceEye.ActivateEyeTracking(false); + #endregion + hasEyeTrackingData = false; return; } - if (!CanStopEyeTracking()) - return; - INFO("StopEyeTrackingLock()"); SetEyeTrackingStatus(EyeTrackingStatus.STOPING); Interop.WVR_StopEyeTracking(); SetEyeTrackingStatus(EyeTrackingStatus.NOT_START); + hasEyeTrackingData = false; EyeTrackingStatus status = GetEyeTrackingStatus(); @@ -321,9 +374,16 @@ private void StopEyeTrackingThread() private void StopEyeTracking() { if (!CanStopEyeTracking()) + { + INFO("StopEyeTracking() can NOT stop eye tracking."); return; + } + + string caller = Misc.GetCaller(); + if (m_EyeTrackingRefCount > 0) { m_EyeTrackingRefCount--; } + INFO("StopEyeTracking(" + m_EyeTrackingRefCount + ") from " + caller); + if (m_EyeTrackingRefCount != 0) { return; } - INFO("StopEyeTracking()"); Thread eye_tracking_t = new Thread(StopEyeTrackingThread); eye_tracking_t.Name = "StopEyeTrackingThread"; eye_tracking_t.Start(); @@ -494,6 +554,14 @@ private void GetEyeTrackingData() #endregion #region Public Functions + public bool IsEyeTrackingDeviceConnected() + { + if (UseXRData()) + { + return InputDeviceEye.IsEyeTrackingDeviceConnected(); + } + return m_EyeTrackingDeviceConnected; + } /// Retrieves current eye tracking service status. public EyeTrackingStatus GetEyeTrackingStatus() { diff --git a/com.htc.upm.wave.essence/Runtime/Scripts/HandTracking/HandManager.cs b/com.htc.upm.wave.essence/Runtime/Scripts/HandTracking/HandManager.cs index a1e0b120..212e6ac3 100644 --- a/com.htc.upm.wave.essence/Runtime/Scripts/HandTracking/HandManager.cs +++ b/com.htc.upm.wave.essence/Runtime/Scripts/HandTracking/HandManager.cs @@ -27,6 +27,7 @@ namespace Wave.Essence.Hand [DisallowMultipleComponent] public sealed class HandManager : MonoBehaviour { + #region Log const string LOG_TAG = "Wave.Essence.Hand.HandManager"; private StringBuilder m_sb = null; internal StringBuilder sb { @@ -40,6 +41,7 @@ internal StringBuilder sb { int logFrame = 0; private void INFO(StringBuilder msg) { Log.i(LOG_TAG, msg, true); } private void WARNING(StringBuilder msg) { Log.w(LOG_TAG, msg, true); } + #endregion #region Global Declaration public static readonly string HAND_STATIC_GESTURE = "HAND_STATIC_GESTURE"; @@ -305,18 +307,17 @@ void Start() { if (m_GestureOptions.InitialStart) { - sb.Clear().Append("Start() Starts hand gesture."); DEBUG(sb); + sb.Clear().Append("OnEnable() Starts hand gesture."); DEBUG(sb); StartHandGesture(); } - if (m_TrackerOptions.Natural.InitialStart) { - sb.Clear().Append("Start() Starts the natural hand tracker."); DEBUG(sb); + sb.Clear().Append("OnEnable() Starts the natural hand tracker."); DEBUG(sb); StartHandTracker(TrackerType.Natural); } if (m_TrackerOptions.Electronic.InitialStart) { - sb.Clear().Append("Start() Starts the electronic hand tracker."); DEBUG(sb); + sb.Clear().Append("OnEnable() Starts the electronic hand tracker."); DEBUG(sb); StartHandTracker(TrackerType.Electronic); } @@ -390,6 +391,9 @@ private void OnEnable() private void OnDisable() { SystemEvent.Remove(WVR_EventType.WVR_EventType_Hand_EnhanceStable, OnWristPositionFusionChange); + + // We don't stop hand tracking in this function since OnDisable may be called when ap is stopping. + // AP would crash if the ap process ended before the stop thread finished. } #endregion @@ -722,51 +726,6 @@ private void SetHandTrackerStatus(TrackerType tracker, TrackerStatus status) } } - private bool CanStartHandTracker(TrackerSelector selector) - { - if (selector == TrackerSelector.ElectronicPrior) - { - if (!CanStartHandTracker(TrackerType.Electronic)) - { - TrackerStatus electronic_status = GetHandTrackerStatus(TrackerType.Electronic); - switch (electronic_status) - { - case TrackerStatus.NoSupport: // Electronic tracker is not supported. - case TrackerStatus.NotStart: // Electronic tracker is supported but no electronic hand connected. - case TrackerStatus.StartFailure: // Electronic tracker is supported but has been started failed. - if (!CanStartHandTracker(TrackerType.Natural)) - return false; - // else return true; // The natural tracker is able to start. - break; - default: - break; - } - } - // else return true; // The electronic tracker is able to start. - } - if (selector == TrackerSelector.NaturalPrior) - { - if (!CanStartHandTracker(TrackerType.Natural)) - { - TrackerStatus natural_status = GetHandTrackerStatus(TrackerType.Natural); - switch (natural_status) - { - case TrackerStatus.NoSupport: // Natural tracker is not supported. - case TrackerStatus.NotStart: // Natural tracker is supported but no electronic hand connected. - case TrackerStatus.StartFailure: // Natural tracker is supported but has been started failed. - if (!CanStartHandTracker(TrackerType.Electronic)) - return false; - // else return true; // The natural tracker is able to start. - break; - default: - break; - } - } - // else return true; // The natural tracker is able to start. - } - - return true; - } private bool CanStartHandTracker(TrackerType tracker) { if (tracker == TrackerType.Natural) @@ -777,7 +736,7 @@ private bool CanStartHandTracker(TrackerType tracker) status == TrackerStatus.Stopping || status == TrackerStatus.NoSupport) { - sb.Clear().Append("CanStartHandTracker() status: ").Append(status); DEBUG(sb); + sb.Clear().Append("CanStartHandTracker(").Append(tracker.Name()).Append(") status: ").Append(status); DEBUG(sb); return false; } @@ -811,7 +770,7 @@ private bool CanStopHandTracker(TrackerType tracker) { var status = GetHandTrackerStatus(tracker); if (status == TrackerStatus.Available) { return true; } - sb.Clear().Append("CanStopHandTracker() status:").Append(status.Name()); DEBUG(sb); + sb.Clear().Append("CanStopHandTracker(").Append(tracker.Name()).Append(") status:").Append(status.Name()); DEBUG(sb); return false; } @@ -820,16 +779,20 @@ private bool CanStopHandTracker(TrackerType tracker) private event HandTrackerResultDelegate handTrackerResultCB = null; private void StartHandTrackerLock(TrackerType tracker) { - if (!CanStartHandTracker(tracker)) - return; + if (!CanStartHandTracker(tracker)) { return; } if (UseXRData(tracker)) { + sb.Clear().Append("StartHandTrackerLock() XR ").Append(tracker.Name()); DEBUG(sb); + + #region Input Device if (tracker == TrackerType.Natural) { InputDeviceHand.ActivateNaturalHand(true); } #pragma warning disable if (tracker == TrackerType.Electronic) { InputDeviceHand.ActivateElectronicHand(true); } #pragma warning enable - sb.Clear().Append("StartHandTrackerLock() XR ").Append(tracker.Name()); DEBUG(sb); + #endregion + + if (handTrackerResultCB != null) { handTrackerResultCB = null; } // Don't support callback when using XR data. return; } @@ -871,7 +834,11 @@ private void StartHandTrackerThread(object tracker) public void StartHandTracker(TrackerType tracker) { if (!CanStartHandTracker(tracker)) + { + sb.Clear().Append("StartHandTracker() ").Append(tracker.Name()).Append(", can NOT start hand tracker."); INFO(sb); + if (handTrackerResultCB != null) { handTrackerResultCB = null; } return; + } string caller = Misc.GetCaller(); if (tracker == TrackerType.Natural) @@ -889,19 +856,37 @@ public void StartHandTracker(TrackerType tracker) hand_tracker_t.Name = "StartHandTrackerThread"; hand_tracker_t.Start(tracker); } + public void StartHandTracker(TrackerType tracker, HandTrackerResultDelegate callback) + { + if (handTrackerResultCB == null) + { + handTrackerResultCB = callback; + } + else + { + handTrackerResultCB += callback; + } + + StartHandTracker(tracker); + } private void StopHandTrackerLock(TrackerType tracker) { - if (!CanStopHandTracker(tracker)) - return; + if (!CanStopHandTracker(tracker)) { return; } if (UseXRData(tracker)) { + sb.Clear().Append("StopHandTrackerLock() XR ").Append(tracker.Name()); DEBUG(sb); + + #region Input Device if (tracker == TrackerType.Natural) { InputDeviceHand.ActivateNaturalHand(false); } #pragma warning disable if (tracker == TrackerType.Electronic) { InputDeviceHand.ActivateElectronicHand(false); } #pragma warning enable - sb.Clear().Append("StopHandTrackerLock() XR ").Append(tracker.Name()); DEBUG(sb); + #endregion + + if (tracker == TrackerType.Natural) { hasNaturalHandTrackerData = false; } + if (tracker == TrackerType.Electronic) { hasElectronicHandTrackerData = false; } return; } @@ -909,10 +894,9 @@ private void StopHandTrackerLock(TrackerType tracker) SetHandTrackerStatus(tracker, TrackerStatus.Stopping); Interop.WVR_StopHandTracking((WVR_HandTrackerType)tracker); SetHandTrackerStatus(tracker, TrackerStatus.NotStart); - if (tracker == TrackerType.Natural) - hasNaturalHandTrackerData = false; - if (tracker == TrackerType.Electronic) - hasElectronicHandTrackerData = false; + + if (tracker == TrackerType.Natural) { hasNaturalHandTrackerData = false; } + if (tracker == TrackerType.Electronic) { hasElectronicHandTrackerData = false; } TrackerStatus status = GetHandTrackerStatus(tracker); GeneralEvent.Send(HAND_TRACKER_STATUS, tracker, status); @@ -928,20 +912,23 @@ private void StopHandTrackerThread(object tracker) public void StopHandTracker(TrackerType tracker) { if (!CanStopHandTracker(tracker)) + { + sb.Clear().Append("StopHandTracker() ").Append(tracker.Name()).Append(", can NOT stop hand tracker."); INFO(sb); return; + } string caller = Misc.GetCaller(); if (tracker == TrackerType.Natural) { - refCountNatural = refCountNatural > 0 ? refCountNatural - 1 : 0; + if (refCountNatural > 0) { refCountNatural--; } sb.Clear().Append("StopHandTracker() ").Append(tracker.Name()).Append("(").Append(refCountNatural).Append(") from ").Append(caller); INFO(sb); - if (refCountNatural > 0) return; + if (refCountNatural != 0) return; } if (tracker == TrackerType.Electronic) { - refCountElectronic = refCountElectronic > 0 ? refCountElectronic - 1 : 0; + if (refCountElectronic > 0) { refCountElectronic--; } sb.Clear().Append("StopHandTracker() ").Append(tracker.Name()).Append("(").Append(refCountElectronic).Append(") from ").Append(caller); INFO(sb); - if (refCountElectronic > 0) return; + if (refCountElectronic != 0) return; } Thread hand_tracker_t = new Thread(StopHandTrackerThread); @@ -977,6 +964,32 @@ private void RestartHandTrackerThread(object tracker) } } } + public void RestartHandTracker(TrackerType tracker) + { + TrackerStatus status = GetHandTrackerStatus(); + if (status == TrackerStatus.Starting || status == TrackerStatus.Stopping) + return; + + sb.Clear().Append("RestartHandTracker() ").Append(tracker.Name()); INFO(sb); + Thread hand_tracker_t = new Thread(RestartHandTrackerThread); + hand_tracker_t.Name = "RestartHandTrackerThread"; + hand_tracker_t.Start(tracker); + } + public void RestartHandTracker(TrackerType tracker, HandTrackerResultDelegate callback) + { + if (handTrackerResultCB == null) + handTrackerResultCB = callback; + else + handTrackerResultCB += callback; + + RestartHandTracker(tracker); + } + public void RestartHandTracker() + { + TrackerType tracker = TrackerType.Electronic; + if (GetPreferTracker(ref tracker)) + RestartHandTracker(tracker); + } #endregion #region Hand Tracking Interface @@ -1060,33 +1073,6 @@ public TrackerStatus GetHandTrackerStatus() return TrackerStatus.NotStart; } - public void RestartHandTracker(TrackerType tracker) - { - TrackerStatus status = GetHandTrackerStatus(); - if (status == TrackerStatus.Starting || status == TrackerStatus.Stopping) - return; - - sb.Clear().Append("RestartHandTracker() ").Append(tracker.Name()); INFO(sb); - Thread hand_tracker_t = new Thread(RestartHandTrackerThread); - hand_tracker_t.Name = "RestartHandTrackerThread"; - hand_tracker_t.Start(tracker); - } - public void RestartHandTracker(TrackerType tracker, HandTrackerResultDelegate callback) - { - if (handTrackerResultCB == null) - handTrackerResultCB = callback; - else - handTrackerResultCB += callback; - - RestartHandTracker(tracker); - } - public void RestartHandTracker() - { - TrackerType tracker = TrackerType.Electronic; - if (GetPreferTracker(ref tracker)) - RestartHandTracker(tracker); - } - /// /// Retrieves the timestamp of hand tracking data of a tracker. /// diff --git a/com.htc.upm.wave.essence/Runtime/Scripts/LipExpression/LipExpManager.cs b/com.htc.upm.wave.essence/Runtime/Scripts/LipExpression/LipExpManager.cs index 47c3832f..14ae25bf 100644 --- a/com.htc.upm.wave.essence/Runtime/Scripts/LipExpression/LipExpManager.cs +++ b/com.htc.upm.wave.essence/Runtime/Scripts/LipExpression/LipExpManager.cs @@ -23,6 +23,7 @@ public class LipExpManager : MonoBehaviour private static void DEBUG(string msg) { Log.d(LOG_TAG, msg, true); } private static void INFO(string msg) { Log.i(LOG_TAG, msg, true); } + public delegate void LipExpResultDelegate(object sender, bool result); public enum LipExpStatus { // Initial, can call Start API in this state. @@ -81,24 +82,10 @@ private void Awake() SetLipExpStatus(LipExpStatus.NoSupport); } } - bool mEnabled = false; - private void OnEnable() + void Start() { - if (!mEnabled) - { - INFO("OnEnable()"); - if (m_InitialStart) { StartLipExp(); } - - mEnabled = true; - } - } - private void OnDisable() - { - if (mEnabled) - { - INFO("OnDisable()"); - mEnabled = false; - } + INFO("Start()"); + if (m_InitialStart) { StartLipExp(); } } private void Update() { @@ -147,12 +134,25 @@ private bool CanStopLipExp() return false; } - public delegate void LipExpResultDelegate(object sender, bool result); + private uint m_LipExpRefCount = 0; + private object lipExpThreadLocker = new object(); private event LipExpResultDelegate lipExpResultCB = null; private void StartLipExpLock() { if (!CanStartLipExp()) { return; } + if (UseXRData()) + { + DEBUG("StartLipExpLock() XR "); + + #region Input Device + InputDeviceLip.ActivateLipExp(true); + #endregion + + if (lipExpResultCB != null) { lipExpResultCB = null; } // Don't support callback when using XR data. + return; + } + SetLipExpStatus(LipExpStatus.Starting); WVR_Result result = Interop.WVR_StartLipExp(); switch (result) @@ -167,7 +167,9 @@ private void StartLipExpLock() SetLipExpStatus(LipExpStatus.StartFailure); break; } - DEBUG("StartLipExpLock() result: " + result); + + LipExpStatus status = GetLipExpStatus(); + DEBUG("StartLipExpLock() result: " + result + ", status: " + status); if (lipExpResultCB != null) { @@ -175,8 +177,6 @@ private void StartLipExpLock() lipExpResultCB = null; } } - - private object lipExpThreadLocker = new object(); private void StartLipExpThread() { lock (lipExpThreadLocker) @@ -185,15 +185,59 @@ private void StartLipExpThread() StartLipExpLock(); } } + public void StartLipExp() + { + if (!CanStartLipExp()) + { + INFO("StartLipExp() can NOT start lip expression."); + if (lipExpResultCB != null) { lipExpResultCB = null; } + return; + } + + string caller = Misc.GetCaller(); + m_LipExpRefCount++; + INFO("StartLipExp(" + m_LipExpRefCount + ") from " + caller); + + Thread lipExp_t = new Thread(StartLipExpThread); + lipExp_t.Name = "StartLipExpThread"; + lipExp_t.Start(); + } + public void StartLipExp(LipExpResultDelegate callback) + { + if (lipExpResultCB == null) + { + lipExpResultCB = callback; + } + else + { + lipExpResultCB += callback; + } + + StartLipExp(); + } private void StopLipExpLock() { if (!CanStopLipExp()) { return; } - SetLipExpStatus(LipExpStatus.Stopping); + if (UseXRData()) + { + DEBUG("StopLipExpLock() XR"); + + #region Input Device + InputDeviceLip.ActivateLipExp(false); + #endregion + + hasLipExpData = false; + return; + } + INFO("StopLipExpLock()"); + SetLipExpStatus(LipExpStatus.Stopping); Interop.WVR_StopLipExp(); SetLipExpStatus(LipExpStatus.NotStart); + + hasLipExpData = false; } private void StopLipExpThread() { @@ -203,6 +247,23 @@ private void StopLipExpThread() StopLipExpLock(); } } + public void StopLipExp() + { + if (!CanStopLipExp()) + { + INFO("CanStopLipExp() can NOT stop lip expression."); + return; + } + + string caller = Misc.GetCaller(); + if (m_LipExpRefCount > 0) { m_LipExpRefCount--; } + INFO("StopLipExp(" + m_LipExpRefCount + ") from " + caller); + if (m_LipExpRefCount != 0) { return; } + + Thread tracker_t = new Thread(StopLipExpThread); + tracker_t.Name = "StopLipExpThread"; + tracker_t.Start(); + } #endregion #region Lip Expression Data @@ -268,68 +329,6 @@ public LipExpStatus GetLipExpStatus() } } - private uint m_LipExpRefCount = 0; - public void StartLipExp(LipExpResultDelegate callback) - { - if (lipExpResultCB == null) - { - lipExpResultCB = callback; - } - else - { - lipExpResultCB += callback; - } - - StartLipExp(); - } - public void StartLipExp() - { - //string caller = new StackFrame(1, true).GetMethod().Name; - Log.i(LOG_TAG, "StartLipExp(" + m_LipExpRefCount + ")", true); - m_LipExpRefCount++; - - if (UseXRData()) - { - InputDeviceLip.ActivateLipExp(true); - if (lipExpResultCB != null) { lipExpResultCB = null; } // Don't support callback when using XR data. - return; - } - - if (!CanStartLipExp()) - { - DEBUG("StartLipExp() can NOT start lip expression."); - if (lipExpResultCB != null) { lipExpResultCB = null; } - return; - } - - Thread lipExp_t = new Thread(StartLipExpThread); - lipExp_t.Name = "StartLipExpThread"; - lipExp_t.Start(); - } - public void StopLipExp() - { - //string caller = new StackFrame(1, true).GetMethod().Name; - Log.i(LOG_TAG, "StopLipExp(" + m_LipExpRefCount + ")", true); - if (m_LipExpRefCount > 0) { m_LipExpRefCount--; } - if (m_LipExpRefCount > 0) { return; } - - if (UseXRData()) - { - InputDeviceLip.ActivateLipExp(false); - return; - } - - if (!CanStopLipExp()) - { - DEBUG("CanStopLipExp() can NOT stop lip expression."); - return; - } - - Thread tracker_t = new Thread(StopLipExpThread); - tracker_t.Name = "StopLipExpThread"; - tracker_t.Start(); - } - public bool IsLipExpEnabled() { var status = GetLipExpStatus(); diff --git a/com.htc.upm.wave.essence/Runtime/Scripts/Tracker/TrackerManager.cs b/com.htc.upm.wave.essence/Runtime/Scripts/Tracker/TrackerManager.cs index 4acf990b..766b0626 100644 --- a/com.htc.upm.wave.essence/Runtime/Scripts/Tracker/TrackerManager.cs +++ b/com.htc.upm.wave.essence/Runtime/Scripts/Tracker/TrackerManager.cs @@ -18,6 +18,7 @@ using System.Threading; using System.Diagnostics; using UnityEngine.XR; +using UnityEngine.Events; using System.Runtime.InteropServices; using System.Text; @@ -74,10 +75,27 @@ public enum TrackerStatus private static TrackerManager instance = null; public static TrackerManager Instance { get { return instance; } } + #region Inspector [SerializeField] private bool m_InitialStartTracker = false; public bool InitialStartTracker { get { return m_InitialStartTracker; } set { m_InitialStartTracker = value; } } + [Serializable] + public class TrackerSwipeEvent : UnityEvent { }; + [SerializeField] + private TrackerSwipeEvent m_OnSwipeToRight = new TrackerSwipeEvent(); + public TrackerSwipeEvent OnSwipeToRight { get { return m_OnSwipeToRight; } set { m_OnSwipeToRight = value; } } + [SerializeField] + private TrackerSwipeEvent m_OnSwipeToLeft = new TrackerSwipeEvent(); + public TrackerSwipeEvent OnSwipeToLeft { get { return m_OnSwipeToLeft; } set { m_OnSwipeToLeft = value; } } + [SerializeField] + private TrackerSwipeEvent m_OnSwipeToUp = new TrackerSwipeEvent(); + public TrackerSwipeEvent OnSwipeToUp { get { return m_OnSwipeToUp; } set { m_OnSwipeToUp = value; } } + [SerializeField] + private TrackerSwipeEvent m_OnSwipeToDown = new TrackerSwipeEvent(); + public TrackerSwipeEvent OnSwipeToDown { get { return m_OnSwipeToDown; } set { m_OnSwipeToDown = value; } } + #endregion + #region Wave XR Constants const string kTrackerComponentStatus = "TrackerComponentStatus"; #endregion @@ -154,6 +172,10 @@ private void OnEnable() SystemEvent.Listen(WVR_EventType.WVR_EventType_TrackerButtonUnpressed, OnTrackerButtonUnpressed); SystemEvent.Listen(WVR_EventType.WVR_EventType_TrackerTouchTapped, OnTrackerTouchTapped); SystemEvent.Listen(WVR_EventType.WVR_EventType_TrackerTouchUntapped, OnTrackerTouchUntapped); + SystemEvent.Listen(WVR_EventType.WVR_EventType_TrackerLeftToRightSwipe, OnTrackerSwipe); + SystemEvent.Listen(WVR_EventType.WVR_EventType_TrackerRightToLeftSwipe, OnTrackerSwipe); + SystemEvent.Listen(WVR_EventType.WVR_EventType_TrackerDownToUpSwipe, OnTrackerSwipe); + SystemEvent.Listen(WVR_EventType.WVR_EventType_TrackerUpToDownSwipe, OnTrackerSwipe); if (m_InitialStartTracker) { StartTracker(); } } @@ -167,6 +189,12 @@ private void OnDisable() SystemEvent.Remove(WVR_EventType.WVR_EventType_TrackerButtonUnpressed, OnTrackerButtonUnpressed); SystemEvent.Remove(WVR_EventType.WVR_EventType_TrackerTouchTapped, OnTrackerTouchTapped); SystemEvent.Remove(WVR_EventType.WVR_EventType_TrackerTouchUntapped, OnTrackerTouchUntapped); + SystemEvent.Remove(WVR_EventType.WVR_EventType_TrackerLeftToRightSwipe, OnTrackerSwipe); + SystemEvent.Remove(WVR_EventType.WVR_EventType_TrackerRightToLeftSwipe, OnTrackerSwipe); + SystemEvent.Remove(WVR_EventType.WVR_EventType_TrackerDownToUpSwipe, OnTrackerSwipe); + SystemEvent.Remove(WVR_EventType.WVR_EventType_TrackerUpToDownSwipe, OnTrackerSwipe); + + StopTracker(); } static List s_InputDevices = new List(); @@ -836,6 +864,28 @@ private void OnTrackerTouchUntapped(WVR_Event_t systemEvent) s_TrackerButtonStates[trackerId].s_ButtonTouch[id.ArrayIndex()] = false; } + private void OnTrackerSwipe(WVR_Event_t systemEvent) + { + TrackerId trackerId = systemEvent.trackerInput.tracker.trackerId.Id(); + WVR_InputId id = systemEvent.trackerInput.inputId; + sb.Clear().Append("OnTrackerSwipe() ").Append(trackerId.Name()).Append(", ").Append(id); DEBUG(sb); + + switch (systemEvent.common.type) + { + case WVR_EventType.WVR_EventType_TrackerLeftToRightSwipe: + m_OnSwipeToRight?.Invoke((uint)trackerId); + break; + case WVR_EventType.WVR_EventType_TrackerRightToLeftSwipe: + m_OnSwipeToLeft?.Invoke((uint)trackerId); + break; + case WVR_EventType.WVR_EventType_TrackerDownToUpSwipe: + m_OnSwipeToUp?.Invoke((uint)trackerId); + break; + case WVR_EventType.WVR_EventType_TrackerUpToDownSwipe: + m_OnSwipeToDown?.Invoke((uint)trackerId); + break; + } + } bool AllowUpdateTrackerButton(TrackerId trackerId, WVR_InputId id) { @@ -1071,6 +1121,11 @@ public bool IsTrackerConnected(TrackerId trackerId) return s_TrackerConnection[trackerId]; } + /// + /// Checks if a tracker's pose is valid. + /// + /// A tracker's ID in TrackerId. + /// True for the pose is valid. public bool IsTrackerPoseValid(TrackerId trackerId) { if (UseXRData()) @@ -1080,6 +1135,12 @@ public bool IsTrackerPoseValid(TrackerId trackerId) return s_TrackerPoses[trackerId].valid; } + /// + /// Retrieves the InputTrackingState of a tracker's pose. + /// + /// A tracker's ID in TrackerId. + /// A tracker pose's state in InputTrackingState. + /// True for the state is valid. public bool GetTrackerTrackingState(TrackerId trackerId, out InputTrackingState state) { state = InputTrackingState.None; @@ -1162,6 +1223,12 @@ public Quaternion GetTrackerRotation(TrackerId trackerId) return s_TrackerPoses[trackerId].rigid.rot; } + /// + /// Retrieves a tracker's velocity in Vector3. + /// + /// A tracker's ID in TrackerId. + /// A tracker pose's velocity in Vector3. + /// >True for the velocity is valid. public bool GetTrackerVelocity(TrackerId trackerId, out Vector3 velocity) { if (UseXRData()) @@ -1182,6 +1249,12 @@ public Vector3 GetTrackerVelocity(TrackerId trackerId) } return s_TrackerPoses[trackerId].velocity; } + /// + /// Retrieves a tracker's angular velocity in Vector3. + /// + /// A tracker's ID in TrackerId. + /// A tracker pose's angular velocity in Vector3. + /// >True for the angular velocity is valid. public bool GetTrackerAngularVelocity(TrackerId trackerId, out Vector3 angularVelocity) { if (UseXRData()) @@ -1202,6 +1275,12 @@ public Vector3 GetTrackerAngularVelocity(TrackerId trackerId) } return s_TrackerPoses[trackerId].angularVelocity; } + /// + /// Retrieves a tracker's acceleration in Vector3. + /// + /// A tracker's ID in TrackerId. + /// A tracker pose's acceleration in Vector3. + /// >True for the acceleration is valid. public bool GetTrackerAcceleration(TrackerId trackerId, out Vector3 acceleration) { if (UseXRData()) @@ -1289,6 +1368,14 @@ public Vector2 TrackerButtonAxis(TrackerId trackerId, TrackerButton id) return axis; } } + if (id == TrackerButton.Grip) + { + if (InputDeviceTracker.ButtonAxis(trackerId.InputDevice(), XR_Feature.grip, out float value)) + { + axis.x = value; + return axis; + } + } return axis; } diff --git a/com.htc.upm.wave.essence/Runtime/Scripts/Tracker/TrackerSimulatorPose.cs b/com.htc.upm.wave.essence/Runtime/Scripts/Tracker/TrackerSimulatorPose.cs new file mode 100644 index 00000000..f9053a8f --- /dev/null +++ b/com.htc.upm.wave.essence/Runtime/Scripts/Tracker/TrackerSimulatorPose.cs @@ -0,0 +1,195 @@ +// "WaveVR SDK +// © 2023 HTC Corporation. All Rights Reserved. +// +// Unless otherwise required by copyright law and practice, +// upon the execution of HTC SDK license agreement, +// HTC grants you access to and use of the WaveVR SDK(s). +// You shall fully comply with all of HTC’s SDK license agreement terms and +// conditions signed by you and all SDK and API requirements, +// specifications, and documentation provided by HTC to You." + +using UnityEngine; +using Wave.OpenXR; + +namespace Wave.Essence.Tracker +{ + public class TrackerSimulatorPose : MonoBehaviour + { + #region Inspector + [SerializeField] + private TrackerId m_TrackerId = TrackerId.Tracker0; + public TrackerId TrackerId { get { return m_TrackerId; } set { m_TrackerId = value; } } + [SerializeField] + private bool m_IsLeft = false; + public bool IsLeft { get { return m_IsLeft; } set { m_IsLeft = value; } } + #endregion + + #region ArmModel + private readonly Vector3 CENTER_EYE_POSITION = new Vector3(0, 0.15f, 0.12f); + // Position simulation variables. + private Quaternion bodyRotation = Quaternion.identity; + private Vector3 bodyDirection = Vector3.zero; + private const float BODY_ANGLE_BOUND = 0.01f; + private const float BODY_ANGLE_LIMITATION = 0.3f; // bound of controller angle in SPEC provided to provider. + private uint framesOfFreeze = 0; // if framesOfFreeze >= mFPS, means controller freezed. + private const float FPS = 60.0f; + private Vector3 v3ChangeArmXAxis => m_IsLeft ? new Vector3(-1, 1, 1) : new Vector3(1, 1, 1); + private readonly Vector3 HEADTOELBOW_OFFSET = new Vector3(0.2f, -0.7f, 0f); + private readonly Vector3 ELBOW_PITCH_OFFSET = new Vector3(-0.2f, 0.55f, 0.08f); + private readonly Vector3 ELBOW_RAISE_OFFSET = new Vector3(0, 0, 0); + private const float ELBOW_PITCH_ANGLE_MIN = 0; + private const float ELBOW_PITCH_ANGLE_MAX = 60; + private const float ELBOW_TO_XYPLANE_LERP_MIN = 0.45f; + private const float ELBOW_TO_XYPLANE_LERP_MAX = 0.65f; + private readonly Vector3 ELBOWTOWRIST_OFFSET = new Vector3(0.0f, 0.0f, 0.15f); + private readonly Vector3 WRISTTOCONTROLLER_OFFSET = new Vector3(0.0f, 0.0f, 0.05f); + /// controller lerp speed for smooth movement between with head position case and without head position case + private float smoothMoveSpeed = 0.3f; + private Vector3 controllerSimulatedPosition = Vector3.zero; + private Vector3 currentPosition = Vector3.zero; + private Quaternion lastRotation = Quaternion.identity; + #endregion + + private void Update() + { + InputDeviceTracker.TrackerId id = (InputDeviceTracker.TrackerId)m_TrackerId; + if (!InputDeviceTracker.IsAvailable(id) || !InputDeviceTracker.IsTracked(id)) + { + return; + } + + if (InputDeviceTracker.GetRotation(id, out Quaternion currentRotation)) + { + UpdateControllerPose(currentRotation); + currentPosition = Vector3.Lerp(currentPosition, controllerSimulatedPosition, smoothMoveSpeed); + lastRotation = currentRotation; + transform.SetPositionAndRotation(currentPosition, currentRotation); + } + } + + private void UpdateControllerPose(Quaternion currentRotation) + { + bodyRotation = Quaternion.identity; + UpdateHeadAndBodyPose(currentRotation); + ComputeControllerPose(currentRotation); + controllerSimulatedPosition += CENTER_EYE_POSITION; + } + + private void UpdateHeadAndBodyPose(Quaternion currentRotation) + { + // Determine the gaze direction horizontally. + Vector3 gazeDirection = GetHeadForward(); + gazeDirection.y = 0; + gazeDirection.Normalize(); + float _bodyLerpFilter = BodyRotationFilter(currentRotation); + + bodyDirection = Vector3.Slerp(bodyDirection, gazeDirection, _bodyLerpFilter); + bodyRotation = Quaternion.FromToRotation(Vector3.forward, bodyDirection); + } + + private float BodyRotationFilter(Quaternion currentRotation) + { + float _bodyLerpFilter = 0; + + Quaternion _rot_old = lastRotation; + Quaternion _rot_new = currentRotation; + float _rot_XY_angle_old = 0, _rot_XY_angle_new = 0; + + Vector3 _rot_forward = Vector3.zero; + Quaternion _rot_XY_rotation = Quaternion.identity; + + _rot_forward = _rot_old * Vector3.forward; + _rot_XY_rotation = Quaternion.FromToRotation(Vector3.forward, _rot_forward); + _rot_XY_angle_old = Quaternion.Angle(_rot_XY_rotation, Quaternion.identity); + + _rot_forward = _rot_new * Vector3.forward; + _rot_XY_rotation = Quaternion.FromToRotation(Vector3.forward, _rot_forward); + _rot_XY_angle_new = Quaternion.Angle(_rot_XY_rotation, Quaternion.identity); + + float _diff_angle = _rot_XY_angle_new - _rot_XY_angle_old; + _diff_angle = _diff_angle > 0 ? _diff_angle : -_diff_angle; + + _bodyLerpFilter = Mathf.Clamp((_diff_angle - BODY_ANGLE_BOUND) / BODY_ANGLE_LIMITATION, 0, 1.0f); + + framesOfFreeze = _bodyLerpFilter < 1.0f ? framesOfFreeze + 1 : 0; + + if (framesOfFreeze > FPS) + _bodyLerpFilter = 0; + return _bodyLerpFilter; + } + + private void ComputeControllerPose(Quaternion currentRotation) + { + // if bodyRotation angle is θ, _inverseBodyRation is -θ + // the operator * of Quaternion in Unity means concatenation, not multipler. + // If quaternion qA has angle θ, quaternion qB has angle ε, + // qA * qB will plus θ and ε which means rotating angle θ then rotating angle ε. + // (_inverseBodyRotation * rotation of controller in world space) means angle ε subtracts angle θ. + Quaternion _controllerRotation = Quaternion.Inverse(bodyRotation) * currentRotation; + Vector3 _headPosition = GetHeadPosition(); + + /// 1. simulated elbow offset = default elbow offset apply body rotation = body rotation (Quaternion) * elbow offset (Vector3) + // Default left / right elbow offset. + Vector3 _elbowOffset = Vector3.Scale(HEADTOELBOW_OFFSET, v3ChangeArmXAxis); + // Default left / right elbow pitch offset. + Vector3 _elbowPitchOffset = Vector3.Scale(ELBOW_PITCH_OFFSET, v3ChangeArmXAxis) + ELBOW_RAISE_OFFSET; + + // Use controller pitch to simulate elbow pitch. + // Range from ELBOW_PITCH_ANGLE_MIN ~ ELBOW_PITCH_ANGLE_MAX. + // The percent of pitch angle will be used to calculate the position offset. + Vector3 _controllerForward = _controllerRotation * Vector3.forward; + float _controllerPitch = 90.0f - Vector3.Angle(_controllerForward, Vector3.up); // 0~90 + float _controllerPitchRadio = (_controllerPitch - ELBOW_PITCH_ANGLE_MIN) / (ELBOW_PITCH_ANGLE_MAX - ELBOW_PITCH_ANGLE_MIN); + _controllerPitchRadio = Mathf.Clamp(_controllerPitchRadio, 0.0f, 1.0f); + + // According to pitch angle percent, plus offset to elbow position. + _elbowOffset += _elbowPitchOffset * _controllerPitchRadio; + // Apply body rotation and head position to calculate final elbow position. + _elbowOffset = _headPosition + bodyRotation * _elbowOffset; + + // Rotation from Z-axis to XY-plane used to simulated elbow & wrist rotation. + Quaternion _controllerXYRotation = Quaternion.FromToRotation(Vector3.forward, _controllerForward); + float _controllerXYRotationRadio = (Quaternion.Angle(_controllerXYRotation, Quaternion.identity)) / 180; + // Simulate the elbow raising curve. + float _elbowCurveLerpValue = ELBOW_TO_XYPLANE_LERP_MIN + (_controllerXYRotationRadio * (ELBOW_TO_XYPLANE_LERP_MAX - ELBOW_TO_XYPLANE_LERP_MIN)); + Quaternion _controllerXYLerpRotation = Quaternion.Lerp(Quaternion.identity, _controllerXYRotation, _elbowCurveLerpValue); + + + /// 2. simulated wrist offset = default wrist offset apply elbow rotation = elbow rotation (Quaternion) * wrist offset (Vector3) + // Default left / right wrist offset + Vector3 _wristOffset = Vector3.Scale(ELBOWTOWRIST_OFFSET, v3ChangeArmXAxis); + // elbow rotation + curve = wrist rotation + // wrist rotation = controller XY rotation + // => elbow rotation + curve = controller XY rotation + // => elbow rotation = controller XY rotation - curve + Quaternion _elbowRotation = bodyRotation * Quaternion.Inverse(_controllerXYLerpRotation) * _controllerXYRotation; + // Apply elbow offset and elbow rotation to calculate final wrist position. + _wristOffset = _elbowOffset + _elbowRotation * _wristOffset; + + + /// 3. simulated controller offset = default controller offset apply wrist rotation = wrist rotation (Quat) * controller offset (V3) + // Default left / right controller offset. + Vector3 _controllerOffset = Vector3.Scale(WRISTTOCONTROLLER_OFFSET, v3ChangeArmXAxis); + Quaternion _wristRotation = _controllerXYRotation; + // Apply wrist offset and wrist rotation to calculate final controller position. + _controllerOffset = _wristOffset + _wristRotation * _controllerOffset; + + controllerSimulatedPosition = /*bodyRotation */ _controllerOffset; + //controllerSimulatedRotation = bodyRotation * _controllerRotation; + } + + private Vector3 GetHeadPosition() + { + Vector3 hmdPosition = Vector3.zero; + InputDeviceControl.GetPosition(InputDeviceControl.kHMDCharacteristics, out hmdPosition); + return hmdPosition; + } + + private Vector3 GetHeadForward() + { + Quaternion hmdRotation = Quaternion.identity; + InputDeviceControl.GetRotation(InputDeviceControl.kHMDCharacteristics, out hmdRotation); + return hmdRotation * Vector3.forward; + } + } +} \ No newline at end of file diff --git a/com.htc.upm.wave.essence/Runtime/Scripts/Tracker/TrackerSimulatorPose.cs.meta b/com.htc.upm.wave.essence/Runtime/Scripts/Tracker/TrackerSimulatorPose.cs.meta new file mode 100644 index 00000000..2d6cc1d0 --- /dev/null +++ b/com.htc.upm.wave.essence/Runtime/Scripts/Tracker/TrackerSimulatorPose.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 70a380ff284ac9448b3dd3f869bdde62 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.htc.upm.wave.essence/Runtime/Scripts/Tracker/TrackerUtils.cs b/com.htc.upm.wave.essence/Runtime/Scripts/Tracker/TrackerUtils.cs index 9cd1eefd..b0366bb2 100644 --- a/com.htc.upm.wave.essence/Runtime/Scripts/Tracker/TrackerUtils.cs +++ b/com.htc.upm.wave.essence/Runtime/Scripts/Tracker/TrackerUtils.cs @@ -75,8 +75,9 @@ public enum TrackerRole public enum TrackerButton { - System = WVR_InputId.WVR_InputId_0, + System = WVR_InputId.WVR_InputId_Alias1_System, Menu = WVR_InputId.WVR_InputId_Alias1_Menu, + Grip = WVR_InputId.WVR_InputId_Alias1_Grip, A = WVR_InputId.WVR_InputId_Alias1_A, B = WVR_InputId.WVR_InputId_Alias1_B, X = WVR_InputId.WVR_InputId_Alias1_X, @@ -320,6 +321,7 @@ public static int Num(this TrackerButton button) { if (button == TrackerButton.System) { return 0; } if (button == TrackerButton.Menu) { return 1; } + if (button == TrackerButton.Grip) { return 2; } if (button == TrackerButton.A) { return 10; } if (button == TrackerButton.B) { return 11; } if (button == TrackerButton.X) { return 12; } @@ -333,6 +335,7 @@ public static WVR_InputId Id(this TrackerButton button) { if (button == TrackerButton.System) { return WVR_InputId.WVR_InputId_Alias1_System; } if (button == TrackerButton.Menu) { return WVR_InputId.WVR_InputId_Alias1_Menu; } + if (button == TrackerButton.Grip) { return WVR_InputId.WVR_InputId_Alias1_Grip; } if (button == TrackerButton.A) { return WVR_InputId.WVR_InputId_Alias1_A; } if (button == TrackerButton.B) { return WVR_InputId.WVR_InputId_Alias1_B; } if (button == TrackerButton.X) { return WVR_InputId.WVR_InputId_Alias1_X; } @@ -346,7 +349,8 @@ public static InputFeatureUsage Usage(this TrackerButton button, WVR_Input { if (inputType == WVR_InputType.WVR_InputType_Button) { - if (button == TrackerButton.Menu || button == TrackerButton.System) { return XR_Feature.menuButton; } + if (button == TrackerButton.Menu) { return XR_Feature.menuButton; } + if (button == TrackerButton.Grip) { return XR_Feature.gripButton; } if (button == TrackerButton.A || button == TrackerButton.X) { return XR_Feature.primaryButton; } if (button == TrackerButton.B || button == TrackerButton.Y) { return XR_Feature.secondaryButton; } if (button == TrackerButton.Touchpad) { return XR_Feature.primary2DAxisClick; } @@ -354,6 +358,8 @@ public static InputFeatureUsage Usage(this TrackerButton button, WVR_Input } if (inputType == WVR_InputType.WVR_InputType_Touch) { + if (button == TrackerButton.Menu) { return XR_Feature.menuTouch; } + if (button == TrackerButton.Grip) { return XR_Feature.gripTouch; } if (button == TrackerButton.A || button == TrackerButton.X) { return XR_Feature.primaryTouch; } if (button == TrackerButton.B || button == TrackerButton.Y) { return XR_Feature.secondaryTouch; } if (button == TrackerButton.Touchpad) { return XR_Feature.primary2DAxisTouch; } diff --git a/com.htc.upm.wave.essence/Runtime/Scripts/WaveEssence.cs b/com.htc.upm.wave.essence/Runtime/Scripts/WaveEssence.cs index e7c2fae1..bc3d2f71 100644 --- a/com.htc.upm.wave.essence/Runtime/Scripts/WaveEssence.cs +++ b/com.htc.upm.wave.essence/Runtime/Scripts/WaveEssence.cs @@ -179,6 +179,7 @@ void Update() Log.gpl.check(); UpdateEventButtons(); + UpdateDevicesPose(); } #endregion @@ -1093,5 +1094,89 @@ public bool IsTableStatic(XR_Hand hand) return false; } #endregion + + #region Wave Native Pose and Haptic + private static readonly WVR_PoseState_t emptyWVR_PoseState = new WVR_PoseState_t(); + private Dictionary m_Pose = new Dictionary() + { + { WVR_DeviceType.WVR_DeviceType_HMD, emptyWVR_PoseState }, + { WVR_DeviceType.WVR_DeviceType_Controller_Right, emptyWVR_PoseState }, + { WVR_DeviceType.WVR_DeviceType_Controller_Left, emptyWVR_PoseState }, + }; + private void UpdateDevicesPose() + { + UpdatePose(WVR_DeviceType.WVR_DeviceType_HMD); + UpdatePose(WVR_DeviceType.WVR_DeviceType_Controller_Right); + UpdatePose(WVR_DeviceType.WVR_DeviceType_Controller_Left); + } + + private void UpdatePose(WVR_DeviceType deviceType) + { + if (IsConnected(deviceType)) + { + WVR_PoseState_t newPose = m_Pose[deviceType]; + WVR_PoseOriginModel origin = WVR_PoseOriginModel.WVR_PoseOriginModel_OriginOnHead; + if (ClientInterface.GetOrigin(ref origin)) + { + Interop.WVR_GetPoseState(deviceType, origin, 0, ref newPose); + m_Pose[deviceType] = newPose; + } + } + } + + public bool IsTracked(WVR_DeviceType deviceType) + { + return m_Pose[deviceType].IsValidPose; + } + + public Vector3 GetDevicePosition(WVR_DeviceType deviceType) + { + Vector3 position = Vector3.zero; + if (IsTracked(deviceType)) + { + var mat = RigidTransform.toMatrix44(m_Pose[deviceType].PoseMatrix); + position = Coordinate.GetVectorFromGL(mat); + } + return position; + } + + public Quaternion GetDeviceRotation(WVR_DeviceType deviceType) + { + Quaternion rotation = Quaternion.identity; + if (IsTracked(deviceType)) + { + var mat = RigidTransform.toMatrix44(m_Pose[deviceType].PoseMatrix); + rotation = Coordinate.GetQuaternionFromGL(mat); + } + return rotation; + } + + public Vector3 GetDeviceVelocity(WVR_DeviceType deviceType) + { + Vector3 velocity = Vector3.zero; + if (IsTracked(deviceType)) + { + WVR_Vector3f_t vel = m_Pose[deviceType].Velocity; + velocity = Coordinate.GetVectorFromGL(vel); + } + return velocity; + } + + public Vector3 GetDeviceAngularVelocity(WVR_DeviceType deviceType) + { + Vector3 angularVelocity = Vector3.zero; + if (IsTracked(deviceType)) + { + WVR_Vector3f_t angVel = m_Pose[deviceType].AngularVelocity; + angularVelocity = new Vector3(-angVel.v0, -angVel.v1, angVel.v2); + } + return angularVelocity; + } + + public void SendHapticImpulse(WVR_DeviceType deviceType, WVR_InputId id, uint durationMillisec, uint frequency = 1, WVR_Intensity intensity = WVR_Intensity.WVR_Intensity_Normal) + { + Interop.WVR_TriggerVibration(deviceType, id, durationMillisec * 1000, frequency, intensity); + } + #endregion } } diff --git a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_bodytracking.unitypackage b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_bodytracking.unitypackage index b9bdc765..3254cb2d 100644 --- a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_bodytracking.unitypackage +++ b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_bodytracking.unitypackage @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6502476c3cc15f4c2393a214ac95e31d701d9ea68a33ad78729a76200ad4276e -size 18663479 +oid sha256:5d53e728b7a1d6f6e28afbe4791b324b14246ab0ffe22b03c70a9fac07ed7299 +size 18666726 diff --git a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_bundlepreview.unitypackage b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_bundlepreview.unitypackage index 87496e8c..8083b595 100644 --- a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_bundlepreview.unitypackage +++ b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_bundlepreview.unitypackage @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:a2f203aa63b31bea75ccc40f7a70e8f9a8823c7bdf0c2cdef458d2190d150425 -size 12776 +oid sha256:a900712edf807e5e112f48f998dfc399f3d79889d52115acd5c1e3e4e6074cfb +size 12772 diff --git a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_cameratexture.unitypackage b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_cameratexture.unitypackage index fa0f3c85..080582e1 100644 --- a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_cameratexture.unitypackage +++ b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_cameratexture.unitypackage @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6a791b82bef9e70d3a15aa0a27b4e30285e6b791a0899076b4aeb56145e3ec32 -size 4391 +oid sha256:a58d5f59bc6c589ba4e56107f0a15d579ab6953cedf128ef6e7c4c832a088362 +size 5254 diff --git a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_compositorlayer.unitypackage b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_compositorlayer.unitypackage index a072d7d9..4b9921aa 100644 --- a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_compositorlayer.unitypackage +++ b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_compositorlayer.unitypackage @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:09d9fa16fc790d42fa396c1e189255c8bcaca0150137a24404791f17353d06d0 -size 3485471 +oid sha256:025548fc968f5facb6c9afc8c357977051267e68173a4e0c9815e1da76959492 +size 3485441 diff --git a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_controller_model.unitypackage b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_controller_model.unitypackage index 6b9b2bf4..b4d8f5c9 100644 --- a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_controller_model.unitypackage +++ b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_controller_model.unitypackage @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:96f575d7567c0a8d547389eaad962bc7304fed19b5d518ab601087a0de476602 -size 4486619 +oid sha256:433f16e9e6404e256c8ee928b4e7f3ff7338caa797d3210d54e622dfa5793083 +size 4486796 diff --git a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_facialexpressionmaker.unitypackage b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_facialexpressionmaker.unitypackage new file mode 100644 index 00000000..cb912647 --- /dev/null +++ b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_facialexpressionmaker.unitypackage @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c66a99f464949c67afd0ab8ae3afac1354e2b94282a8d3abb4e590c752a26104 +size 62278025 diff --git a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_hand_interaction.unitypackage b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_hand_interaction.unitypackage new file mode 100644 index 00000000..d9d67159 --- /dev/null +++ b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_hand_interaction.unitypackage @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ad228d5a3865916f0d916209b168d23cfe68dd040709e57fe6d2c3eb6cc8af0 +size 1576758 diff --git a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_hand_model.unitypackage b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_hand_model.unitypackage index 7bfae00d..6d50abed 100644 --- a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_hand_model.unitypackage +++ b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_hand_model.unitypackage @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:ae36bf322a9d566f507c45d4aa1aa24b56e2f63e739f3ce3a846f7dae26d31dc -size 1820924 +oid sha256:cf62e0ba253ee5c2bdbf8ed4643ed88186e99c6a8dcf936b87059372c043ebc9 +size 1821291 diff --git a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_inputmodule.unitypackage b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_inputmodule.unitypackage index 34a8533c..27ca30a0 100644 --- a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_inputmodule.unitypackage +++ b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_inputmodule.unitypackage @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:f1fbe62505cd54d6191cdb847ee9c04cd6e2bafafc664d7c20cb5afb780f7e05 -size 2349666 +oid sha256:75308493713a5805cbe849498dc9ecb1177796efb17cf0d050dc8b5390cf10a1 +size 2348919 diff --git a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_interaction_mode.unitypackage b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_interaction_mode.unitypackage index c083016d..ecac0449 100644 --- a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_interaction_mode.unitypackage +++ b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_interaction_mode.unitypackage @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1e3569a38bbcda2d4fae20105cabc0bbc154d23d7e652068f22e6ea6a437b219 -size 60314 +oid sha256:c660ddc60489e6f9abb99c647ce4cf3a0e058a527524ce99d40455ff2f598d96 +size 60344 diff --git a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_interaction_toolkit.unitypackage b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_interaction_toolkit.unitypackage index e059ab01..659d1589 100644 --- a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_interaction_toolkit.unitypackage +++ b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_interaction_toolkit.unitypackage @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b738925fec280391c8b28e5bb328776a5dc3882f4d9d13ab418b5c34bc3bb1bd -size 1474904 +oid sha256:dca77a17865ecff783bd9cfabd0c6bf9cb323c9be8c9734cf710953c8964eff7 +size 1474871 diff --git a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_renderdoc.unitypackage b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_renderdoc.unitypackage index 1a28489b..28ee561e 100644 --- a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_renderdoc.unitypackage +++ b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_renderdoc.unitypackage @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:673a83550a8afc7f5d490345b3df8063a7a4acdba3d40097ec40f11d504a6ad3 -size 7295 +oid sha256:0c752dcc82499a7366dff9239b083daeb5f786454ca4e35096209d16800a1213 +size 7300 diff --git a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_sceneperception.demo.unitypackage b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_sceneperception.demo.unitypackage new file mode 100644 index 00000000..ad119a96 --- /dev/null +++ b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_sceneperception.demo.unitypackage @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fb6f8ebac6a342911cf800fe4434824287736a94fb809074cdc9e252cee5d398 +size 280459 diff --git a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_sceneperception.unitypackage b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_sceneperception.unitypackage index 07accb35..a79a4b50 100644 --- a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_sceneperception.unitypackage +++ b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_sceneperception.unitypackage @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:1735aa57795deeda30a9a339eef4c4c7f9ef8925083961370c7e3fe5d9654fc2 -size 248269 +oid sha256:b1ce0adb527aa1bcfb99a1bf8af35b31f259edaf7c0a0caefe8f1e47f4140365 +size 22869 diff --git a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_spectator.unitypackage b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_spectator.unitypackage index de8b2afb..94b661f5 100644 --- a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_spectator.unitypackage +++ b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_spectator.unitypackage @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:3a7436632a92f62f6efeeb290f37592984165a4ccca9aff8adfa67aee6e00741 -size 176090 +oid sha256:6a75440dcf1ac546760b85875953e0db6f64c4dc584c98c9a1bca7413a0efbf4 +size 176073 diff --git a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_trackablemarker.unitypackage b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_trackablemarker.unitypackage index 581cd5ac..0e85a091 100644 --- a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_trackablemarker.unitypackage +++ b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_trackablemarker.unitypackage @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:b9f1e8a4533cdb13f40d87cf975fd8b017fdb875ced3aa8378ac5227e65115cc -size 36484 +oid sha256:bb1148adcd15c4bda9b085d103b526a5b494568b4f2f08addf90b5ab7da56c85 +size 38480 diff --git a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_tracker_model.unitypackage b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_tracker_model.unitypackage index 2e98e57a..fbcfa656 100644 --- a/com.htc.upm.wave.essence/UnityPackages~/wave_essence_tracker_model.unitypackage +++ b/com.htc.upm.wave.essence/UnityPackages~/wave_essence_tracker_model.unitypackage @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:8e9ac4e4e795ff23593fee81f7d493e8a99f493ff33368909d3940c577a60f2c -size 8619773 +oid sha256:e80410b7169a23893cd1e1627d214a9ac2b6450cf283b118da63e7d7c6e8f703 +size 8620091 diff --git a/com.htc.upm.wave.essence/package.json b/com.htc.upm.wave.essence/package.json index 93735484..7b875a3a 100644 --- a/com.htc.upm.wave.essence/package.json +++ b/com.htc.upm.wave.essence/package.json @@ -1,9 +1,9 @@ { "name": "com.htc.upm.wave.essence", "displayName": "VIVE Wave XR Plugin - Essence", - "version": "5.6.0-r.10.2", + "version": "6.0.0-r.14", "unity": "2019.4", - "description": "The \"VIVE Wave XR Plugin - Essence\" package built on top of the \"VIVE Wave XR Plugin - Native\" package.The package provides rich features that make your developerment easier.\n\nYou can view the documentation for additional information.", + "description": "The \"VIVE Wave XR Plugin - Essence\" package built on top of the \"VIVE Wave XR Plugin - Native\" package.The package provides rich features that make your developerment easier.\n\nYou can view the documentation for additional information.\n\n", "keywords": [ "vr", "xr", @@ -15,8 +15,8 @@ "url": "https://www.htc.com" }, "dependencies": { - "com.htc.upm.wave.xrsdk": "5.6.0-r.10.2", - "com.htc.upm.wave.native": "5.6.0-r.10.2" + "com.htc.upm.wave.xrsdk": "6.0.0-r.14", + "com.htc.upm.wave.native": "6.0.0-r.14" }, "samples": [ { diff --git a/com.htc.upm.wave.essence/package.tm1 b/com.htc.upm.wave.essence/package.tm1 index ac666755..04396cde 100644 --- a/com.htc.upm.wave.essence/package.tm1 +++ b/com.htc.upm.wave.essence/package.tm1 @@ -1,7 +1,7 @@ { "name": "com.htc.upm.wave.essence", "displayName": "VIVE Wave XR Plugin - Essence", - "version": "5.6.0-preview.0", + "version": "6.0.0-preview.0", "unity": "2019.4", "description": "The \u0022VIVE Wave XR Plugin - Essence\u0022 package built on top of the \u0022VIVE Wave XR Plugin - Native\u0022 package.The package provides rich features that make your developerment easier.\n\nYou can view the documentation for additional information.\n\n", "keywords": [ @@ -15,8 +15,8 @@ "url": "https://www.htc.com" }, "dependencies": { - "com.htc.upm.wave.xrsdk": "5.6.0-preview.0", - "com.htc.upm.wave.native": "5.6.0-preview.0" + "com.htc.upm.wave.xrsdk": "6.0.0-preview.0", + "com.htc.upm.wave.native": "6.0.0-preview.0" }, "samples": [ { diff --git a/com.htc.upm.wave.essence/package.tm1.meta b/com.htc.upm.wave.essence/package.tm1.meta index ba28003f..8275d277 100644 --- a/com.htc.upm.wave.essence/package.tm1.meta +++ b/com.htc.upm.wave.essence/package.tm1.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 9388205f34610f0468fe5e4f5d63ac5f +guid: 260500cf219741142b171bb809798b01 DefaultImporter: externalObjects: {} userData: diff --git a/com.htc.upm.wave.native/Runtime/Scripts/WVR_Android.cs b/com.htc.upm.wave.native/Runtime/Scripts/WVR_Android.cs index 9f948d11..8926908b 100644 --- a/com.htc.upm.wave.native/Runtime/Scripts/WVR_Android.cs +++ b/com.htc.upm.wave.native/Runtime/Scripts/WVR_Android.cs @@ -979,6 +979,13 @@ public override WVR_Result GetArucoMarkerData(WVR_Uuid markerId, out WVR_ArucoMa return WVR_GetArucoMarkerData(markerId, out data); } + [DllImportAttribute("wvr_api", EntryPoint = "WVR_ClearTrackableMarkers", CallingConvention = CallingConvention.Cdecl)] + public static extern WVR_Result WVR_ClearTrackableMarkers(); + public override WVR_Result ClearTrackableMarkers() + { + return WVR_ClearTrackableMarkers(); + } + #endregion [DllImportAttribute("wvr_api", EntryPoint = "WVR_GetSupportedFeatures", CallingConvention = CallingConvention.Cdecl)] diff --git a/com.htc.upm.wave.native/Runtime/Scripts/wvr.cs b/com.htc.upm.wave.native/Runtime/Scripts/wvr.cs index 0579d056..41e78cf4 100644 --- a/com.htc.upm.wave.native/Runtime/Scripts/wvr.cs +++ b/com.htc.upm.wave.native/Runtime/Scripts/wvr.cs @@ -105,6 +105,10 @@ public enum WVR_EventType WVR_EventType_TrackerButtonUnpressed = 5001, /**< @ref WVR_InputId status of @ref WVR_TrackerId changed to not pressed */ WVR_EventType_TrackerTouchTapped = 5002, /**< @ref WVR_InputId status of @ref WVR_TrackerId changed to touched. */ WVR_EventType_TrackerTouchUntapped = 5003, /**< @ref WVR_InputId status of @ref WVR_TrackerId changed to untouched. */ + WVR_EventType_TrackerLeftToRightSwipe = 5004, /**< Notification of swipe motion (move Left to Right) on tracker */ + WVR_EventType_TrackerRightToLeftSwipe = 5005, /**< Notification of swipe motion (move Right to Left) on tracker */ + WVR_EventType_TrackerDownToUpSwipe = 5006, /**< Notification of swipe motion (move Down to Up) on tracker */ + WVR_EventType_TrackerUpToDownSwipe = 5007, /**< Notification of swipe motion (move Up to Down) on tracker */ } public enum WVR_PeripheralQuality @@ -2908,9 +2912,11 @@ public static bool WVR_GetBodyTrackingExtrinsics([In, Out] WVR_BodyTrackingExtri return WVR_Base.Instance.GetBodyTrackingExtrinsics(extrinsics, ref count); } - #region Trackable Marker + #endregion Body Tracking - public static WVR_Result WVR_StartMarker() + #region Trackable Marker + + public static WVR_Result WVR_StartMarker() { return WVR_Base.Instance.StartMarker(); } @@ -2985,8 +2991,12 @@ public static WVR_Result WVR_GetArucoMarkerData(WVR_Uuid markerId, out WVR_Aruco return WVR_Base.Instance.GetArucoMarkerData(markerId, out data); } - #endregion - #endregion + public static WVR_Result WVR_ClearTrackableMarkers() + { + return WVR_Base.Instance.ClearTrackableMarkers(); + } + + #endregion Trackable Marker public static ulong WVR_GetSupportedFeatures() { @@ -4297,6 +4307,11 @@ public virtual WVR_Result GetArucoMarkerData(WVR_Uuid markerId, out WVR_ArucoMar return WVR_Result.WVR_Error_FeatureNotSupport; } + public virtual WVR_Result ClearTrackableMarkers() + { + return WVR_Result.WVR_Error_FeatureNotSupport; + } + #endregion #region Body Tracking diff --git a/com.htc.upm.wave.native/package.json b/com.htc.upm.wave.native/package.json index afecfd41..82977b41 100644 --- a/com.htc.upm.wave.native/package.json +++ b/com.htc.upm.wave.native/package.json @@ -1,9 +1,9 @@ { "name": "com.htc.upm.wave.native", "displayName": "VIVE Wave XR Plugin - Native", - "version": "5.6.0-r.10.2", + "version": "6.0.0-r.14", "unity": "2019.4", - "description": "The \"VIVE Wave XR Plugin - Native\" package provides the wraper of WaveVR.\n\nView the documentation for additional information.", + "description": "The \"VIVE Wave XR Plugin - Native\" package provides the wraper of WaveVR.\n\nView the documentation for additional information.\n\n", "keywords": [ "vr", "xr", @@ -15,7 +15,7 @@ "url": "https://www.htc.com" }, "dependencies": { - "com.htc.upm.wave.xrsdk": "5.6.0-r.10.2" + "com.htc.upm.wave.xrsdk": "6.0.0-r.14" }, "samples": [ { diff --git a/com.htc.upm.wave.native/package.tm1 b/com.htc.upm.wave.native/package.tm1 index 729fe5b2..dc741c8c 100644 --- a/com.htc.upm.wave.native/package.tm1 +++ b/com.htc.upm.wave.native/package.tm1 @@ -1,7 +1,7 @@ { "name": "com.htc.upm.wave.native", "displayName": "VIVE Wave XR Plugin - Native", - "version": "5.6.0-preview.0", + "version": "6.0.0-preview.0", "unity": "2019.4", "description": "The \u0022VIVE Wave XR Plugin - Native\u0022 package provides the wraper of WaveVR.\n\nView the documentation for additional information.\n\n", "keywords": [ @@ -15,7 +15,7 @@ "url": "https://www.htc.com" }, "dependencies": { - "com.htc.upm.wave.xrsdk": "5.6.0-preview.0" + "com.htc.upm.wave.xrsdk": "6.0.0-preview.0" }, "samples": [ { diff --git a/com.htc.upm.wave.native/package.tm1.meta b/com.htc.upm.wave.native/package.tm1.meta index 16e15e7a..c713e847 100644 --- a/com.htc.upm.wave.native/package.tm1.meta +++ b/com.htc.upm.wave.native/package.tm1.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 4b077b4002e3c6c49a3ab05faa772fab +guid: 4fa786648226cac4488266e1679874cd DefaultImporter: externalObjects: {} userData: diff --git a/com.htc.upm.wave.xrsdk/Editor/WaveXRBuildCheck.cs b/com.htc.upm.wave.xrsdk/Editor/WaveXRBuildCheck.cs index d1e09bd6..a3a76796 100644 --- a/com.htc.upm.wave.xrsdk/Editor/WaveXRBuildCheck.cs +++ b/com.htc.upm.wave.xrsdk/Editor/WaveXRBuildCheck.cs @@ -40,14 +40,13 @@ static class CustomBuildProcessor const string AndroidManifestScriptCreatedPath = "Assets/Plugins/Android/AndroidManifest.IsCreatedByScript"; const string Aar2017PathDest = "Assets/Plugins/Android/wvr_unity_plugin_2017.aar"; const string Aar2022PathDest = "Assets/Plugins/Android/wvr_unity_plugin_2022.aar"; - const string CustomGradle1Src = "Packages/" + Constants.SDKPackageName + "/Runtime/Android/launcherTemplate.gradle"; - const string CustomGradle2Src = "Packages/" + Constants.SDKPackageName + "/Runtime/Android/mainTemplate.gradle"; - const string CustomGradle1Dest = "Assets/Plugins/Android/launcherTemplate.gradle"; - const string CustomGradle1CreatedPath = "Assets/Plugins/Android/launcherTemplate.IsCreatedByScript"; - const string CustomGradle2Dest = "Assets/Plugins/Android/mainTemplate.gradle"; - const string CustomGradle2CreatedPath = "Assets/Plugins/Android/mainTemplate.IsCreatedByScript"; + const string CustomGradle1Src = "Packages/" + Constants.SDKPackageName + "/Runtime/Android/baseProjectTemplate.gradle"; + const string CustomGradle1Dest = "Assets/Plugins/Android/baseProjectTemplate.gradle"; + const string CustomGradle1CreatedPath = "Assets/Plugins/Android/baseProjectTemplate.IsCreatedByScript"; const string ForceBuildWVR = "ForceBuildWVR.txt"; + private static bool forceUpdateGradleVersion = false; + internal static void AddHandTrackingAndroidManifest() { WaveXRSettings settings; @@ -335,16 +334,6 @@ static void RemoveGradles() if (File.Exists(CustomGradle1Dest + ".meta")) File.Delete(CustomGradle1Dest + ".meta"); } - bool isCustomGradle2CreatedPath = File.Exists(CustomGradle2CreatedPath); - if (isCustomGradle2CreatedPath) - { - File.Delete(CustomGradle2CreatedPath); - File.Delete(CustomGradle2CreatedPath + ".meta"); - if (File.Exists(CustomGradle2Dest)) - File.Delete(CustomGradle2Dest); - if (File.Exists(CustomGradle2Dest + ".meta")) - File.Delete(CustomGradle2Dest + ".meta"); - } #endif } @@ -471,11 +460,6 @@ static void CopyGradles() File.Create(CustomGradle1CreatedPath).Dispose(); File.Copy(CustomGradle1Src, CustomGradle1Dest, false); } - if (!File.Exists(CustomGradle2Dest)) - { - File.Create(CustomGradle2CreatedPath).Dispose(); - File.Copy(CustomGradle2Src, CustomGradle2Dest, false); - } #endif } @@ -924,6 +908,18 @@ public void OnPreprocessBuild(BuildReport report) if (File.Exists(ForceBuildWVR)) { //SetBuildingWave(); +#if !UNITY_2022_2_OR_NEWER + bool skipdialog = EditorPrefs.GetBool("CustomGradleVersionSkip", false); + if (!skipdialog && !File.Exists(CustomGradle1Dest)) + { + EditorWindow tmp = EditorWindow.focusedWindow; + GradleVersionWindow window = (GradleVersionWindow)EditorWindow.GetWindow(typeof(GradleVersionWindow), true, "Custom Gradle Version", false); + forceUpdateGradleVersion = true; + window.Show(); + if (tmp != null) + tmp.Focus(); + } +#endif AddHandTrackingAndroidManifest(); AddTrackerAndroidManifest(); AddEyeTrackingAndroidManifest(); @@ -938,6 +934,18 @@ public void OnPreprocessBuild(BuildReport report) } else if (report.summary.platform == BuildTarget.Android && CheckIsBuildingWave()) { +#if !UNITY_2022_2_OR_NEWER + bool skipdialog = EditorPrefs.GetBool("CustomGradleVersionSkip", false); + if (!skipdialog && !File.Exists(CustomGradle1Dest)) + { + EditorWindow tmp = EditorWindow.focusedWindow; + GradleVersionWindow window = (GradleVersionWindow)EditorWindow.GetWindow(typeof(GradleVersionWindow), true, "Custom Gradle Version", false); + forceUpdateGradleVersion = true; + window.Show(); + if (tmp != null) + tmp.Focus(); + } +#endif CopyAndroidManifest(); CopyGradles(); CopyWaveAARs(); @@ -957,6 +965,59 @@ public void OnPostprocessBuild(BuildReport report) RemoveWaveAARs(); } } + + public class GradleVersionWindow : EditorWindow + { + [MenuItem("Wave/Preference/Custom Gradle Version")] + static void Init() + { + EditorWindow tmp = EditorWindow.focusedWindow; + // Get existing open window or if none, make a new one: + GradleVersionWindow window = (GradleVersionWindow)EditorWindow.GetWindow(typeof(GradleVersionWindow), true, "Custom Gradle Version", false); + window.position = new Rect(Screen.width / 10, Screen.height / 10, 320, 240); + forceUpdateGradleVersion = true; + window.Show(); + if (tmp != null) + tmp.Focus(); + } + + public static void ShowWindow() + { + GetWindow("Custom Gradle Version"); + } + + void OnGUI() + { + { + + GUIStyle style = new GUIStyle(EditorStyles.boldLabel); + style.wordWrap = true; + //style.fontSize = 16; + { + //var origin = GUI.color; + //GUI.color = Color.red; + GUILayout.Label( + "Update Android Gradle Plugin and Gradle Version [2024.April]" + + "\n" + + "\nYou are seeing this message because your Unity development environment may not meet the requirements of Wave SDK." + + "\n" + + "\nPlease update your AGP version to 4.2.0 and use Gradle version 6.9.2, or click the button below to configure your environment.\n", style); + //GUI.color = origin; + } + + if (GUILayout.Button("Configure Unity Environment")) + { + SettingsService.OpenProjectSettings("Project/Wave XR/XRSDK"); + //Application.OpenURL("https://developers.xsolla.com/sdk/unity/application-build-guides/how-to-build-for-android-11/"); + } + + if (GUILayout.Button("Close")) + { + this.Close(); + } + } + } + } } [Obsolete("CheckIfHandTrackingEnabled is deprecated. Please use WaveXRSettings EnableNaturalHand instead", false)] @@ -1305,148 +1366,148 @@ public static bool ValidateEnabled() Menu.SetChecked(CheckIfLipExpressionEnabled.MENU_NAME, enabled_); return true; } - } - /* - [InitializeOnLoad] - public static class MenuAvatarIKHandler - { - internal const string MENU_NAME = "Wave/Body Tracking/Enable Avatar IK"; - - const string LOG_TAG = "Wave.XR.MenuAvatarIKHandler "; - static StringBuilder m_sb = null; - static StringBuilder sb + /* + [InitializeOnLoad] + public static class MenuAvatarIKHandler { - get + internal const string MENU_NAME = "Wave/Body Tracking/Enable Avatar IK"; + + const string LOG_TAG = "Wave.XR.MenuAvatarIKHandler "; + static StringBuilder m_sb = null; + static StringBuilder sb { - if (m_sb == null) { m_sb = new StringBuilder(); } - return m_sb; + get + { + if (m_sb == null) { m_sb = new StringBuilder(); } + return m_sb; + } + } + static void DEBUG(StringBuilder msg) + { + msg.Insert(0, LOG_TAG); + Debug.Log(msg); } - } - static void DEBUG(StringBuilder msg) - { - msg.Insert(0, LOG_TAG); - Debug.Log(msg); - } - - #region Scripting Symbol - const string DEFINE_AVATAR_IK = "WAVE_AVATAR_IK"; - internal struct ScriptingDefinedSettings - { - public string[] scriptingDefinedSymbols; - public BuildTargetGroup[] targetGroups; - public ScriptingDefinedSettings(string[] symbols, BuildTargetGroup[] groups) +#region Scripting Symbol + const string DEFINE_AVATAR_IK = "WAVE_AVATAR_IK"; + internal struct ScriptingDefinedSettings { - scriptingDefinedSymbols = symbols; - targetGroups = groups; + public string[] scriptingDefinedSymbols; + public BuildTargetGroup[] targetGroups; + + public ScriptingDefinedSettings(string[] symbols, BuildTargetGroup[] groups) + { + scriptingDefinedSymbols = symbols; + targetGroups = groups; + } } - } - static readonly ScriptingDefinedSettings m_SettingAvatarIK = new ScriptingDefinedSettings( - new string[] { DEFINE_AVATAR_IK, }, - new BuildTargetGroup[] { BuildTargetGroup.Android, } - ); - static void AddScriptingDefineSymbols(ScriptingDefinedSettings setting) - { - for (int group_index = 0; group_index < setting.targetGroups.Length; group_index++) + static readonly ScriptingDefinedSettings m_SettingAvatarIK = new ScriptingDefinedSettings( + new string[] { DEFINE_AVATAR_IK, }, + new BuildTargetGroup[] { BuildTargetGroup.Android, } + ); + static void AddScriptingDefineSymbols(ScriptingDefinedSettings setting) { - var group = setting.targetGroups[group_index]; - string definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup(group); - List allDefines = definesString.Split(';').ToList(); - for (int symbol_index = 0; symbol_index < setting.scriptingDefinedSymbols.Length; symbol_index++) + for (int group_index = 0; group_index < setting.targetGroups.Length; group_index++) { - if (!allDefines.Contains(setting.scriptingDefinedSymbols[symbol_index])) + var group = setting.targetGroups[group_index]; + string definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup(group); + List allDefines = definesString.Split(';').ToList(); + for (int symbol_index = 0; symbol_index < setting.scriptingDefinedSymbols.Length; symbol_index++) { - sb.Clear(); sb.Append("AddScriptingDefineSymbols() ").Append(setting.scriptingDefinedSymbols[symbol_index]).Append(" to group ").Append(group); - DEBUG(sb); - allDefines.Add(setting.scriptingDefinedSymbols[symbol_index]); - } - else - { - sb.Clear(); sb.Append("AddScriptingDefineSymbols() ").Append(setting.scriptingDefinedSymbols[symbol_index]).Append(" already existed."); - DEBUG(sb); + if (!allDefines.Contains(setting.scriptingDefinedSymbols[symbol_index])) + { + sb.Clear(); sb.Append("AddScriptingDefineSymbols() ").Append(setting.scriptingDefinedSymbols[symbol_index]).Append(" to group ").Append(group); + DEBUG(sb); + allDefines.Add(setting.scriptingDefinedSymbols[symbol_index]); + } + else + { + sb.Clear(); sb.Append("AddScriptingDefineSymbols() ").Append(setting.scriptingDefinedSymbols[symbol_index]).Append(" already existed."); + DEBUG(sb); + } } + PlayerSettings.SetScriptingDefineSymbolsForGroup( + group, + string.Join(";", allDefines.ToArray()) + ); } - PlayerSettings.SetScriptingDefineSymbolsForGroup( - group, - string.Join(";", allDefines.ToArray()) - ); } - } - static void RemoveScriptingDefineSymbols(ScriptingDefinedSettings setting) - { - for (int group_index = 0; group_index < setting.targetGroups.Length; group_index++) + static void RemoveScriptingDefineSymbols(ScriptingDefinedSettings setting) { - var group = setting.targetGroups[group_index]; - string definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup(group); - List allDefines = definesString.Split(';').ToList(); - for (int symbol_index = 0; symbol_index < setting.scriptingDefinedSymbols.Length; symbol_index++) + for (int group_index = 0; group_index < setting.targetGroups.Length; group_index++) { - if (allDefines.Contains(setting.scriptingDefinedSymbols[symbol_index])) - { - sb.Clear(); sb.Append("RemoveScriptingDefineSymbols() ").Append(setting.scriptingDefinedSymbols[symbol_index]).Append(" from group ").Append(group); - DEBUG(sb); - allDefines.Remove(setting.scriptingDefinedSymbols[symbol_index]); - } - else + var group = setting.targetGroups[group_index]; + string definesString = PlayerSettings.GetScriptingDefineSymbolsForGroup(group); + List allDefines = definesString.Split(';').ToList(); + for (int symbol_index = 0; symbol_index < setting.scriptingDefinedSymbols.Length; symbol_index++) { - sb.Clear(); sb.Append("RemoveScriptingDefineSymbols() ").Append(setting.scriptingDefinedSymbols[symbol_index]).Append(" already existed."); - DEBUG(sb); + if (allDefines.Contains(setting.scriptingDefinedSymbols[symbol_index])) + { + sb.Clear(); sb.Append("RemoveScriptingDefineSymbols() ").Append(setting.scriptingDefinedSymbols[symbol_index]).Append(" from group ").Append(group); + DEBUG(sb); + allDefines.Remove(setting.scriptingDefinedSymbols[symbol_index]); + } + else + { + sb.Clear(); sb.Append("RemoveScriptingDefineSymbols() ").Append(setting.scriptingDefinedSymbols[symbol_index]).Append(" already existed."); + DEBUG(sb); + } } + PlayerSettings.SetScriptingDefineSymbolsForGroup( + group, + string.Join(";", allDefines.ToArray()) + ); } - PlayerSettings.SetScriptingDefineSymbolsForGroup( - group, - string.Join(";", allDefines.ToArray()) - ); } - } - #endregion - - private static bool m_Enabled = false; - static MenuAvatarIKHandler() - { - MenuAvatarIKHandler.m_Enabled = EditorPrefs.GetBool(MenuAvatarIKHandler.MENU_NAME, false); +#endregion - /// Delaying until first editor tick so that the menu - /// will be populated before setting check state, and - /// re-apply correct action - EditorApplication.delayCall += () => + private static bool m_Enabled = false; + static MenuAvatarIKHandler() { - PerformAction(MenuAvatarIKHandler.m_Enabled); - }; - } + MenuAvatarIKHandler.m_Enabled = EditorPrefs.GetBool(MenuAvatarIKHandler.MENU_NAME, false); - [MenuItem(MenuAvatarIKHandler.MENU_NAME, priority = 604)] - private static void ToggleAction() - { - /// Toggling action - PerformAction(!MenuAvatarIKHandler.m_Enabled); - } + /// Delaying until first editor tick so that the menu + /// will be populated before setting check state, and + /// re-apply correct action + EditorApplication.delayCall += () => + { + PerformAction(MenuAvatarIKHandler.m_Enabled); + }; + } - private static void PerformAction(bool enabled) - { - /// Set checkmark on menu item - Menu.SetChecked(MenuAvatarIKHandler.MENU_NAME, enabled); - if (enabled) + [MenuItem(MenuAvatarIKHandler.MENU_NAME, priority = 604)] + private static void ToggleAction() { - AddScriptingDefineSymbols(m_SettingAvatarIK); + /// Toggling action + PerformAction(!MenuAvatarIKHandler.m_Enabled); } - else + + private static void PerformAction(bool enabled) { - RemoveScriptingDefineSymbols(m_SettingAvatarIK); - } - /// Saving editor state - EditorPrefs.SetBool(MenuAvatarIKHandler.MENU_NAME, enabled); + /// Set checkmark on menu item + Menu.SetChecked(MenuAvatarIKHandler.MENU_NAME, enabled); + if (enabled) + { + AddScriptingDefineSymbols(m_SettingAvatarIK); + } + else + { + RemoveScriptingDefineSymbols(m_SettingAvatarIK); + } + /// Saving editor state + EditorPrefs.SetBool(MenuAvatarIKHandler.MENU_NAME, enabled); - MenuAvatarIKHandler.m_Enabled = enabled; - } + MenuAvatarIKHandler.m_Enabled = enabled; + } - [MenuItem(MenuAvatarIKHandler.MENU_NAME, validate = true, priority = 604)] - private static bool ValidateEnabled() - { - Menu.SetChecked(MenuAvatarIKHandler.MENU_NAME, m_Enabled); - return true; + [MenuItem(MenuAvatarIKHandler.MENU_NAME, validate = true, priority = 604)] + private static bool ValidateEnabled() + { + Menu.SetChecked(MenuAvatarIKHandler.MENU_NAME, m_Enabled); + return true; + } } + */ } - */ } #endif diff --git a/com.htc.upm.wave.xrsdk/Editor/XRSDKSettingsProvider.cs b/com.htc.upm.wave.xrsdk/Editor/XRSDKSettingsProvider.cs index 6a90af9f..07f68893 100644 --- a/com.htc.upm.wave.xrsdk/Editor/XRSDKSettingsProvider.cs +++ b/com.htc.upm.wave.xrsdk/Editor/XRSDKSettingsProvider.cs @@ -1,4 +1,4 @@ -using System.IO; +using System.IO; using UnityEditor; using UnityEngine; using Wave.XR.Settings; @@ -114,6 +114,45 @@ public override void OnGUI(string searchContext) } GUILayout.EndVertical(); } +#if !UNITY_2022_2_OR_NEWER + { + GUILayout.BeginVertical(EditorStyles.helpBox); + { + GUILayout.Label("Update Android Gradle Plugin and Gradle Version [2024.April]", EditorStyles.boldLabel); + GUILayout.Label("Unity developers using Unity 2022.3 or later can now use the default AGP and gradle settings.", new GUIStyle(EditorStyles.label) { wordWrap = true }); + GUILayout.Space(5f); + GUILayout.Label("Our SDK is built with Java 11 libraries. To avoid errors when building Android APKs, please use our recommended and verified development environment: AGP 4.2.0 and gradle version 6.9.2.", new GUIStyle(EditorStyles.label) { wordWrap = true }); + GUILayout.Space(5f); + GUILayout.Label("How to Update", new GUIStyle(EditorStyles.label) { wordWrap = true }); + GUILayout.Space(5f); + GUILayout.Label("1.Download and extract the gradle 6.9.2 zip file.)", new GUIStyle(EditorStyles.label) { wordWrap = true }); + if (GUILayout.Button("Download URL", GUILayout.ExpandWidth(false))) + Application.OpenURL("https://gradle.org/releases/"); + GUILayout.Space(5f); + GUILayout.Label("2.In Edit > Preferences > External Tools, specify the path to the extracted gradle folder.", new GUIStyle(EditorStyles.label) { wordWrap = true }); + if (GUILayout.Button("Setting in the Preferences", GUILayout.ExpandWidth(false))) + SettingsService.OpenUserPreferences("Preferences/External Tools"); + GUILayout.Space(5f); + GUILayout.Label("3.In Edit > Project Settings > Player > Publishing Settings, check the \"Custom Base Gradle Template\" box. This will generate the Assets > Plugins > Android > baseProjectTemplate.gradle file.", new GUIStyle(EditorStyles.label) { wordWrap = true }); + if (GUILayout.Button("Player Settings", GUILayout.ExpandWidth(false))) + SettingsService.OpenProjectSettings("Project/Player"); + GUILayout.Space(5f); + GUILayout.Label("4.Edit the baseProjectTemplate.gradle file and set \"com.android.tools.build:gradle\" to 4.2.0.", new GUIStyle(EditorStyles.label) { wordWrap = true }); + GUILayout.Space(5f); + bool b = EditorPrefs.GetBool("CustomGradleVersionSkip", false); + if (GUILayout.Toggle(b, "Ignore the warning dialog.")) + { + EditorPrefs.SetBool("CustomGradleVersionSkip", true); + } + else + { + EditorPrefs.SetBool("CustomGradleVersionSkip", false); + } + GUI.enabled = true; + } + GUILayout.EndVertical(); + } +#endif } public static void MoveFolder(string srcpath, string destpath) diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/AndroidManifest.xml b/com.htc.upm.wave.xrsdk/Runtime/Android/AndroidManifest.xml index 6ee1712d..a5059368 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/Android/AndroidManifest.xml +++ b/com.htc.upm.wave.xrsdk/Runtime/Android/AndroidManifest.xml @@ -7,6 +7,7 @@ android:theme="@style/Theme.WaveVR.Black" tools:replace="android:theme"> diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/arm64-v8a/libGfxWXRUnity.so b/com.htc.upm.wave.xrsdk/Runtime/Android/arm64-v8a/libGfxWXRUnity.so index fc194a94..e41a52eb 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/Android/arm64-v8a/libGfxWXRUnity.so +++ b/com.htc.upm.wave.xrsdk/Runtime/Android/arm64-v8a/libGfxWXRUnity.so @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:796f2f90f650c2f1faf4be782ffdec8d46c0e4e0d66befa9c9f7da074244ec8a -size 5896 +oid sha256:bc201cbe7591a7e6b76a50fecff8162940dc33c2f8fa7c658b02c3cb67da3dd0 +size 5208 diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/arm64-v8a/libwvrunityxr.so b/com.htc.upm.wave.xrsdk/Runtime/Android/arm64-v8a/libwvrunityxr.so index 81ca91fe..7b3a208a 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/Android/arm64-v8a/libwvrunityxr.so +++ b/com.htc.upm.wave.xrsdk/Runtime/Android/arm64-v8a/libwvrunityxr.so @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e0d42d4b1d9574dd5cc427347b1b0332143153aaf80daa8b2bea6b012a8eefcd -size 2033768 +oid sha256:504507c5ba0152c6511b04598ad0a4795919acce7778a4a4e17f690b94cbde81 +size 1882760 diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/arm64-v8a/libwvrxrplugin.so b/com.htc.upm.wave.xrsdk/Runtime/Android/arm64-v8a/libwvrxrplugin.so index 6362bf1d..fa68d1bf 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/Android/arm64-v8a/libwvrxrplugin.so +++ b/com.htc.upm.wave.xrsdk/Runtime/Android/arm64-v8a/libwvrxrplugin.so @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:68c37a927965a7da36bcc86ce5741e73e5db1ded3dcc2bfe4ea11c69f9ecdb59 -size 255952 +oid sha256:4f760df43d2775dd41f1c029ad95ca9e805e0baf7811a4fdd996e3b4553bf076 +size 1266824 diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/armeabi-v7a/libVkLayer_GLES_RenderDoc.1.4.so b/com.htc.upm.wave.xrsdk/Runtime/Android/armeabi-v7a/libVkLayer_GLES_RenderDoc.1.4.so deleted file mode 100644 index 9d374e6f..00000000 --- a/com.htc.upm.wave.xrsdk/Runtime/Android/armeabi-v7a/libVkLayer_GLES_RenderDoc.1.4.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:e548add59cdc27066573a9ce467b117b49497dda976a76fc660627a617cac6f0 -size 12511284 diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/armeabi-v7a/libVkLayer_GLES_RenderDoc.1.4.so.meta b/com.htc.upm.wave.xrsdk/Runtime/Android/armeabi-v7a/libVkLayer_GLES_RenderDoc.1.4.so.meta deleted file mode 100644 index fdd7a0ee..00000000 --- a/com.htc.upm.wave.xrsdk/Runtime/Android/armeabi-v7a/libVkLayer_GLES_RenderDoc.1.4.so.meta +++ /dev/null @@ -1,70 +0,0 @@ -fileFormatVersion: 2 -guid: 94242a11fe501054f8bc6894133cd036 -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 1 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - : Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux64: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - - first: - Android: Android - second: - enabled: 0 - settings: - CPU: ARMv7 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - DefaultValueInitialized: true - OS: AnyOS - - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: None - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/armeabi-v7a/libVkLayer_GLES_RenderDoc.so b/com.htc.upm.wave.xrsdk/Runtime/Android/armeabi-v7a/libVkLayer_GLES_RenderDoc.so deleted file mode 100644 index 5da6d959..00000000 --- a/com.htc.upm.wave.xrsdk/Runtime/Android/armeabi-v7a/libVkLayer_GLES_RenderDoc.so +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d6715175b49ade2fbaae5a0634ab8b50d29c3f17efa8e22e2225c78b037912ce -size 15258884 diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/armeabi-v7a/libVkLayer_GLES_RenderDoc.so.meta b/com.htc.upm.wave.xrsdk/Runtime/Android/armeabi-v7a/libVkLayer_GLES_RenderDoc.so.meta deleted file mode 100644 index 2bb4f13e..00000000 --- a/com.htc.upm.wave.xrsdk/Runtime/Android/armeabi-v7a/libVkLayer_GLES_RenderDoc.so.meta +++ /dev/null @@ -1,70 +0,0 @@ -fileFormatVersion: 2 -guid: 1bde871bb933f2142b8dc6f6aa8defed -PluginImporter: - externalObjects: {} - serializedVersion: 2 - iconMap: {} - executionOrder: {} - defineConstraints: [] - isPreloaded: 0 - isOverridable: 1 - isExplicitlyReferenced: 0 - validateReferences: 1 - platformData: - - first: - : Any - second: - enabled: 0 - settings: - Exclude Android: 1 - Exclude Editor: 1 - Exclude Linux64: 1 - Exclude OSXUniversal: 1 - Exclude Win: 1 - Exclude Win64: 1 - - first: - Android: Android - second: - enabled: 0 - settings: - CPU: ARMv7 - - first: - Any: - second: - enabled: 0 - settings: {} - - first: - Editor: Editor - second: - enabled: 0 - settings: - CPU: AnyCPU - DefaultValueInitialized: true - OS: AnyOS - - first: - Standalone: Linux64 - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: OSXUniversal - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win - second: - enabled: 0 - settings: - CPU: None - - first: - Standalone: Win64 - second: - enabled: 0 - settings: - CPU: None - userData: - assetBundleName: - assetBundleVariant: diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/baseProjectTemplate.gradle b/com.htc.upm.wave.xrsdk/Runtime/Android/baseProjectTemplate.gradle new file mode 100644 index 00000000..fc786258 --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Runtime/Android/baseProjectTemplate.gradle @@ -0,0 +1,31 @@ +// GENERATED BY UNITY. REMOVE THIS COMMENT TO PREVENT OVERWRITING WHEN EXPORTING AGAIN + +allprojects { + buildscript { + repositories {**ARTIFACTORYREPOSITORY** + google() + jcenter() + } + + dependencies { + // If you are changing the Android Gradle Plugin version, make sure it is compatible with the Gradle version preinstalled with Unity + // See which Gradle version is preinstalled with Unity here https://docs.unity3d.com/Manual/android-gradle-overview.html + // See official Gradle and Android Gradle Plugin compatibility table here https://developer.android.com/studio/releases/gradle-plugin#updating-gradle + // To specify a custom Gradle version in Unity, go do "Preferences > External Tools", uncheck "Gradle Installed with Unity (recommended)" and specify a path to a custom Gradle version + classpath 'com.android.tools.build:gradle:4.0.1' + **BUILD_SCRIPT_DEPS** + } + } + + repositories {**ARTIFACTORYREPOSITORY** + google() + jcenter() + flatDir { + dirs "${project(':unityLibrary').projectDir}/libs" + } + } +} + +task clean(type: Delete) { + delete rootProject.buildDir +} diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/launcherTemplate.gradle.meta b/com.htc.upm.wave.xrsdk/Runtime/Android/baseProjectTemplate.gradle.meta similarity index 74% rename from com.htc.upm.wave.xrsdk/Runtime/Android/launcherTemplate.gradle.meta rename to com.htc.upm.wave.xrsdk/Runtime/Android/baseProjectTemplate.gradle.meta index 64a889f8..90e9b5cd 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/Android/launcherTemplate.gradle.meta +++ b/com.htc.upm.wave.xrsdk/Runtime/Android/baseProjectTemplate.gradle.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 816739578c4690c4ab36ee91aa6dac69 +guid: 402b34943e7d18a408bceb856df1d15d DefaultImporter: externalObjects: {} userData: diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/launcherTemplate.gradle b/com.htc.upm.wave.xrsdk/Runtime/Android/launcherTemplate.gradle deleted file mode 100644 index a503c42c..00000000 --- a/com.htc.upm.wave.xrsdk/Runtime/Android/launcherTemplate.gradle +++ /dev/null @@ -1,85 +0,0 @@ - -apply plugin: 'com.android.application' - -buildscript { -repositories { - google() - jcenter() - } - dependencies { - // Must be Android Gradle Plugin 3.6.0 or later. For a list of - // compatible Gradle versions refer to: - // https://developer.android.com/studio/releases/gradle-plugin - classpath 'com.android.tools.build:gradle:4.0.1' - } -} - -allprojects { - repositories { - google() - jcenter() - flatDir { - dirs 'libs' - } - } -} - -dependencies { - implementation project(':unityLibrary') - } - -android { - compileSdkVersion **APIVERSION** - buildToolsVersion '**BUILDTOOLS**' - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion **MINSDKVERSION** - targetSdkVersion **TARGETSDKVERSION** - applicationId '**APPLICATIONID**' - ndk { - abiFilters **ABIFILTERS** - } - versionCode **VERSIONCODE** - versionName '**VERSIONNAME**' - } - - aaptOptions { - noCompress = ['.unity3d', '.ress', '.resource', '.obb'**STREAMING_ASSETS**] - ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~" - }**SIGN** - - lintOptions { - abortOnError false - } - - buildTypes { - debug { - minifyEnabled **MINIFY_DEBUG** - useProguard **PROGUARD_DEBUG** - proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG** - jniDebuggable true - } - release { - minifyEnabled **MINIFY_RELEASE** - useProguard **PROGUARD_RELEASE** - proguardFiles getDefaultProguardFile('proguard-android.txt')**SIGNCONFIG** - } - }**PACKAGING_OPTIONS****PLAY_ASSET_PACKS****SPLITS** -**BUILT_APK_LOCATION** - bundle { - language { - enableSplit = false - } - density { - enableSplit = false - } - abi { - enableSplit = true - } - } -}**SPLITS_VERSION_CODE****LAUNCHER_SOURCE_BUILD_SETUP** diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/mainTemplate.gradle b/com.htc.upm.wave.xrsdk/Runtime/Android/mainTemplate.gradle deleted file mode 100644 index 8826d3be..00000000 --- a/com.htc.upm.wave.xrsdk/Runtime/Android/mainTemplate.gradle +++ /dev/null @@ -1,60 +0,0 @@ - -apply plugin: 'com.android.library' -**APPLY_PLUGINS** - -buildscript { -repositories { - google() - jcenter() - } - dependencies { - // Must be Android Gradle Plugin 3.6.0 or later. For a list of - // compatible Gradle versions refer to: - // https://developer.android.com/studio/releases/gradle-plugin - classpath 'com.android.tools.build:gradle:4.0.1' - } -} - -allprojects { - repositories { - google() - jcenter() - flatDir { - dirs 'libs' - } - } -} - -dependencies { - implementation fileTree(dir: 'libs', include: ['*.jar']) -**DEPS**} - -android { - compileSdkVersion **APIVERSION** - buildToolsVersion '**BUILDTOOLS**' - - compileOptions { - sourceCompatibility JavaVersion.VERSION_1_8 - targetCompatibility JavaVersion.VERSION_1_8 - } - - defaultConfig { - minSdkVersion **MINSDKVERSION** - targetSdkVersion **TARGETSDKVERSION** - ndk { - abiFilters **ABIFILTERS** - } - versionCode **VERSIONCODE** - versionName '**VERSIONNAME**' - consumerProguardFiles 'proguard-unity.txt'**USER_PROGUARD** - } - - lintOptions { - abortOnError false - } - - aaptOptions { - ignoreAssetsPattern = "!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~" - }**PACKAGING_OPTIONS** -}**REPOSITORIES****SOURCE_BUILD_SETUP** -**EXTERNAL_SOURCES** diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/vr.client.abi.aar b/com.htc.upm.wave.xrsdk/Runtime/Android/vr.client.abi.aar index 65b19ad8..bc4ede43 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/Android/vr.client.abi.aar +++ b/com.htc.upm.wave.xrsdk/Runtime/Android/vr.client.abi.aar @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:19cb6b9e92230a34a312f4d4709db948235bfc54335fb9d58e3366188b3518bc -size 3659 +oid sha256:c956f064afeaf9229e6f35b4ef6373a1252ec7ecc857623ed45776c1b5646466 +size 3667 diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/wvr.common.utils.aar b/com.htc.upm.wave.xrsdk/Runtime/Android/wvr.common.utils.aar index 8c5a4550..bfd785c0 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/Android/wvr.common.utils.aar +++ b/com.htc.upm.wave.xrsdk/Runtime/Android/wvr.common.utils.aar @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6bcf8f13f7e45e3421db194cabb6c6260091d893c3466d037db4b92dfcc29e79 -size 147731 +oid sha256:2b111ad908371c129039f350f009d9b3848a528f367bd3a63d635a2faca7c4be +size 148615 diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/wvr_client.aar b/com.htc.upm.wave.xrsdk/Runtime/Android/wvr_client.aar index dd3e4583..5b958ee8 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/Android/wvr_client.aar +++ b/com.htc.upm.wave.xrsdk/Runtime/Android/wvr_client.aar @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:25be6692f5d1b4d6befac2d4342301d35e71ae8d74f431fe82a0a14776c5213e -size 10920620 +oid sha256:3550c67037e043f4bf5c19c0ae7fb76d8b70a7e9c14b08d055a519c7ea45cd38 +size 10218583 diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/wvr_ime_client.aar b/com.htc.upm.wave.xrsdk/Runtime/Android/wvr_ime_client.aar index 236b1480..d51e659a 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/Android/wvr_ime_client.aar +++ b/com.htc.upm.wave.xrsdk/Runtime/Android/wvr_ime_client.aar @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:0cabf72798b91ca1c44efa2d61d326b570a90a2329f9031212a1922eaf851622 -size 51221 +oid sha256:71a8b57af6b5e88cea9e959c49b55dc36e3a94e5f3fed077c393dec95f880165 +size 50872 diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/wvr_permission_client.aar b/com.htc.upm.wave.xrsdk/Runtime/Android/wvr_permission_client.aar index 24dfb217..769fe7e2 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/Android/wvr_permission_client.aar +++ b/com.htc.upm.wave.xrsdk/Runtime/Android/wvr_permission_client.aar @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:e70da9dc79fa474c7269df3061c3583e9bd52911f31019528121bca6f6893c3c -size 122533 +oid sha256:c330f8e7f9321f6ca5f72315bc311ea7ecbdea99b61ca2520371bbb6369261b7 +size 122404 diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/wvr_unity_plugin_2017.aar b/com.htc.upm.wave.xrsdk/Runtime/Android/wvr_unity_plugin_2017.aar index ce481e65..d867bd78 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/Android/wvr_unity_plugin_2017.aar +++ b/com.htc.upm.wave.xrsdk/Runtime/Android/wvr_unity_plugin_2017.aar @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:7269df7717eb44ca192c5a7f8b654e9ee41c314f217a8b8f4486e2d5dda1b2c7 -size 139195 +oid sha256:926c6216810095f270780bbacb15ebb63fbe257b3cd9d2836e06f594c340b03b +size 232426 diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/wvr_unity_plugin_2022.aar b/com.htc.upm.wave.xrsdk/Runtime/Android/wvr_unity_plugin_2022.aar index 36f7eedd..7b7be598 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/Android/wvr_unity_plugin_2022.aar +++ b/com.htc.upm.wave.xrsdk/Runtime/Android/wvr_unity_plugin_2022.aar @@ -1,3 +1,3 @@ version https://git-lfs.github.com/spec/v1 -oid sha256:6fed27b993dc153dfa3ac3c8c327913bbaa978fe8f6d21a499dc9e270c71e318 -size 139193 +oid sha256:be2966b7b6655dffa63d903bdd09dd56430c9eb0eb51471e61bf59cb82af9e69 +size 232425 diff --git a/com.htc.upm.wave.xrsdk/Runtime/DirectPreview/Editor/CheckDirectPreviewOptions.cs b/com.htc.upm.wave.xrsdk/Runtime/DirectPreview/Editor/CheckDirectPreviewOptions.cs index c957848a..f102a2d8 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/DirectPreview/Editor/CheckDirectPreviewOptions.cs +++ b/com.htc.upm.wave.xrsdk/Runtime/DirectPreview/Editor/CheckDirectPreviewOptions.cs @@ -296,11 +296,12 @@ void OnGUI() //} ShowButtons(); - - EditorGUILayout.LabelField("List Direct Preview supported features as below:"); + EditorGUILayout.LabelField("Notice:", EditorStyles.boldLabel); + EditorGUILayout.LabelField("After using Direct Preview, please remember to stop streaming server, otherwise VIVE Business Streaming will not function properly.", new GUIStyle(EditorStyles.label) { wordWrap = true }); + EditorGUILayout.LabelField("List Direct Preview supported features as below:", EditorStyles.boldLabel); EditorGUILayout.LabelField("1. Controller Model."); EditorGUILayout.LabelField("2. Hand Tracking. (without hand scale and hand pinch)"); - EditorGUILayout.LabelField("List Direct Preview not supported features as below:"); + EditorGUILayout.LabelField("List Direct Preview not supported features as below:", EditorStyles.boldLabel); EditorGUILayout.LabelField("1. Hand Gesture."); EditorGUILayout.LabelField("2. Passthrough."); EditorGUILayout.LabelField("3. Compositor Layer."); @@ -418,4 +419,4 @@ private static void OptToggleAction() //} } } -#endif \ No newline at end of file +#endif diff --git a/com.htc.upm.wave.xrsdk/Runtime/GitIgnored/Resources.meta b/com.htc.upm.wave.xrsdk/Runtime/GitIgnored/Resources.meta index dc67aeda..0a44367f 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/GitIgnored/Resources.meta +++ b/com.htc.upm.wave.xrsdk/Runtime/GitIgnored/Resources.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 8d78870c4cc8c7c49951c75e4bb71395 +guid: 11b35edb4337be148812faddf68f843f folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/com.htc.upm.wave.xrsdk/Runtime/GitIgnored/Resources/commit_info.json b/com.htc.upm.wave.xrsdk/Runtime/GitIgnored/Resources/commit_info.json index 899357b1..9d54a96f 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/GitIgnored/Resources/commit_info.json +++ b/com.htc.upm.wave.xrsdk/Runtime/GitIgnored/Resources/commit_info.json @@ -1,9 +1,9 @@ { - "commit": "99e1117706883d3cc49e6a0c731df33ecd3cae32", + "commit": "aa915f3a73fc6d11ab5c401149596d1e04bfe7e8", - "abbreviated_commit": "99e111770", + "abbreviated_commit": "aa915f3a7", "refs": "HEAD -> master, origin/master, origin/HEAD" diff --git a/com.htc.upm.wave.xrsdk/Runtime/GitIgnored/Resources/commit_info.json.meta b/com.htc.upm.wave.xrsdk/Runtime/GitIgnored/Resources/commit_info.json.meta index bf0bd08f..0ad84285 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/GitIgnored/Resources/commit_info.json.meta +++ b/com.htc.upm.wave.xrsdk/Runtime/GitIgnored/Resources/commit_info.json.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 0160c10819e8e8d4ebcd05c70419e95c +guid: d2c8daf9a31a031499d0a0912d19d286 TextScriptImporter: externalObjects: {} userData: diff --git a/com.htc.upm.wave.xrsdk/Runtime/ViveWaveController.cs b/com.htc.upm.wave.xrsdk/Runtime/ViveWaveController.cs index 78b50a69..f04adfaa 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/ViveWaveController.cs +++ b/com.htc.upm.wave.xrsdk/Runtime/ViveWaveController.cs @@ -80,6 +80,40 @@ private static void InitializeInPlayer() .WithProduct(kProductFocus3Right)); } + #region Aliases + /** + * To get these variable's name, check InputDevice.description.capabilities. + * In capabilities, inputFeatures record each feature's name and commonusages. + * e.g. + * XRDeviceDescriptor descriptor = XRDeviceDescriptor.FromJson(InputDevice.description.capabilities); + * descriptor.inputFeatures.name and inputFeatures.inputFeatures.usageHints + * Debug.Log(descriptor.inputFeatures.name, inputFeatures.inputFeatures.usageHints) + * name => Left Controller Primary2DAxis (Touchpad Axis) + * usageHints.content => Primary2DAxis + * The alias name is LeftControllerPrimary2DAxisTouchpadAxis and commonusages is Primary2DAxis. + **/ + const string kControllerR = "RightController", kControllerL = "LeftController"; + const string kPrimary2DAxis = "Primary2DAxisTouchpadAxis"; + const string kPrimary2DAxisClick = "Primary2DAxisClickTouchpad"; + const string kPrimary2DAxisTouch = "Primary2DAxisTouchTouchpadTouch"; + const string kTriggerButton = "TriggerButton"; + const string kTrigger = "TriggerTriggerAxis"; + const string kGripButton = "GripButton"; + const string kGrip = "Grip"; + const string kMenuButton = "MenuButton"; + const string kPrimaryButton = "PrimaryButton"; + const string kPrimaryTouch = "PrimaryTouch"; + const string kSecondaryButton = "SecondaryButton"; + const string kSecondaryTouch = "SecondaryTouch"; + const string kIsTracked = "IsTracked"; + const string kTrackingState = "TrackingState"; + const string kDevicePosition = "Position"; + const string kDeviceRotation = "Rotation"; + const string kDeviceVelocity = "Velocity"; + const string kDeviceAngularVelocity = "AngularVelocity"; + const string kBatteryLevel = "BatteryPercentage"; + #endregion + /** * If the public variable's name is NOT a system variable's name, the variable will be added as an XR binding path. * @@ -99,71 +133,69 @@ private static void InitializeInPlayer() **/ /// Represents the thumbstick axis in Vector2 where x {-1, 1} is positive at right side and y {-1, 1} is positive at top side. - [Preserve, InputControl(aliases = new[] { "RightControllerPrimary2DAxisTouchpadAxis", "LeftControllerPrimary2DAxisTouchpadAxis" }, usage = "Primary2DAxis")] + [Preserve, InputControl(aliases = new[] { kControllerR + kPrimary2DAxis, kControllerL + kPrimary2DAxis })] public Vector2Control thumbstick { get; private set; } - /// - /// Represents the Thumbstick key is pressed. Binding path: - /// - /// Left controller: <XRController>{LeftHand}/{primary2DAxisClick} - /// - /// Right controller: <XRController>{RightHand}/{primary2DAxisClick} - /// - [Preserve, InputControl(usage = "Primary2DAxisClick")] + /// Represents the Thumbstick key is pressed. + [Preserve, InputControl(aliases = new[] { kControllerR + kPrimary2DAxisClick, kControllerL + kPrimary2DAxisClick })] public ButtonControl thumbstickClicked { get; private set; } - /// - /// Represents the Thumbstick key is touched. - /// - /// Left controller: <XRController>{LeftHand}/{primary2DAxisTouch} - /// - /// Right controller: <XRController>{RightHand}/{primary2DAxisTouch} - /// - [Preserve, InputControl(usage = "Primary2DAxisTouch")] + /// Represents the Thumbstick key is touched. + [Preserve, InputControl(aliases = new[] { kControllerR + kPrimary2DAxisTouch, kControllerL + kPrimary2DAxisTouch })] public ButtonControl thumbstickTouched { get; private set; } /// Represents the Trigger key is pressed. Note the "triggerTouched" is NOT supported in Unity XR Input. - [Preserve, InputControl(aliases = new[] { "RightControllerTriggerButton", "LeftControllerTriggerButton" }, usage = "TriggerButton")] + [Preserve, InputControl(aliases = new[] { kControllerR + kTriggerButton, kControllerL + kTriggerButton })] public ButtonControl triggerPressed { get; private set; } /// Represents the trigger axis in float {0, 1} where 1 means the Trigger key is fully pressed. - [Preserve, InputControl(aliases = new[] { "RightControllerTriggerTriggerAxis", "LeftControllerTriggerTriggerAxis" }, usage = "Trigger")] + [Preserve, InputControl(aliases = new[] { kControllerR + kTrigger, kControllerL + kTrigger })] public AxisControl trigger { get; private set; } /// Represents the Grip key is pressed. Note the "gripTouched" is NOT supported in Unity XR Input. - [Preserve, InputControl(aliases = new[] { "RightControllerGripButton", "LeftControllerGripButton" }, usage = "GripButton")] + [Preserve, InputControl(aliases = new[] { kControllerR + kGripButton, kControllerL + kGripButton })] public ButtonControl gripPressed { get; private set; } /// Represents the grip axis in float {0, 1} where 1 means the Grip key is fully pressed. - [Preserve, InputControl(aliases = new[] { "RightControllerGrip", "LeftControllerGrip" }, usage = "Grip")] + [Preserve, InputControl(aliases = new[] { kControllerR + kGrip, kControllerL + kGrip })] public AxisControl grip { get; private set; } /// Represents the Left Menu key is pressed. Note only left controller has a menu key. - [Preserve, InputControl(aliases = new[] { "LeftControllerMenuButton" }, usage = "MenuButton")] + [Preserve, InputControl(aliases = new[] { kControllerL + kMenuButton })] public ButtonControl menu { get; private set; } /// Represents the A key in right controller or X key in left controller is pressed. - [Preserve, InputControl(aliases = new[] { "RightControllerPrimaryButton", "LeftControllerPrimaryButton" }, usage = "PrimaryButton")] + [Preserve, InputControl(aliases = new[] { kControllerR + kPrimaryButton, kControllerL + kPrimaryButton })] public ButtonControl primaryButton { get; private set; } /// Represents the A key in right controller or X key in left controller is touched. - [Preserve, InputControl(aliases = new[] { "RightControllerPrimaryTouch", "LeftControllerPrimaryTouch" }, usage = "PrimaryTouch")] + [Preserve, InputControl(aliases = new[] { kControllerR + kPrimaryTouch, kControllerL + kPrimaryTouch })] public ButtonControl primaryTouched { get; private set; } /// Represents the B key in right controller or Y key in left controller is pressed. - [Preserve, InputControl(aliases = new[] { "RightControllerSecondaryButton", "LeftControllerSecondaryButton" }, usage = "SecondaryButton")] + [Preserve, InputControl(aliases = new[] { kControllerR + kSecondaryButton, kControllerL + kSecondaryButton })] public ButtonControl secondaryButton { get; private set; } /// Represents the B key in right controller or Y key in left controller is touched. - [Preserve, InputControl(aliases = new[] { "RightControllerSecondaryTouch", "LeftControllerSecondaryTouch" }, usage = "SecondaryTouch")] + [Preserve, InputControl(aliases = new[] { kControllerR + kSecondaryTouch, kControllerL + kSecondaryTouch })] public ButtonControl secondaryTouched { get; private set; } /// Checks if the left/right controller is tracked. - [Preserve, InputControl(aliases = new[] { "RightControllerIsTracked", "LeftControllerIsTracked" }, usage = "IsTracked")] + [Preserve, InputControl(aliases = new[] { kControllerR + kIsTracked, kControllerL + kIsTracked })] new public ButtonControl isTracked { get; private set; } /// Represents the tracking state in InputTrackingState of left/right controller. - [Preserve, InputControl(aliases = new[] { "RightControllerTrackingState", "LeftControllerTrackingState" }, usage = "TrackingState")] + [Preserve, InputControl(aliases = new[] { kControllerR + kTrackingState, kControllerL + kTrackingState })] new public IntegerControl trackingState { get; private set; } /// Represents the position in Vector3 of left/right controller. - [Preserve, InputControl(aliases = new[] { "RightControllerPosition", "LeftControllerPosition" }, usage = "DevicePosition")] + [Preserve, InputControl(aliases = new[] { kControllerR + kDevicePosition, kControllerL + kDevicePosition })] new public Vector3Control devicePosition { get; private set; } /// Represents the rotation in Quaternion of left/right controller. - [Preserve, InputControl(aliases = new[] { "RightControllerRotation", "LeftControllerRotation" }, usage = "DeviceRotation")] + [Preserve, InputControl(aliases = new[] { kControllerR + kDeviceRotation, kControllerL + kDeviceRotation })] new public QuaternionControl deviceRotation { get; private set; } + /// Represents the velocity in Vector3 of left/right controller. + [Preserve, InputControl(aliases = new[] { kControllerR + kDeviceVelocity, kControllerL + kDeviceVelocity })] + public Vector3Control deviceVelocity { get; private set; } + /// Represents the angular velocity in Vector3 of left/right controller. + [Preserve, InputControl(aliases = new[] { kControllerR + kDeviceAngularVelocity, kControllerL + kDeviceAngularVelocity })] + public Vector3Control deviceAngularVelocity { get; private set; } + + /// Represents the batter percentage in float {0, 1} where 1 means fully charged. + [Preserve, InputControl(aliases = new[] { "Right" + kBatteryLevel, "Left" + kBatteryLevel })] + public AxisControl batteryLevel { get; private set; } /// /// Internal call used to assign controls to the the correct element. @@ -195,6 +227,9 @@ protected override void FinishSetup() trackingState = GetChildControl("trackingState"); devicePosition = GetChildControl("devicePosition"); deviceRotation = GetChildControl("deviceRotation"); + deviceVelocity = GetChildControl("deviceVelocity"); + deviceAngularVelocity = GetChildControl("deviceAngularVelocity"); + batteryLevel = GetChildControl("batteryLevel"); } } } diff --git a/com.htc.upm.wave.xrsdk/Runtime/ViveWaveHMD.cs b/com.htc.upm.wave.xrsdk/Runtime/ViveWaveHMD.cs index 9a333eb1..969050c7 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/ViveWaveHMD.cs +++ b/com.htc.upm.wave.xrsdk/Runtime/ViveWaveHMD.cs @@ -73,28 +73,64 @@ private static void InitializeInPlayer() .WithProduct(@kProducts)); } - [Preserve, InputControl(alias = "HMDTrackingState")] + #region Alias + /** + * To get these variable's name, check InputDevice.description.capabilities. + * In capabilities, inputFeatures record each feature's name and commonusages. + * e.g. + * XRDeviceDescriptor descriptor = XRDeviceDescriptor.FromJson(InputDevice.description.capabilities); + * descriptor.inputFeatures.name and inputFeatures.inputFeatures.usageHints + * Debug.Log(descriptor.inputFeatures.name, inputFeatures.inputFeatures.usageHints) + * name => Left Controller Primary2DAxis (Touchpad Axis) + * usageHints.content => Primary2DAxis + * The alias name is LeftControllerPrimary2DAxisTouchpadAxis and commonusages is Primary2DAxis. + **/ + const string kDevice = "HMD"; + const string kTrackingState = "TrackingState"; + const string kIsTracked = "IsTracked"; + const string kDevicePosition = "Position"; + const string kDeviceRotation = "Rotation"; + const string kDeviceVelocity = "Velocity"; + const string kDeviceAngularVelocity = "AngularVelocity"; + const string kCenterEyePosition = "CenterEyePosition"; + const string kCenterEyeRotation = "CenterEyeRotation"; + const string kBatteryLevel = "BatteryPercentage"; + const string kUserPresence = "UserPresence"; + #endregion + + [Preserve, InputControl(alias = kDevice + kTrackingState)] public new IntegerControl trackingState { get; private set; } - [Preserve, InputControl(alias = "HMDIsTracked")] + [Preserve, InputControl(alias = kDevice + kIsTracked)] public new ButtonControl isTracked { get; private set; } - [Preserve, InputControl(alias = "HMDPosition")] + [Preserve, InputControl(alias = kDevice + kDevicePosition)] public new Vector3Control devicePosition { get; private set; } - [Preserve, InputControl(alias = "HMDRotation")] + [Preserve, InputControl(alias = kDevice + kDeviceRotation)] public new QuaternionControl deviceRotation { get; private set; } - [Preserve, InputControl(alias = "HMDCenterEyePosition")] + [Preserve, InputControl(alias = kDevice + kDeviceVelocity)] + public Vector3Control deviceVelocity { get; private set; } + + [Preserve, InputControl(alias = kDevice + kDeviceAngularVelocity)] + public Vector3Control deviceAngularVelocity { get; private set; } + + [Preserve, InputControl(alias = kDevice + kCenterEyePosition)] public new Vector3Control centerEyePosition { get; private set; } - [Preserve, InputControl(alias = "HMDCenterEyeRotation")] + [Preserve, InputControl(alias = kDevice + kCenterEyeRotation)] public new QuaternionControl centerEyeRotation { get; private set; } - /// - /// Internal call used to assign controls to the the correct element. - /// - protected override void FinishSetup() + [Preserve, InputControl(alias = kDevice + kBatteryLevel)] + public AxisControl batteryLevel { get; private set; } + + [Preserve, InputControl(alias = kUserPresence)] + public ButtonControl userPresence { get; private set; } + /// + /// Internal call used to assign controls to the the correct element. + /// + protected override void FinishSetup() { sb.Clear().Append("FinishSetup() description deviceClass: ").Append(description.deviceClass) .Append(", interfaceName: ").Append(description.interfaceName) @@ -110,9 +146,13 @@ protected override void FinishSetup() isTracked = GetChildControl("isTracked"); devicePosition = GetChildControl("devicePosition"); deviceRotation = GetChildControl("deviceRotation"); - centerEyePosition = GetChildControl("centerEyePosition"); + deviceVelocity = GetChildControl("deviceVelocity"); + deviceAngularVelocity = GetChildControl("deviceAngularVelocity"); + centerEyePosition = GetChildControl("centerEyePosition"); centerEyeRotation = GetChildControl("centerEyeRotation"); - } - } + batteryLevel = GetChildControl("batteryLevel"); + userPresence = GetChildControl("userPresence"); + } + } } #endif \ No newline at end of file diff --git a/com.htc.upm.wave.xrsdk/Runtime/ViveWaveSelfTracker.cs b/com.htc.upm.wave.xrsdk/Runtime/ViveWaveSelfTracker.cs new file mode 100644 index 00000000..4a36aa13 --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Runtime/ViveWaveSelfTracker.cs @@ -0,0 +1,227 @@ +// "WaveVR SDK +// © 2020 HTC Corporation. All Rights Reserved. +// +// Unless otherwise required by copyright law and practice, +// upon the execution of HTC SDK license agreement, +// HTC grants you access to and use of the WaveVR SDK(s). +// You shall fully comply with all of HTC’s SDK license agreement terms and +// conditions signed by you and all SDK and API requirements, +// specifications, and documentation provided by HTC to You." + +using System.Linq; +using UnityEngine; +using Wave.OpenXR; + +#if UNITY_EDITOR +using UnityEditor; +#endif + +#if ENABLE_INPUT_SYSTEM +using UnityEngine.InputSystem; +using UnityEngine.InputSystem.XR; +using UnityEngine.InputSystem.Layouts; +using UnityEngine.InputSystem.Controls; +using UnityEngine.InputSystem.LowLevel; +using UnityEngine.InputSystem.Utilities; +using System.Text; + +using PoseState = UnityEngine.InputSystem.XR.PoseState; + +namespace Wave.XR +{ + public struct ViveWaveSelfTrackerState : IInputStateTypeInfo + { + // You must tag every state with a FourCC code for type + // checking. The characters can be anything. Choose something that allows + // you to easily recognize memory that belongs to your own Device. + public FourCC format => new FourCC('W', 'A', 'V', 'E'); + + [InputControl(name = "pose", layout = "Pose", format = "Pose", offset = 0, displayName = "Pose")] + public PoseState pose; + } + +#if UNITY_EDITOR + [InitializeOnLoad] +#endif + [InputControlLayout(displayName = "Vive Self Tracker (Wave)", commonUsages = new[] { "Tracker 0", "Tracker 1", "Tracker 2", "Tracker 3", "Tracker 4" }, stateType = typeof(ViveWaveSelfTrackerState), isGenericTypeOfDevice = true)] + public class ViveWaveSelfTracker : InputDevice, IInputUpdateCallbackReceiver + { + const string LOG_TAG = "Wave.XR.ViveWaveSelfTracker "; + private static StringBuilder m_sb = null; + private static StringBuilder sb { + get { + if (m_sb == null) { m_sb = new StringBuilder(); } + return m_sb; + } + } + static void DEBUG(StringBuilder msg) { Debug.Log(msg); } + uint logFrame = 0; + static bool printIntervalLog = false; + + const string kInterfaceName = "Self Tracker"; + const string kProductUltimateTracker0 = "VIVE Ultimate Tracker 0"; + const string kProductUltimateTracker1 = "VIVE Ultimate Tracker 1"; + const string kProductUltimateTracker2 = "VIVE Ultimate Tracker 2"; + const string kProductUltimateTracker3 = "VIVE Ultimate Tracker 3"; + const string kProductUltimateTracker4 = "VIVE Ultimate Tracker 4"; + private InputDeviceTracker.TrackerId m_TrackerId { + get { + // Self Tracker index starts from 2 though 0 & 1 are reserved for Wrist Tracker. + if (description.product.Equals(kProductUltimateTracker0)) { return InputDeviceTracker.TrackerId.Tracker2; } + if (description.product.Equals(kProductUltimateTracker1)) { return InputDeviceTracker.TrackerId.Tracker3; } + if (description.product.Equals(kProductUltimateTracker2)) { return InputDeviceTracker.TrackerId.Tracker4; } + if (description.product.Equals(kProductUltimateTracker3)) { return InputDeviceTracker.TrackerId.Tracker5; } + if (description.product.Equals(kProductUltimateTracker4)) { return InputDeviceTracker.TrackerId.Tracker6; } + + return InputDeviceTracker.TrackerId.Tracker0; + } + } + + const string kUltimateTrackerSN0 = "VIVE_Ultimate_Tracker_0"; + const string kUltimateTrackerSN1 = "VIVE_Ultimate_Tracker_1"; + const string kUltimateTrackerSN2 = "VIVE_Ultimate_Tracker_2"; + const string kUltimateTrackerSN3 = "VIVE_Ultimate_Tracker_3"; + const string kUltimateTrackerSN4 = "VIVE_Ultimate_Tracker_4"; + + const string kTrackerUsage0 = "Tracker 0"; + const string kTrackerUsage1 = "Tracker 1"; + const string kTrackerUsage2 = "Tracker 2"; + const string kTrackerUsage3 = "Tracker 3"; + const string kTrackerUsage4 = "Tracker 4"; + private string m_TrackerUsage { + get { + if (description.product.Equals(kProductUltimateTracker0)) { return kTrackerUsage0; } + if (description.product.Equals(kProductUltimateTracker1)) { return kTrackerUsage1; } + if (description.product.Equals(kProductUltimateTracker2)) { return kTrackerUsage2; } + if (description.product.Equals(kProductUltimateTracker3)) { return kTrackerUsage3; } + if (description.product.Equals(kProductUltimateTracker4)) { return kTrackerUsage4; } + + return ""; + } + } + +#if UNITY_EDITOR + static ViveWaveSelfTracker() + { + Initialize(); + } +#endif + + [RuntimeInitializeOnLoadMethod] + public static void Initialize() + { + sb.Clear().Append(LOG_TAG).Append("Initialize() RegisterLayout with interface ").Append(kInterfaceName); + DEBUG(sb); + InputSystem.RegisterLayout( + typeof(ViveWaveSelfTracker), + matches: new InputDeviceMatcher() + .WithInterface(kInterfaceName) + ); + + var device = InputSystem.devices.FirstOrDefault(x => x is ViveWaveSelfTracker); + while (device != null) + { + sb.Clear().Append(LOG_TAG).Append("Initialize() Removes a ViveWaveSelfTracker device."); DEBUG(sb); + InputSystem.RemoveDevice(device); + device = InputSystem.devices.FirstOrDefault(x => x is ViveWaveSelfTracker); + } + + sb.Clear().Append(LOG_TAG).Append("Initialize() Adds ViveWaveSelfTracker device ").Append(kProductUltimateTracker0); + DEBUG(sb); + InputSystem.AddDevice( + new InputDeviceDescription { interfaceName = kInterfaceName, product = kProductUltimateTracker0, serial = kUltimateTrackerSN0 } + ); + sb.Clear().Append(LOG_TAG).Append("Initialize() Adds ViveWaveSelfTracker device ").Append(kProductUltimateTracker1); + DEBUG(sb); + InputSystem.AddDevice( + new InputDeviceDescription { interfaceName = kInterfaceName, product = kProductUltimateTracker1, serial = kUltimateTrackerSN1 } + ); + sb.Clear().Append(LOG_TAG).Append("Initialize() Adds ViveWaveSelfTracker device ").Append(kProductUltimateTracker2); + DEBUG(sb); + InputSystem.AddDevice( + new InputDeviceDescription { interfaceName = kInterfaceName, product = kProductUltimateTracker2, serial = kUltimateTrackerSN2 } + ); + sb.Clear().Append(LOG_TAG).Append("Initialize() Adds ViveWaveSelfTracker device ").Append(kProductUltimateTracker3); + DEBUG(sb); + InputSystem.AddDevice( + new InputDeviceDescription { interfaceName = kInterfaceName, product = kProductUltimateTracker3, serial = kUltimateTrackerSN3 } + ); + sb.Clear().Append(LOG_TAG).Append("Initialize() Adds ViveWaveSelfTracker device ").Append(kProductUltimateTracker4); + DEBUG(sb); + InputSystem.AddDevice( + new InputDeviceDescription { interfaceName = kInterfaceName, product = kProductUltimateTracker4, serial = kUltimateTrackerSN4 } + ); + } + + [InputControl] + public PoseControl pose { get; private set; } + + protected override void FinishSetup() + { + base.FinishSetup(); + + pose = GetChildControl("pose"); + + InputSystem.SetDeviceUsage(this, m_TrackerUsage); + + sb.Clear().Append(LOG_TAG).Append("FinishSetup() deviceId: ").Append(deviceId) + .Append(", Usage: ").Append(m_TrackerUsage) + .Append(", interfaceName: ").Append(description.interfaceName) + .Append(", product: ").Append(description.product) + .Append(", serial: ").Append(description.serial); + DEBUG(sb); + } + + public void OnUpdate() + { + if (Application.isEditor || !Application.isPlaying) { return; } + + logFrame++; + logFrame %= 300; + printIntervalLog = (logFrame == 0); + + if (!InputDeviceTracker.IsAvailable()) + { + if (printIntervalLog) { sb.Clear().Append(LOG_TAG).Append("OnUpdate() No tracker connected."); DEBUG(sb); } + return; + } + + ViveWaveSelfTrackerState state = new ViveWaveSelfTrackerState(); + + state.pose.isTracked = InputDeviceTracker.IsTracked(m_TrackerId); + if (InputDeviceTracker.GetPosition(m_TrackerId, out Vector3 pos)) + { + state.pose.trackingState |= UnityEngine.XR.InputTrackingState.Position; + state.pose.position = pos; + } + if (InputDeviceTracker.GetRotation(m_TrackerId, out Quaternion rot)) + { + state.pose.trackingState |= UnityEngine.XR.InputTrackingState.Rotation; + state.pose.rotation = rot; + } + if (InputDeviceTracker.GetVelocity(m_TrackerId, out Vector3 vel)) + { + state.pose.trackingState |= UnityEngine.XR.InputTrackingState.Velocity; + state.pose.velocity = vel; + } + if (InputDeviceTracker.GetAngularVelocity(m_TrackerId, out Vector3 angularVel)) + { + state.pose.trackingState |= UnityEngine.XR.InputTrackingState.AngularVelocity; + state.pose.angularVelocity = angularVel; + } + + if (printIntervalLog) + { + sb.Clear().Append(LOG_TAG).Append("OnUpdate() ").Append(m_TrackerId) + .Append(", product: ").Append(description.product) + .Append(", isTracked: ").Append(state.pose.isTracked) + .Append(", trackingState: ").Append(state.pose.trackingState) + .Append(", position (").Append(pos.x).Append(", ").Append(pos.y).Append(", ").Append(pos.z).Append(")"); + DEBUG(sb); + } + + InputSystem.QueueStateEvent(this, state); + } + } +} +#endif \ No newline at end of file diff --git a/com.htc.upm.wave.xrsdk/Runtime/ViveWaveSelfTracker.cs.meta b/com.htc.upm.wave.xrsdk/Runtime/ViveWaveSelfTracker.cs.meta new file mode 100644 index 00000000..c6f9f187 --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Runtime/ViveWaveSelfTracker.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 9279cfd896ed42b4c8747500be7b08c3 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.htc.upm.wave.xrsdk/Runtime/ViveWaveWristTracker.cs b/com.htc.upm.wave.xrsdk/Runtime/ViveWaveWristTracker.cs index 8d703dfa..c5a2ee0f 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/ViveWaveWristTracker.cs +++ b/com.htc.upm.wave.xrsdk/Runtime/ViveWaveWristTracker.cs @@ -56,11 +56,7 @@ private static StringBuilder sb { return m_sb; } } - static void DEBUG(StringBuilder msg) - { - msg.Insert(0, LOG_TAG); - Debug.Log(msg); - } + static void DEBUG(StringBuilder msg) { Debug.Log(msg); } uint logFrame = 0; static bool printIntervalLog = false; @@ -83,7 +79,7 @@ static ViveWaveWristTracker() [RuntimeInitializeOnLoadMethod] public static void Initialize() { - sb.Clear(); sb.Append("Initialize() RegisterLayout with interface ").Append(kInterfaceName); + sb.Clear().Append(LOG_TAG).Append("Initialize() RegisterLayout with interface ").Append(kInterfaceName); DEBUG(sb); InputSystem.RegisterLayout( typeof(ViveWaveWristTracker), @@ -94,17 +90,17 @@ public static void Initialize() var device = InputSystem.devices.FirstOrDefault(x => x is ViveWaveWristTracker); while (device != null) { - sb.Clear().Append("Initialize() Removes a ViveWaveWristTracker device."); DEBUG(sb); + sb.Clear().Append(LOG_TAG).Append("Initialize() Removes a ViveWaveWristTracker device."); DEBUG(sb); InputSystem.RemoveDevice(device); device = InputSystem.devices.FirstOrDefault(x => x is ViveWaveWristTracker); } - sb.Clear(); sb.Append("Initialize() Adds right ViveWaveWristTracker device ").Append(kProductNameRight); + sb.Clear().Append(LOG_TAG).Append("Initialize() Adds right ViveWaveWristTracker device ").Append(kProductNameRight); DEBUG(sb); InputSystem.AddDevice( new InputDeviceDescription { interfaceName = kInterfaceName, product = kProductNameRight, serial = kSerialNumberRight } ); - sb.Clear(); sb.Append("Initialize() Adds left ViveWaveWristTracker device ").Append(kProductNameLeft); + sb.Clear().Append(LOG_TAG).Append("Initialize() Adds left ViveWaveWristTracker device ").Append(kProductNameLeft); DEBUG(sb); InputSystem.AddDevice( new InputDeviceDescription { interfaceName = kInterfaceName, product = kProductNameLeft, serial = kSerialNumberLeft } @@ -128,8 +124,7 @@ protected override void FinishSetup() InputSystem.SetDeviceUsage(this, (IsLeft ? CommonUsages.LeftHand : CommonUsages.RightHand)); - sb.Clear(); - sb.Append("FinishSetup() deviceId: ").Append(deviceId) + sb.Clear().Append(LOG_TAG).Append("FinishSetup() deviceId: ").Append(deviceId) .Append(", IsLeft: ").Append(IsLeft) .Append(", interfaceName: ").Append(description.interfaceName) .Append(", product: ").Append(description.product) @@ -147,7 +142,7 @@ public void OnUpdate() if (!InputDeviceTracker.IsAvailable()) { - //if (printIntervalLog) { sb.Clear(); sb.Append("OnUpdate() No tracker connected."); DEBUG(sb); } + //if (printIntervalLog) { sb.Clear().Append(LOG_TAG).Append("OnUpdate() No tracker connected."); DEBUG(sb); } return; } @@ -188,7 +183,7 @@ public void OnUpdate() if (printIntervalLog) { - sb.Clear(); sb.Append("OnUpdate() ").Append(m_TrackerId) + sb.Clear().Append(LOG_TAG).Append("OnUpdate() ").Append(m_TrackerId) .Append(", product: ").Append(description.product) .Append(", isTracked: ").Append(state.pose.isTracked) .Append(", trackingState: ").Append(state.pose.trackingState) diff --git a/com.htc.upm.wave.xrsdk/Runtime/WaveXREye.cs b/com.htc.upm.wave.xrsdk/Runtime/WaveXREye.cs index 55aaf639..cd769bb2 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/WaveXREye.cs +++ b/com.htc.upm.wave.xrsdk/Runtime/WaveXREye.cs @@ -261,14 +261,37 @@ private static bool IsEyeTrackingDeviceConnected(InputDevice input) return false; } - internal static List s_InputDevices = new List(); + + internal static object inputDeviceLock = new object(); + internal static List inputDevices = new List(); + internal static List s_InputDevices { + get { + lock (inputDeviceLock) + { + return inputDevices; + } + } + } + internal static int inputDeviceFrame = -1; + private static void UpdateInputDevices() + { + if (inputDeviceFrame != Time.frameCount) + { + inputDeviceFrame = Time.frameCount; + lock (inputDeviceLock) + { + InputDevices.GetDevices(inputDevices); + } + } + } + /// /// Checks if a Wave Eye Tracking device is connected. /// /// True for connected. public static bool IsEyeTrackingDeviceConnected() { - InputDevices.GetDevices(s_InputDevices); + UpdateInputDevices(); for (int i = 0; i < s_InputDevices.Count; i++) { if (IsEyeTrackingDeviceConnected(s_InputDevices[i])) @@ -292,7 +315,7 @@ private static bool IsEyeTrackingTracked(InputDevice input) /// True for tracked. public static bool IsEyeTrackingTracked() { - InputDevices.GetDevices(s_InputDevices); + UpdateInputDevices(); for (int i = 0; i < s_InputDevices.Count; i++) { if (IsEyeTrackingTracked(s_InputDevices[i])) @@ -337,7 +360,7 @@ static void UpdateEyeTrackingData() m_EyeTrackingFrame = Time.frameCount; m_EyesValid = false; - InputDevices.GetDevices(s_InputDevices); + UpdateInputDevices(); for (int i = 0; i < s_InputDevices.Count; i++) { if (IsEyeTrackingTracked(s_InputDevices[i])) diff --git a/com.htc.upm.wave.xrsdk/Runtime/WaveXRSettings.cs b/com.htc.upm.wave.xrsdk/Runtime/WaveXRSettings.cs index a40ba18b..3985040f 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/WaveXRSettings.cs +++ b/com.htc.upm.wave.xrsdk/Runtime/WaveXRSettings.cs @@ -28,7 +28,8 @@ public enum FoveationMode { Disable, Enable, - Default + Default, + Dynamic } public enum FoveatedRenderingPeripheralQuality diff --git a/com.htc.upm.wave.xrsdk/Runtime/WaveXRTracker.cs b/com.htc.upm.wave.xrsdk/Runtime/WaveXRTracker.cs index 27476bb2..003d2b94 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/WaveXRTracker.cs +++ b/com.htc.upm.wave.xrsdk/Runtime/WaveXRTracker.cs @@ -115,15 +115,18 @@ public static void ActivateTracker(bool active) const string kTracker15Role = "TrackerRole15"; /// Standalone Tracker Characteristics + [Obsolete("This variable is deprecated.")] public const InputDeviceCharacteristics kAloneTrackerCharacteristics = ( InputDeviceCharacteristics.TrackedDevice ); /// Right Tracker Characteristics + [Obsolete("This variable is deprecated.")] public const InputDeviceCharacteristics kRightTrackerCharacteristics = ( InputDeviceCharacteristics.TrackedDevice | InputDeviceCharacteristics.Right ); /// Left Tracker Characteristics + [Obsolete("This variable is deprecated.")] public const InputDeviceCharacteristics kLeftTrackerCharacteristics = ( InputDeviceCharacteristics.TrackedDevice | InputDeviceCharacteristics.Left @@ -373,6 +376,12 @@ public static bool IsTracked(TrackerId trackerId) } return false; } + /// + /// Retrieves the InputTrackingState of a tracker's pose. + /// + /// A tracker's ID in TrackerId. + /// A tracker pose's state in InputTrackingState. + /// True for the state is valid. public static bool GetTrackingState(TrackerId trackerId, out InputTrackingState state) { state = InputTrackingState.None; @@ -418,6 +427,12 @@ public static bool GetRotation(TrackerId trackerId, out Quaternion rotation) return false; } + /// + /// Retrieves a tracker's velocity in Vector3. + /// + /// A tracker's ID in TrackerId. + /// A tracker pose's velocity in Vector3. + /// >True for the velocity is valid. public static bool GetVelocity(TrackerId trackerId, out Vector3 velocity) { velocity = Vector3.zero; @@ -433,6 +448,12 @@ public static bool GetVelocity(TrackerId trackerId, out Vector3 velocity) return false; } + /// + /// Retrieves a tracker's angular velocity in Vector3. + /// + /// A tracker's ID in TrackerId. + /// A tracker pose's angular velocity in Vector3. + /// >True for the angular velocity is valid. public static bool GetAngularVelocity(TrackerId trackerId, out Vector3 angularVelocity) { angularVelocity = Vector3.zero; @@ -448,6 +469,12 @@ public static bool GetAngularVelocity(TrackerId trackerId, out Vector3 angularVe return false; } + /// + /// Retrieves a tracker's acceleration in Vector3. + /// + /// A tracker's ID in TrackerId. + /// A tracker pose's acceleration in Vector3. + /// >True for the acceleration is valid. public static bool GetAcceleration(TrackerId trackerId, out Vector3 acceleration) { acceleration = Vector3.zero; @@ -463,6 +490,12 @@ public static bool GetAcceleration(TrackerId trackerId, out Vector3 acceleration return false; } + /// + /// Retrieves a tracker's angular acceleration in Vector3. + /// + /// A tracker's ID in TrackerId. + /// A tracker pose's angular acceleration in Vector3. + /// >True for the angular acceleration is valid. public static bool GetAngularAcceleration(TrackerId trackerId, out Vector3 angularAcceleration) { angularAcceleration = Vector3.zero; @@ -504,23 +537,6 @@ public static TrackerRole GetRole(TrackerId trackerId) return s_TrackerRoles[i]; } - /*for (int i = 0; i < s_InputDevices.Count; i++) - { - if (!s_InputDevices[i].isValid) { continue; } - - if (!IsTrackerDevice(s_InputDevices[i], trackerId)) { continue; } - - if (s_InputDevices[i].characteristics.Equals(kLeftTrackerCharacteristics)) - return TrackerRole.Pair1_Left; - - if (s_InputDevices[i].characteristics.Equals(kRightTrackerCharacteristics)) - return TrackerRole.Pair1_Right; - - if (s_InputDevices[i].characteristics.Equals(kAloneTrackerCharacteristics)) - return TrackerRole.Standalone; - }*/ - - return TrackerRole.Undefined; } @@ -599,6 +615,14 @@ public static bool HapticPulse(TrackerId trackerId, UInt32 durationMicroSec = 50 return false; } + /// + /// Retrieves a tracker's device name. + ///
For Wrist Tracker: the device name will be "Vive_Tracker_Wrist" or "Vive_Wrist_Tracker".
+ ///
For Ultimate Tracker: the device name will be "Vive_Tracker_OT", "Vive_Self_Tracker" or "Vive_Ultimate_Tracker".
+ ///
+ /// + /// + /// public static bool GetTrackerDeviceName(TrackerId trackerId, out string trackerName) { if (GetTrackerDevice(trackerId, out InputDevice device)) diff --git a/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Materials/Grid.mat b/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Materials/Grid.mat new file mode 100644 index 00000000..73739f8c --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Materials/Grid.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Grid + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 44e6f81becd466748bf276b19479c850, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Materials/Grid.mat.meta b/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Materials/Grid.mat.meta new file mode 100644 index 00000000..d6dbf130 --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Materials/Grid.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9f62375e9a26deb45babd9a20416285f +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Materials/GridDark.mat b/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Materials/GridDark.mat new file mode 100644 index 00000000..739ce1da --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Materials/GridDark.mat @@ -0,0 +1,77 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: GridDark + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 2800000, guid: 6f7720b62e9c0384d86c9c2e72ae35ab, type: 3} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 1, g: 1, b: 1, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} diff --git a/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Materials/GridDark.mat.meta b/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Materials/GridDark.mat.meta new file mode 100644 index 00000000..f3678418 --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Materials/GridDark.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 184e27545c7f0ea47a7a8fd8bf063ee4 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Textures/Grid.png b/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Textures/Grid.png new file mode 100644 index 00000000..7a11b26e --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Textures/Grid.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:aab0c83e7f91bae414cecfee0ab8b6420e88eb24cdb0f992c2338f4a47355fae +size 6325 diff --git a/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Textures/Grid.png.meta b/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Textures/Grid.png.meta new file mode 100644 index 00000000..5b93a4e1 --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Textures/Grid.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: 44e6f81becd466748bf276b19479c850 +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Textures/GridDark.png b/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Textures/GridDark.png new file mode 100644 index 00000000..0ac702e0 --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Textures/GridDark.png @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8ff78d60cb3309047e5caa9bb5572aceaa9546f8554bbb1ba4c261398a9d4df2 +size 7370 diff --git a/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Textures/GridDark.png.meta b/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Textures/GridDark.png.meta new file mode 100644 index 00000000..ec1ef984 --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/Common/Textures/GridDark.png.meta @@ -0,0 +1,92 @@ +fileFormatVersion: 2 +guid: 6f7720b62e9c0384d86c9c2e72ae35ab +TextureImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 11 + mipmaps: + mipMapMode: 0 + enableMipMap: 1 + sRGBTexture: 1 + linearTexture: 0 + fadeOut: 0 + borderMipMap: 0 + mipMapsPreserveCoverage: 0 + alphaTestReferenceValue: 0.5 + mipMapFadeDistanceStart: 1 + mipMapFadeDistanceEnd: 3 + bumpmap: + convertToNormalMap: 0 + externalNormalMap: 0 + heightScale: 0.25 + normalMapFilter: 0 + isReadable: 0 + streamingMipmaps: 0 + streamingMipmapsPriority: 0 + grayScaleToAlpha: 0 + generateCubemap: 6 + cubemapConvolution: 0 + seamlessCubemap: 0 + textureFormat: 1 + maxTextureSize: 2048 + textureSettings: + serializedVersion: 2 + filterMode: 1 + aniso: 1 + mipBias: 0 + wrapU: 0 + wrapV: 0 + wrapW: 0 + nPOTScale: 1 + lightmap: 0 + compressionQuality: 50 + spriteMode: 0 + spriteExtrude: 1 + spriteMeshType: 1 + alignment: 0 + spritePivot: {x: 0.5, y: 0.5} + spritePixelsToUnits: 100 + spriteBorder: {x: 0, y: 0, z: 0, w: 0} + spriteGenerateFallbackPhysicsShape: 1 + alphaUsage: 1 + alphaIsTransparency: 0 + spriteTessellationDetail: -1 + textureType: 0 + textureShape: 1 + singleChannelComponent: 0 + maxTextureSizeSet: 0 + compressionQualitySet: 0 + textureFormatSet: 0 + applyGammaDecoding: 0 + platformSettings: + - serializedVersion: 3 + buildTarget: DefaultTexturePlatform + maxTextureSize: 2048 + resizeAlgorithm: 0 + textureFormat: -1 + textureCompression: 1 + compressionQuality: 50 + crunchedCompression: 0 + allowsAlphaSplitting: 0 + overridden: 0 + androidETC2FallbackOverride: 0 + forceMaximumCompressionQuality_BC6H_BC7: 0 + spriteSheet: + serializedVersion: 2 + sprites: [] + outline: [] + physicsShape: [] + bones: [] + spriteID: + internalID: 0 + vertices: [] + indices: + edges: [] + weights: [] + secondaryTextures: [] + spritePackingTag: + pSDRemoveMatte: 0 + pSDShowRemoveMatteOption: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/VRTestApp/Editor/BuildVRTestApp.cs b/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/VRTestApp/Editor/BuildVRTestApp.cs index 137adf23..38a721b2 100644 --- a/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/VRTestApp/Editor/BuildVRTestApp.cs +++ b/com.htc.upm.wave.xrsdk/Samples~/PureUnity/PureUnity/VRTestApp/Editor/BuildVRTestApp.cs @@ -472,7 +472,7 @@ static void CheckerBuildForDevelopment() UpdateDefineSymbols(); } - [MenuItem("Wave/Build VRTestApp/Build 32+64bit", priority = 520)] + //[MenuItem("Wave/Build VRTestApp/Build 32+64bit", priority = 520)] static void BuildApk() { CustomizedCommandLine(); @@ -480,7 +480,7 @@ static void BuildApk() BuildApk(_destinationPath, false, false, true, true, true); } - [MenuItem("Wave/Build VRTestApp/Build 32bit", priority = 520)] + //[MenuItem("Wave/Build VRTestApp/Build 32bit", priority = 520)] static void BuildApk32() { CustomizedCommandLine(); @@ -494,13 +494,13 @@ static void BuildApk64() BuildApk(_destinationPath, false, false, true, false, true); } - [MenuItem("Wave/Build VRTestApp/Build+Run 32+64bit", priority = 520)] + //[MenuItem("Wave/Build VRTestApp/Build+Run 32+64bit", priority = 520)] static void BuildAndRunApk() { BuildApk(null, true, false, true, true, true); } - [MenuItem("Wave/Build VRTestApp/Build+Run 32bit", priority = 520)] + //[MenuItem("Wave/Build VRTestApp/Build+Run 32bit", priority = 520)] static void BuildAndRunApk32() { BuildApk("armv7", true, false); @@ -512,13 +512,13 @@ static void BuildAndRunApk64() BuildApk(null, true, false, true, false, true); } - [MenuItem("Wave/Build VRTestApp/Build+Dev+Run 32+64bit", priority = 520)] + //[MenuItem("Wave/Build VRTestApp/Build+Dev+Run 32+64bit", priority = 520)] static void BuildDevAndRunApk() { BuildApk(null, true, true, true, true, true); } - [MenuItem("Wave/Build VRTestApp/Build+Dev+Run 32bit", priority = 520)] + //[MenuItem("Wave/Build VRTestApp/Build+Dev+Run 32bit", priority = 520)] static void BuildDevAndRunApk32() { BuildApk("armv7", true, true); diff --git a/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/ControllerSample.unity b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/ControllerSample.unity index d3ec7375..cb540926 100644 --- a/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/ControllerSample.unity +++ b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/ControllerSample.unity @@ -791,6 +791,91 @@ MonoBehaviour: m_ChildControlHeight: 1 m_ChildScaleWidth: 0 m_ChildScaleHeight: 0 +--- !u!1001 &483644310 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1114047385} + m_Modifications: + - target: {fileID: 1237333012750206754, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_Name + value: SelfTracker + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333013369043021, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_text + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 1237333013424393175, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_text + value: 3 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: ee5a4e543f12cc141a7bf5f481ba1c91, type: 3} +--- !u!4 &483644311 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + m_PrefabInstance: {fileID: 483644310} + m_PrefabAsset: {fileID: 0} --- !u!1 &573203266 GameObject: m_ObjectHideFlags: 0 @@ -1689,6 +1774,113 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 743603317} m_CullTransparentMesh: 0 +--- !u!1 &754699635 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 754699636} + - component: {fileID: 754699637} + m_Layer: 0 + m_Name: Tracker2 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &754699636 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 754699635} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1517820627} + m_Father: {fileID: 1485770886} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &754699637 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 754699635} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c2fadf230d1919748a9aa21d40f74619, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackingType: 0 + m_UpdateType: 0 + m_PositionInput: + m_UseReference: 1 + m_Action: + m_Name: Position Input + m_Type: 0 + m_ExpectedControlType: + m_Id: a18cf091-51e4-4025-a91f-43a4603ab611 + m_Processors: + m_Interactions: + m_SingletonActionBindings: + - m_Name: + m_Id: b0b06674-9877-4fde-b469-9ef31f088c5a + m_Path: + m_Interactions: + m_Processors: + m_Groups: + m_Action: Position Input + m_Flags: 0 + m_Flags: 0 + m_Reference: {fileID: 4045744151237874501, guid: e0ca4504471ca124088e1e2cfe6804ae, + type: 3} + m_RotationInput: + m_UseReference: 1 + m_Action: + m_Name: Rotation Input + m_Type: 0 + m_ExpectedControlType: + m_Id: cf98474c-51f3-492c-95bf-0eb7c5657f89 + m_Processors: + m_Interactions: + m_SingletonActionBindings: + - m_Name: + m_Id: 24fb0469-d55f-44b0-8519-9a50f28c655a + m_Path: + m_Interactions: + m_Processors: + m_Groups: + m_Action: Rotation Input + m_Flags: 0 + m_Flags: 0 + m_Reference: {fileID: -3052646752440918481, guid: e0ca4504471ca124088e1e2cfe6804ae, + type: 3} + m_PositionAction: + m_Name: + m_Type: 0 + m_ExpectedControlType: + m_Id: + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_RotationAction: + m_Name: + m_Type: 0 + m_ExpectedControlType: + m_Id: + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_HasMigratedActions: 1 --- !u!1 &755097714 GameObject: m_ObjectHideFlags: 0 @@ -1967,6 +2159,198 @@ MonoBehaviour: m_ChildControlHeight: 1 m_ChildScaleWidth: 0 m_ChildScaleHeight: 0 +--- !u!1 &889181418 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 889181419} + - component: {fileID: 889181420} + m_Layer: 0 + m_Name: Tracker1 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &889181419 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 889181418} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 906544026} + m_Father: {fileID: 1485770886} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &889181420 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 889181418} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c2fadf230d1919748a9aa21d40f74619, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackingType: 0 + m_UpdateType: 0 + m_PositionInput: + m_UseReference: 1 + m_Action: + m_Name: Position Input + m_Type: 0 + m_ExpectedControlType: + m_Id: a18cf091-51e4-4025-a91f-43a4603ab611 + m_Processors: + m_Interactions: + m_SingletonActionBindings: + - m_Name: + m_Id: b0b06674-9877-4fde-b469-9ef31f088c5a + m_Path: + m_Interactions: + m_Processors: + m_Groups: + m_Action: Position Input + m_Flags: 0 + m_Flags: 0 + m_Reference: {fileID: -9061963437337479372, guid: e0ca4504471ca124088e1e2cfe6804ae, + type: 3} + m_RotationInput: + m_UseReference: 1 + m_Action: + m_Name: Rotation Input + m_Type: 0 + m_ExpectedControlType: + m_Id: cf98474c-51f3-492c-95bf-0eb7c5657f89 + m_Processors: + m_Interactions: + m_SingletonActionBindings: + - m_Name: + m_Id: 24fb0469-d55f-44b0-8519-9a50f28c655a + m_Path: + m_Interactions: + m_Processors: + m_Groups: + m_Action: Rotation Input + m_Flags: 0 + m_Flags: 0 + m_Reference: {fileID: 2340709450342299440, guid: e0ca4504471ca124088e1e2cfe6804ae, + type: 3} + m_PositionAction: + m_Name: + m_Type: 0 + m_ExpectedControlType: + m_Id: + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_RotationAction: + m_Name: + m_Type: 0 + m_ExpectedControlType: + m_Id: + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_HasMigratedActions: 1 +--- !u!1001 &906544025 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 889181419} + m_Modifications: + - target: {fileID: 1237333012750206754, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_Name + value: SelfTracker + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333013369043021, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_text + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1237333013424393175, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_text + value: 1 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: ee5a4e543f12cc141a7bf5f481ba1c91, type: 3} +--- !u!4 &906544026 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + m_PrefabInstance: {fileID: 906544025} + m_PrefabAsset: {fileID: 0} --- !u!1 &958681476 GameObject: m_ObjectHideFlags: 0 @@ -2381,6 +2765,7 @@ Transform: - {fileID: 725964751} - {fileID: 6169362949236706765} - {fileID: 1454962056} + - {fileID: 1485770886} m_Father: {fileID: 0} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -2588,6 +2973,305 @@ MeshFilter: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1105825499} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!1 &1114047384 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1114047385} + - component: {fileID: 1114047386} + m_Layer: 0 + m_Name: Tracker3 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1114047385 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1114047384} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 483644311} + m_Father: {fileID: 1485770886} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1114047386 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1114047384} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c2fadf230d1919748a9aa21d40f74619, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackingType: 0 + m_UpdateType: 0 + m_PositionInput: + m_UseReference: 1 + m_Action: + m_Name: Position Input + m_Type: 0 + m_ExpectedControlType: + m_Id: a18cf091-51e4-4025-a91f-43a4603ab611 + m_Processors: + m_Interactions: + m_SingletonActionBindings: + - m_Name: + m_Id: b0b06674-9877-4fde-b469-9ef31f088c5a + m_Path: + m_Interactions: + m_Processors: + m_Groups: + m_Action: Position Input + m_Flags: 0 + m_Flags: 0 + m_Reference: {fileID: -128592538447671893, guid: e0ca4504471ca124088e1e2cfe6804ae, + type: 3} + m_RotationInput: + m_UseReference: 1 + m_Action: + m_Name: Rotation Input + m_Type: 0 + m_ExpectedControlType: + m_Id: cf98474c-51f3-492c-95bf-0eb7c5657f89 + m_Processors: + m_Interactions: + m_SingletonActionBindings: + - m_Name: + m_Id: 24fb0469-d55f-44b0-8519-9a50f28c655a + m_Path: + m_Interactions: + m_Processors: + m_Groups: + m_Action: Rotation Input + m_Flags: 0 + m_Flags: 0 + m_Reference: {fileID: 1614044736392021824, guid: e0ca4504471ca124088e1e2cfe6804ae, + type: 3} + m_PositionAction: + m_Name: + m_Type: 0 + m_ExpectedControlType: + m_Id: + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_RotationAction: + m_Name: + m_Type: 0 + m_ExpectedControlType: + m_Id: + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_HasMigratedActions: 1 +--- !u!1 &1135959060 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1135959061} + - component: {fileID: 1135959062} + m_Layer: 0 + m_Name: Tracker4 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1135959061 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1135959060} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1201458883} + m_Father: {fileID: 1485770886} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1135959062 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1135959060} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c2fadf230d1919748a9aa21d40f74619, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackingType: 0 + m_UpdateType: 0 + m_PositionInput: + m_UseReference: 1 + m_Action: + m_Name: Position Input + m_Type: 0 + m_ExpectedControlType: + m_Id: a18cf091-51e4-4025-a91f-43a4603ab611 + m_Processors: + m_Interactions: + m_SingletonActionBindings: + - m_Name: + m_Id: b0b06674-9877-4fde-b469-9ef31f088c5a + m_Path: + m_Interactions: + m_Processors: + m_Groups: + m_Action: Position Input + m_Flags: 0 + m_Flags: 0 + m_Reference: {fileID: -8457607507149997133, guid: e0ca4504471ca124088e1e2cfe6804ae, + type: 3} + m_RotationInput: + m_UseReference: 1 + m_Action: + m_Name: Rotation Input + m_Type: 0 + m_ExpectedControlType: + m_Id: cf98474c-51f3-492c-95bf-0eb7c5657f89 + m_Processors: + m_Interactions: + m_SingletonActionBindings: + - m_Name: + m_Id: 24fb0469-d55f-44b0-8519-9a50f28c655a + m_Path: + m_Interactions: + m_Processors: + m_Groups: + m_Action: Rotation Input + m_Flags: 0 + m_Flags: 0 + m_Reference: {fileID: -6494086721135250869, guid: e0ca4504471ca124088e1e2cfe6804ae, + type: 3} + m_PositionAction: + m_Name: + m_Type: 0 + m_ExpectedControlType: + m_Id: + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_RotationAction: + m_Name: + m_Type: 0 + m_ExpectedControlType: + m_Id: + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_HasMigratedActions: 1 +--- !u!1001 &1201458882 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1135959061} + m_Modifications: + - target: {fileID: 1237333012750206754, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_Name + value: SelfTracker + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333013369043021, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_text + value: 4 + objectReference: {fileID: 0} + - target: {fileID: 1237333013424393175, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_text + value: 4 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: ee5a4e543f12cc141a7bf5f481ba1c91, type: 3} +--- !u!4 &1201458883 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + m_PrefabInstance: {fileID: 1201458882} + m_PrefabAsset: {fileID: 0} --- !u!1 &1236894759 GameObject: m_ObjectHideFlags: 0 @@ -2796,6 +3480,85 @@ MonoBehaviour: type: 3} m_ObjectType: 11 m_ObjectToHide: {fileID: 1105825499} +--- !u!1 &1485770885 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1485770886} + - component: {fileID: 1485770887} + m_Layer: 0 + m_Name: SelfTracker + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1485770886 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1485770885} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1949735286} + - {fileID: 889181419} + - {fileID: 754699636} + - {fileID: 1114047385} + - {fileID: 1135959061} + m_Father: {fileID: 1060976101} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1485770887 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1485770885} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0fb03a0e2549ba64bbca05c0489fae9a, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ObjectInfos: + - DeviceIndex: 0 + IsActive: {fileID: -8492244901029750175, guid: e0ca4504471ca124088e1e2cfe6804ae, + type: 3} + TrackingState: {fileID: -8136229579571401122, guid: e0ca4504471ca124088e1e2cfe6804ae, + type: 3} + ObjectToHide: {fileID: 1949735285} + - DeviceIndex: 1 + IsActive: {fileID: -4470629688995337762, guid: e0ca4504471ca124088e1e2cfe6804ae, + type: 3} + TrackingState: {fileID: -2244026209262363680, guid: e0ca4504471ca124088e1e2cfe6804ae, + type: 3} + ObjectToHide: {fileID: 889181418} + - DeviceIndex: 2 + IsActive: {fileID: -4489327321166900391, guid: e0ca4504471ca124088e1e2cfe6804ae, + type: 3} + TrackingState: {fileID: -8358290946623545184, guid: e0ca4504471ca124088e1e2cfe6804ae, + type: 3} + ObjectToHide: {fileID: 754699635} + - DeviceIndex: 3 + IsActive: {fileID: -8358735505890581370, guid: e0ca4504471ca124088e1e2cfe6804ae, + type: 3} + TrackingState: {fileID: 1702659076926824002, guid: e0ca4504471ca124088e1e2cfe6804ae, + type: 3} + ObjectToHide: {fileID: 1114047384} + - DeviceIndex: 4 + IsActive: {fileID: -8802357504926041156, guid: e0ca4504471ca124088e1e2cfe6804ae, + type: 3} + TrackingState: {fileID: -6415708425981947075, guid: e0ca4504471ca124088e1e2cfe6804ae, + type: 3} + ObjectToHide: {fileID: 1135959060} --- !u!1 &1497070795 GameObject: m_ObjectHideFlags: 0 @@ -2969,6 +3732,91 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1500186001} m_CullTransparentMesh: 0 +--- !u!1001 &1517820626 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 754699636} + m_Modifications: + - target: {fileID: 1237333012750206754, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_Name + value: SelfTracker + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333013369043021, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_text + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 1237333013424393175, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_text + value: 2 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: ee5a4e543f12cc141a7bf5f481ba1c91, type: 3} +--- !u!4 &1517820627 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + m_PrefabInstance: {fileID: 1517820626} + m_PrefabAsset: {fileID: 0} --- !u!1 &1561735408 GameObject: m_ObjectHideFlags: 0 @@ -3738,6 +4586,81 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1755158040} m_CullTransparentMesh: 0 +--- !u!1001 &1831744182 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 1949735286} + m_Modifications: + - target: {fileID: 1237333012750206754, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_Name + value: SelfTracker + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: ee5a4e543f12cc141a7bf5f481ba1c91, type: 3} +--- !u!4 &1831744183 stripped +Transform: + m_CorrespondingSourceObject: {fileID: 1237333012750206755, guid: ee5a4e543f12cc141a7bf5f481ba1c91, + type: 3} + m_PrefabInstance: {fileID: 1831744182} + m_PrefabAsset: {fileID: 0} --- !u!1 &1837306848 GameObject: m_ObjectHideFlags: 0 @@ -4210,6 +5133,113 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1942025778} m_CullTransparentMesh: 0 +--- !u!1 &1949735285 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1949735286} + - component: {fileID: 1949735287} + m_Layer: 0 + m_Name: Tracker0 + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1949735286 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1949735285} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 1} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1831744183} + m_Father: {fileID: 1485770886} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1949735287 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1949735285} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: c2fadf230d1919748a9aa21d40f74619, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackingType: 0 + m_UpdateType: 0 + m_PositionInput: + m_UseReference: 1 + m_Action: + m_Name: Position Input + m_Type: 0 + m_ExpectedControlType: + m_Id: a18cf091-51e4-4025-a91f-43a4603ab611 + m_Processors: + m_Interactions: + m_SingletonActionBindings: + - m_Name: + m_Id: b0b06674-9877-4fde-b469-9ef31f088c5a + m_Path: + m_Interactions: + m_Processors: + m_Groups: + m_Action: Position Input + m_Flags: 0 + m_Flags: 0 + m_Reference: {fileID: 9000281129002361769, guid: e0ca4504471ca124088e1e2cfe6804ae, + type: 3} + m_RotationInput: + m_UseReference: 1 + m_Action: + m_Name: Rotation Input + m_Type: 0 + m_ExpectedControlType: + m_Id: cf98474c-51f3-492c-95bf-0eb7c5657f89 + m_Processors: + m_Interactions: + m_SingletonActionBindings: + - m_Name: + m_Id: 24fb0469-d55f-44b0-8519-9a50f28c655a + m_Path: + m_Interactions: + m_Processors: + m_Groups: + m_Action: Rotation Input + m_Flags: 0 + m_Flags: 0 + m_Reference: {fileID: -1374025861207188230, guid: e0ca4504471ca124088e1e2cfe6804ae, + type: 3} + m_PositionAction: + m_Name: + m_Type: 0 + m_ExpectedControlType: + m_Id: + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_RotationAction: + m_Name: + m_Type: 0 + m_ExpectedControlType: + m_Id: + m_Processors: + m_Interactions: + m_SingletonActionBindings: [] + m_Flags: 0 + m_HasMigratedActions: 1 --- !u!1 &2010079954 GameObject: m_ObjectHideFlags: 0 diff --git a/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/ControllerSampleActions.inputactions b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/ControllerSampleActions.inputactions index a48bebbe..929a6618 100644 --- a/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/ControllerSampleActions.inputactions +++ b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/ControllerSampleActions.inputactions @@ -148,6 +148,33 @@ "processors": "", "interactions": "", "initialStateCheck": true + }, + { + "name": "Velocity", + "type": "Value", + "id": "34af8545-9acc-469e-9d4d-6a0d04248a2f", + "expectedControlType": "Vector3", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "AngularVelocity", + "type": "Value", + "id": "eac112b3-b3a1-4022-b284-85f025dc88df", + "expectedControlType": "Vector3", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "BatteryLevel", + "type": "Value", + "id": "8082f48e-ba2e-4855-bcf8-98b82d90b528", + "expectedControlType": "Axis", + "processors": "", + "interactions": "", + "initialStateCheck": true } ], "bindings": [ @@ -337,6 +364,39 @@ "action": "IsTracked", "isComposite": false, "isPartOfComposite": false + }, + { + "name": "", + "id": "d79131ce-9a80-4023-b823-95cac6b997f5", + "path": "{LeftHand}/batteryLevel", + "interactions": "", + "processors": "", + "groups": "", + "action": "BatteryLevel", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "2c883c5f-3bbc-4ad2-bb47-71491a713027", + "path": "{LeftHand}/deviceVelocity", + "interactions": "", + "processors": "", + "groups": "", + "action": "Velocity", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "4e309e23-a872-493b-97d8-b7f9b7e7b3ab", + "path": "{LeftHand}/deviceAngularVelocity", + "interactions": "", + "processors": "", + "groups": "", + "action": "AngularVelocity", + "isComposite": false, + "isPartOfComposite": false } ] }, @@ -487,6 +547,33 @@ "processors": "", "interactions": "", "initialStateCheck": true + }, + { + "name": "Velocity", + "type": "Value", + "id": "201e3b7d-0153-4710-9eb1-bb3b5d9f28c3", + "expectedControlType": "Vector3", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "AngularVelocity", + "type": "Value", + "id": "ad433fbd-3188-4965-9630-c71347d016c0", + "expectedControlType": "Vector3", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "BatteryLevel", + "type": "Value", + "id": "c17451f1-9d46-482a-9b35-4aedd36552e4", + "expectedControlType": "Axis", + "processors": "", + "interactions": "", + "initialStateCheck": true } ], "bindings": [ @@ -676,6 +763,39 @@ "action": "IsTracked", "isComposite": false, "isPartOfComposite": false + }, + { + "name": "", + "id": "7ba6b252-6d74-4ffb-bee9-1c71d8eb7d91", + "path": "{RightHand}/deviceVelocity", + "interactions": "", + "processors": "", + "groups": "", + "action": "Velocity", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "4f41d4b9-659c-430d-92d4-e36ca8d131a6", + "path": "{RightHand}/deviceAngularVelocity", + "interactions": "", + "processors": "", + "groups": "", + "action": "AngularVelocity", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "ee7a45a7-2f04-4de7-a071-a19e3e8ff098", + "path": "{RightHand}/batteryLevel", + "interactions": "", + "processors": "", + "groups": "", + "action": "BatteryLevel", + "isComposite": false, + "isPartOfComposite": false } ] }, @@ -718,6 +838,42 @@ "processors": "", "interactions": "", "initialStateCheck": true + }, + { + "name": "hmdVelocity", + "type": "Value", + "id": "70e3fe24-1d8c-4f6c-8301-a022409862cf", + "expectedControlType": "Vector3", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "hmdAngularVelocity", + "type": "Value", + "id": "e4cb029d-2870-4e58-8bb3-aebad8218e53", + "expectedControlType": "Vector3", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "BatteryLevel", + "type": "Value", + "id": "b8a87c4e-a997-4a1c-b614-4f121e70a758", + "expectedControlType": "Axis", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "UserPresence", + "type": "Button", + "id": "879d8cd3-7d11-4a7f-bbc4-2b4bf390eea1", + "expectedControlType": "Button", + "processors": "", + "interactions": "", + "initialStateCheck": true } ], "bindings": [ @@ -764,6 +920,50 @@ "action": "hmdTrackingState", "isComposite": false, "isPartOfComposite": false + }, + { + "name": "", + "id": "8379d41a-590f-4efd-86b4-96e920d23d98", + "path": "/userPresence", + "interactions": "", + "processors": "", + "groups": "", + "action": "UserPresence", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "a02bd763-ca6d-44d2-87ec-2e4afe2dbe4a", + "path": "/deviceVelocity", + "interactions": "", + "processors": "", + "groups": "", + "action": "hmdVelocity", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "0002905a-e0d7-48f7-a5eb-916f95861095", + "path": "/deviceAngularVelocity", + "interactions": "", + "processors": "", + "groups": "", + "action": "hmdAngularVelocity", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "be1897ad-1d06-4dc1-a005-7b12e2356226", + "path": "/batteryLevel", + "interactions": "", + "processors": "", + "groups": "", + "action": "BatteryLevel", + "isComposite": false, + "isPartOfComposite": false } ] }, @@ -1178,6 +1378,446 @@ "isPartOfComposite": false } ] + }, + { + "name": "T_SelfTracker0", + "id": "7ab0d44a-fbe0-4c1d-96c0-cfe44ff4110a", + "actions": [ + { + "name": "position", + "type": "Value", + "id": "638e1b2a-a2dd-42b1-813f-8399dfe937f3", + "expectedControlType": "Vector3", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "rotation", + "type": "Value", + "id": "d1ddda43-53e9-4c55-ad57-5976ad83eaae", + "expectedControlType": "Quaternion", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "isTracked", + "type": "Value", + "id": "ba7a29be-c01e-47d0-b747-5818807e3635", + "expectedControlType": "Analog", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "trackingState", + "type": "Value", + "id": "f7c4f547-ef30-4668-a968-a1f1607cafa2", + "expectedControlType": "Integer", + "processors": "", + "interactions": "", + "initialStateCheck": true + } + ], + "bindings": [ + { + "name": "", + "id": "4c7536da-abb4-4213-ac06-7aecd959ee04", + "path": "{Tracker 0}/position", + "interactions": "", + "processors": "", + "groups": "", + "action": "position", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "b119a8e8-bd29-4a0a-aed1-0e17e36928a4", + "path": "{Tracker 0}/rotation", + "interactions": "", + "processors": "", + "groups": "", + "action": "rotation", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "ac482ed7-0e82-4cbf-a3c2-9501139d73ac", + "path": "{Tracker 0}/isTracked", + "interactions": "", + "processors": "", + "groups": "", + "action": "isTracked", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "4ee69402-e6e0-4513-b71d-03da53962ca4", + "path": "{Tracker 0}/trackingState", + "interactions": "", + "processors": "", + "groups": "", + "action": "trackingState", + "isComposite": false, + "isPartOfComposite": false + } + ] + }, + { + "name": "T_SelfTracker1", + "id": "7384f766-1a22-4bb8-995a-968eeab7cb5f", + "actions": [ + { + "name": "position", + "type": "Value", + "id": "a2d30046-568c-4d49-b426-7edb43df50ce", + "expectedControlType": "Vector3", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "rotation", + "type": "Value", + "id": "8cef64ee-45a0-4140-bb99-494a67c0e55f", + "expectedControlType": "Quaternion", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "isTracked", + "type": "Value", + "id": "fae1f582-94d7-4f2a-9d42-9e7b75ad6784", + "expectedControlType": "Analog", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "trackingState", + "type": "Value", + "id": "ab6ca577-d579-4685-afb4-d59f9f3c924f", + "expectedControlType": "Integer", + "processors": "", + "interactions": "", + "initialStateCheck": true + } + ], + "bindings": [ + { + "name": "", + "id": "4d7f5e38-a4f8-4cde-b135-e0bdc57e5cb2", + "path": "{Tracker 1}/position", + "interactions": "", + "processors": "", + "groups": "", + "action": "position", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "cfadf616-f9df-47b3-8d79-207975b673b3", + "path": "{Tracker 1}/rotation", + "interactions": "", + "processors": "", + "groups": "", + "action": "rotation", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "240a1515-03fc-482a-b0dc-dff53463256d", + "path": "{Tracker 1}/isTracked", + "interactions": "", + "processors": "", + "groups": "", + "action": "isTracked", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "b827b4c3-112e-4322-b9fe-f50890c0f457", + "path": "{Tracker 1}/trackingState", + "interactions": "", + "processors": "", + "groups": "", + "action": "trackingState", + "isComposite": false, + "isPartOfComposite": false + } + ] + }, + { + "name": "T_SelfTracker2", + "id": "5d2c3bfb-0c27-4522-b526-4ea0a79dd3bd", + "actions": [ + { + "name": "position", + "type": "Value", + "id": "b2441a14-9446-445c-9ae8-d855a285b74e", + "expectedControlType": "Vector3", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "rotation", + "type": "Value", + "id": "e5d073bd-e023-43e9-8380-767855958ac0", + "expectedControlType": "Quaternion", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "isTracked", + "type": "Value", + "id": "13931329-cf3f-4b55-8a89-96dc9e4023e2", + "expectedControlType": "Analog", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "trackingState", + "type": "Value", + "id": "8a84768b-cc59-4700-b212-e3cba91b0998", + "expectedControlType": "Integer", + "processors": "", + "interactions": "", + "initialStateCheck": true + } + ], + "bindings": [ + { + "name": "", + "id": "312435cf-5e82-48d4-93ea-a99a6c0b2a5b", + "path": "{Tracker 2}/position", + "interactions": "", + "processors": "", + "groups": "", + "action": "position", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "8b2f69a9-9d3d-4558-893d-761dd9e4dc3a", + "path": "{Tracker 2}/rotation", + "interactions": "", + "processors": "", + "groups": "", + "action": "rotation", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "347977c0-9387-44dd-9c55-8f58e36eadad", + "path": "{Tracker 2}/isTracked", + "interactions": "", + "processors": "", + "groups": "", + "action": "isTracked", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "99b61c96-73d4-4ccd-b35b-28dfe570c99f", + "path": "{Tracker 2}/trackingState", + "interactions": "", + "processors": "", + "groups": "", + "action": "trackingState", + "isComposite": false, + "isPartOfComposite": false + } + ] + }, + { + "name": "T_SelfTracker3", + "id": "110238f9-3363-4453-8dcd-e5d32712e925", + "actions": [ + { + "name": "position", + "type": "Value", + "id": "2da5f942-c7f7-428b-9698-6503b37e2a64", + "expectedControlType": "Vector3", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "rotation", + "type": "Value", + "id": "db892f16-1618-4c2f-99ad-4d4800361a28", + "expectedControlType": "Quaternion", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "isTracked", + "type": "Value", + "id": "2a91a3b8-d8ad-492a-b822-8b7944a43163", + "expectedControlType": "Analog", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "trackingState", + "type": "Value", + "id": "c25d94a1-6767-49c9-96a6-3d81a2f58197", + "expectedControlType": "Integer", + "processors": "", + "interactions": "", + "initialStateCheck": true + } + ], + "bindings": [ + { + "name": "", + "id": "0eb7eed6-b66a-44b1-beca-262628e21121", + "path": "{Tracker 3}/position", + "interactions": "", + "processors": "", + "groups": "", + "action": "position", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "9adb03ed-2237-4592-91f0-e799c893f752", + "path": "{Tracker 3}/rotation", + "interactions": "", + "processors": "", + "groups": "", + "action": "rotation", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "a445947e-d91f-44e4-b050-5a63ae8f0d8a", + "path": "{Tracker 3}/isTracked", + "interactions": "", + "processors": "", + "groups": "", + "action": "isTracked", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "324dfd69-c4ca-44be-a04d-70dbdc23af27", + "path": "{Tracker 3}/trackingState", + "interactions": "", + "processors": "", + "groups": "", + "action": "trackingState", + "isComposite": false, + "isPartOfComposite": false + } + ] + }, + { + "name": "T_SelfTracker4", + "id": "2e1463d4-91e1-4465-a5b2-cb80fa2e73dd", + "actions": [ + { + "name": "position", + "type": "Value", + "id": "f96b2cab-c955-476c-bdd5-6472fe8f2605", + "expectedControlType": "Vector3", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "rotation", + "type": "Value", + "id": "47645681-4d11-45f1-919a-ed92e13b5b53", + "expectedControlType": "Quaternion", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "isTracked", + "type": "Value", + "id": "b1328139-29e5-402d-a637-f648c2d9ce2e", + "expectedControlType": "Analog", + "processors": "", + "interactions": "", + "initialStateCheck": true + }, + { + "name": "trackingState", + "type": "Value", + "id": "c0b8e73c-979d-4a52-a499-c0e631694773", + "expectedControlType": "Integer", + "processors": "", + "interactions": "", + "initialStateCheck": true + } + ], + "bindings": [ + { + "name": "", + "id": "5bf7cfc6-e84d-4834-be3d-9a6a7c1c0da8", + "path": "{Tracker 4}/position", + "interactions": "", + "processors": "", + "groups": "", + "action": "position", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "344510fc-0e93-42df-8ff4-aeb9549ba24d", + "path": "{Tracker 4}/rotation", + "interactions": "", + "processors": "", + "groups": "", + "action": "rotation", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "fa6ea88d-de1b-42ae-8b7c-59a6ddf33f41", + "path": "{Tracker 4}/isTracked", + "interactions": "", + "processors": "", + "groups": "", + "action": "isTracked", + "isComposite": false, + "isPartOfComposite": false + }, + { + "name": "", + "id": "479720a8-0092-4d37-88a2-52d56fe79a4f", + "path": "{Tracker 4}/trackingState", + "interactions": "", + "processors": "", + "groups": "", + "action": "trackingState", + "isComposite": false, + "isPartOfComposite": false + } + ] } ], "controlSchemes": [ @@ -1198,4 +1838,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/armeabi-v7a.meta b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker.meta similarity index 77% rename from com.htc.upm.wave.xrsdk/Runtime/Android/armeabi-v7a.meta rename to com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker.meta index 4f3a3397..e281ea25 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/Android/armeabi-v7a.meta +++ b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: daf33bcc3671d4f6aab42346b2b93b44 +guid: 7e38a2e98975e374abb5b9c4d09298c4 folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/com.htc.upm.wave.xrsdk/Runtime/Android/mainTemplate.gradle.meta b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material.meta similarity index 67% rename from com.htc.upm.wave.xrsdk/Runtime/Android/mainTemplate.gradle.meta rename to com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material.meta index 155a06ea..60682f33 100644 --- a/com.htc.upm.wave.xrsdk/Runtime/Android/mainTemplate.gradle.meta +++ b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material.meta @@ -1,5 +1,6 @@ fileFormatVersion: 2 -guid: d4bc03d851e40ba4a93d0eda928022f4 +guid: f769edf6c56758f46a1b402f2db768c0 +folderAsset: yes DefaultImporter: externalObjects: {} userData: diff --git a/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material/Black.mat b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material/Black.mat new file mode 100644 index 00000000..9e534ab7 --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material/Black.mat @@ -0,0 +1,78 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Black + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.05660379, g: 0.055268794, b: 0.055268794, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material/Black.mat.meta b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material/Black.mat.meta new file mode 100644 index 00000000..c601361f --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material/Black.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5d9bf00853279154698630534f63974a +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material/Gray.mat b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material/Gray.mat new file mode 100644 index 00000000..c11f3655 --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material/Gray.mat @@ -0,0 +1,78 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Gray + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.5566038, g: 0.52247244, b: 0.52247244, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material/Gray.mat.meta b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material/Gray.mat.meta new file mode 100644 index 00000000..0a25144f --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material/Gray.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 83991afa835617a4d84ac26c07c0d083 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material/Green.mat b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material/Green.mat new file mode 100644 index 00000000..adc37dd9 --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material/Green.mat @@ -0,0 +1,78 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Green + m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} + m_ShaderKeywords: + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: -1 + stringTagMap: {} + disabledShaderPasses: [] + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Floats: + - _BumpScale: 1 + - _Cutoff: 0.5 + - _DetailNormalMapScale: 1 + - _DstBlend: 0 + - _GlossMapScale: 1 + - _Glossiness: 0.5 + - _GlossyReflections: 1 + - _Metallic: 0 + - _Mode: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.02 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 1 + - _UVSec: 0 + - _ZWrite: 1 + m_Colors: + - _Color: {r: 0.3455565, g: 1, b: 0, a: 1} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + m_BuildTextureStacks: [] diff --git a/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material/Green.mat.meta b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material/Green.mat.meta new file mode 100644 index 00000000..a1b20609 --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Material/Green.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9c8a4e9c9044d144989897f66975396b +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Prefab.meta b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Prefab.meta new file mode 100644 index 00000000..0137d915 --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Prefab.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 217d552af3f7ae44ab1691f5161e12b1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Prefab/SelfTracker.prefab b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Prefab/SelfTracker.prefab new file mode 100644 index 00000000..5af06e02 --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Prefab/SelfTracker.prefab @@ -0,0 +1,690 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &1237333012029797243 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1237333012029797240} + - component: {fileID: 1237333012029797223} + - component: {fileID: 1237333012029797222} + - component: {fileID: 1237333012029797241} + m_Layer: 0 + m_Name: TypeC + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1237333012029797240 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333012029797243} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: -0.0004, z: -0.0177} + m_LocalScale: {x: 0.01, y: 0.0025, z: 0.01} + m_Children: [] + m_Father: {fileID: 1237333012750206755} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1237333012029797223 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333012029797243} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1237333012029797222 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333012029797243} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 83991afa835617a4d84ac26c07c0d083, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &1237333012029797241 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333012029797243} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &1237333012552808047 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1237333012552808044} + - component: {fileID: 1237333012552808043} + - component: {fileID: 1237333012552808042} + - component: {fileID: 1237333012552808045} + m_Layer: 5 + m_Name: Canvas + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1237333012552808044 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333012552808047} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.01, y: 0.01, z: 0.01} + m_Children: + - {fileID: 1237333013424393174} + - {fileID: 1237333013369043020} + m_Father: {fileID: 1237333012750206755} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 2.38278, y: 4.20493} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!223 &1237333012552808043 +Canvas: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333012552808047} + m_Enabled: 1 + serializedVersion: 3 + m_RenderMode: 2 + m_Camera: {fileID: 0} + m_PlaneDistance: 100 + m_PixelPerfect: 0 + m_ReceivesEvents: 1 + m_OverrideSorting: 0 + m_OverridePixelPerfect: 0 + m_SortingBucketNormalizedSize: 0 + m_AdditionalShaderChannelsFlag: 25 + m_SortingLayerID: 0 + m_SortingOrder: 0 + m_TargetDisplay: 0 +--- !u!114 &1237333012552808042 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333012552808047} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3} + m_Name: + m_EditorClassIdentifier: + m_UiScaleMode: 0 + m_ReferencePixelsPerUnit: 100 + m_ScaleFactor: 1 + m_ReferenceResolution: {x: 800, y: 600} + m_ScreenMatchMode: 0 + m_MatchWidthOrHeight: 0 + m_PhysicalUnit: 3 + m_FallbackScreenDPI: 96 + m_DefaultSpriteDPI: 96 + m_DynamicPixelsPerUnit: 1 + m_PresetInfoIsWorld: 1 +--- !u!114 &1237333012552808045 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333012552808047} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreReversedGraphics: 1 + m_BlockingObjects: 0 + m_BlockingMask: + serializedVersion: 2 + m_Bits: 4294967295 +--- !u!1 &1237333012612221963 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1237333012612221960} + - component: {fileID: 1237333012612222007} + - component: {fileID: 1237333012612222006} + - component: {fileID: 1237333012612221961} + m_Layer: 0 + m_Name: LED + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1237333012612221960 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333012612221963} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.0039, z: 0.0184} + m_LocalScale: {x: 0.006, y: 0.0025, z: 0.003} + m_Children: [] + m_Father: {fileID: 1237333012750206755} + m_RootOrder: 2 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1237333012612222007 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333012612221963} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1237333012612222006 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333012612221963} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 9c8a4e9c9044d144989897f66975396b, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &1237333012612221961 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333012612221963} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!1 &1237333012750206754 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1237333012750206755} + m_Layer: 0 + m_Name: OETNew + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1237333012750206755 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333012750206754} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.697, y: 0.473, z: 0.0033111647} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: + - {fileID: 1237333013609045179} + - {fileID: 1237333012029797240} + - {fileID: 1237333012612221960} + - {fileID: 1237333012552808044} + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1237333013369043023 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1237333013369043020} + - component: {fileID: 1237333013369043018} + - component: {fileID: 1237333013369043021} + m_Layer: 5 + m_Name: Text (TMP) (1) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1237333013369043020 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333013369043023} + m_LocalRotation: {x: 0, y: 0.7071068, z: 0.7071068, w: 0} + m_LocalPosition: {x: 0, y: 0, z: -1.22} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1237333012552808044} + m_RootOrder: 1 + m_LocalEulerAnglesHint: {x: -90, y: 0, z: 180} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -3.659, y: -0.52} + m_SizeDelta: {x: 3.117, y: 4.559} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &1237333013369043018 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333013369043023} + m_CullTransparentMesh: 1 +--- !u!114 &1237333013369043021 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333013369043023} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: 0 + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4285229937 + m_fontColor: {r: 0.4433962, g: 0.4203898, b: 0.4203898, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 2 + m_fontSizeBase: 2 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 1 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0.12814714, y: 0, z: 0.0076820273, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &1237333013424392745 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1237333013424393174} + - component: {fileID: 1237333013424393172} + - component: {fileID: 1237333013424393175} + m_Layer: 5 + m_Name: Text (TMP) + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1237333013424393174 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333013424392745} + m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} + m_LocalPosition: {x: 0, y: 0, z: -1.42} + m_LocalScale: {x: 1, y: 1, z: 1} + m_Children: [] + m_Father: {fileID: 1237333012552808044} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 3.17, y: 0.54} + m_SizeDelta: {x: 3.117, y: 4.559} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &1237333013424393172 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333013424392745} + m_CullTransparentMesh: 1 +--- !u!114 &1237333013424393175 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333013424392745} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: 0 + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_sharedMaterial: {fileID: 2180264, guid: 8f586378b4e144a9851e7b34d9b748ee, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4285229937 + m_fontColor: {r: 0.4433962, g: 0.4203898, b: 0.4203898, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 2 + m_fontSizeBase: 2 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 1 + m_HorizontalAlignment: 1 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0.12814714, y: 0, z: -0.39997247, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &1237333013609045178 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1237333013609045179} + - component: {fileID: 1237333013609045158} + - component: {fileID: 1237333013609045177} + - component: {fileID: 1237333013609045176} + m_Layer: 0 + m_Name: Cube + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1237333013609045179 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333013609045178} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 0.07, y: 0.01, z: 0.045} + m_Children: [] + m_Father: {fileID: 1237333012750206755} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!33 &1237333013609045158 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333013609045178} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!23 &1237333013609045177 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333013609045178} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 5d9bf00853279154698630534f63974a, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!65 &1237333013609045176 +BoxCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1237333013609045178} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} diff --git a/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Prefab/SelfTracker.prefab.meta b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Prefab/SelfTracker.prefab.meta new file mode 100644 index 00000000..4ec96b4e --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Models/SelfTracker/Prefab/SelfTracker.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: ee5a4e543f12cc141a7bf5f481ba1c91 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Scripts/HideUntrackedObjects.cs b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Scripts/HideUntrackedObjects.cs new file mode 100644 index 00000000..9af676eb --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Scripts/HideUntrackedObjects.cs @@ -0,0 +1,114 @@ +// "Wave SDK +// © 2020 HTC Corporation. All Rights Reserved. +// +// Unless otherwise required by copyright law and practice, +// upon the execution of HTC SDK license agreement, +// HTC grants you access to and use of the Wave SDK(s). +// You shall fully comply with all of HTC\u2019s SDK license agreement terms and +// conditions signed by you and all SDK and API requirements, +// specifications, and documentation provided by HTC to You." + +using System; +using System.Collections.Generic; +using System.Text; +using UnityEngine; +using UnityEngine.XR; + +#if ENABLE_INPUT_SYSTEM +using UnityEngine.InputSystem; +#endif + +namespace Wave.XR.Sample.Controller +{ + public class HideUntrackedObjects : MonoBehaviour + { +#if ENABLE_INPUT_SYSTEM + const string LOG_TAG = "Wave.XR.Sample.Controller.HideUntrackedObjects "; + StringBuilder m_sb = null; + StringBuilder sb { + get { + if (m_sb == null) { m_sb = new StringBuilder(); } + return m_sb; + } + } + void DEBUG(StringBuilder msg) { Debug.Log(msg); } + + [Serializable] + public class ObjectInfo + { + public uint DeviceIndex = 0; + public InputActionReference IsActive; + public InputActionReference TrackingState; + public GameObject ObjectToHide; + } + + [SerializeField] + public List m_ObjectInfos = new List(); + public List ObjectInfos { get { return m_ObjectInfos; } set { m_ObjectInfos = value; } } + + int printFrame = 0; + protected bool printIntervalLog = false; + + private void Update() + { + printFrame++; + printFrame %= 300; + printIntervalLog = (printFrame == 0); + + if (m_ObjectInfos == null) { return; } + + string errMsg = ""; + + for (int i = 0; i < m_ObjectInfos.Count; i++) + { + bool isActive = false; + InputTrackingState trackingState = InputTrackingState.None; + bool positionTracked = false, rotationTracked = false; + + // isActive + if (Utils.GetButton(m_ObjectInfos[i].IsActive, out bool value, out errMsg)) + { + isActive = value; + } + else + { + if (printIntervalLog) + { + sb.Clear().Append(LOG_TAG).Append(m_ObjectInfos[i].DeviceIndex) + .Append(" Update() ").Append(m_ObjectInfos[i].IsActive.action.name).Append(", ").Append(errMsg); + DEBUG(sb); + } + } + + // trackingState + if (Utils.GetInteger(m_ObjectInfos[i].TrackingState, out InputTrackingState state, out errMsg)) + { + trackingState = state; + } + else + { + if (printIntervalLog) + { + sb.Clear().Append(LOG_TAG).Append(m_ObjectInfos[i].DeviceIndex) + .Append(" Update() ").Append(m_ObjectInfos[i].TrackingState.action.name).Append(", ").Append(errMsg); + DEBUG(sb); + } + } + + if (printIntervalLog) + { + sb.Clear().Append(LOG_TAG).Append(m_ObjectInfos[i].DeviceIndex) + .Append("Update() isActive: ").Append(isActive).Append(", trackingState: ").Append(trackingState); + DEBUG(sb); + } + + positionTracked = trackingState.HasFlag(InputTrackingState.Position); + rotationTracked = trackingState.HasFlag(InputTrackingState.Rotation); + + bool tracked = isActive /*&& positionTracked */&& rotationTracked; // Show the object with 3DoF. + m_ObjectInfos[i].ObjectToHide.SetActive(tracked); + } + } +#endif + } +} diff --git a/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Scripts/HideUntrackedObjects.cs.meta b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Scripts/HideUntrackedObjects.cs.meta new file mode 100644 index 00000000..0f7baaa3 --- /dev/null +++ b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Controller/Scripts/HideUntrackedObjects.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 0fb03a0e2549ba64bbca05c0489fae9a +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Hand/Scripts/JointPose.cs b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Hand/Scripts/JointPose.cs index 6c43d6f1..350bbc11 100644 --- a/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Hand/Scripts/JointPose.cs +++ b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Hand/Scripts/JointPose.cs @@ -38,7 +38,7 @@ public enum HandJoint public HandJoint Joint { get { return m_Joint; } set { m_Joint = value; } } [SerializeField] - private List m_JointPose; + private List m_JointPose = new List(); public List JointsPose { get { return m_JointPose; } set { m_JointPose = value; } } [SerializeField] @@ -50,9 +50,10 @@ public enum HandJoint private void Start() { - foreach (Transform jointPose in m_JointPose) + for (int i = 0; i < m_JointPose.Count; i++) { - m_MeshRenderers.Add(jointPose.GetComponent()); + if (m_JointPose[i] != null) + m_MeshRenderers.Add(m_JointPose[i].GetComponent()); } } diff --git a/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Tracker/Scripts/TrackerText.cs b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Tracker/Scripts/TrackerText.cs index 93433a0e..523cc76c 100644 --- a/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Tracker/Scripts/TrackerText.cs +++ b/com.htc.upm.wave.xrsdk/Samples~/XR/XR/Tracker/Scripts/TrackerText.cs @@ -44,11 +44,18 @@ public enum TextSelect readonly Dictionary, string> s_ButtonsBinding = new Dictionary, string>() { - {CommonUsages.menuButton, "MenuButton"}, - {CommonUsages.primaryButton, "PrimaryButton"}, - {CommonUsages.secondaryButton, "SecondaryButton"}, - {CommonUsages.primary2DAxisClick, "Touchpad"}, - {CommonUsages.triggerButton, "TriggerButton"} + {new InputFeatureUsage("GripTouch"), "Grip Touch"}, + {CommonUsages.gripButton, "Grip Button" }, + {new InputFeatureUsage("TriggerTouch"), "Trigger Touch"}, + {CommonUsages.triggerButton, "Trigger Button"}, + {CommonUsages.primary2DAxisTouch, "Touchpad Touch"}, + {CommonUsages.primary2DAxisClick, "Touchpad Button"}, + {new InputFeatureUsage("MenuTouch"), "Menu Touch"}, + {CommonUsages.menuButton, "Menu Button"}, + {CommonUsages.primaryTouch, "Primary Touch"}, + {CommonUsages.primaryButton, "Primary Button"}, + {CommonUsages.secondaryTouch, "Secondary Touch"}, + {CommonUsages.secondaryButton, "Secondary Button"}, }; @@ -164,14 +171,14 @@ private void TextAngularAcceleration() private void TextPress() { m_Text.text = "Pressed:"; - for(int i=0; i