diff --git a/Editor/HumanoidControl/Configuration_Editor.cs b/Editor/HumanoidControl/Configuration_Editor.cs index 210bbc0..384e5f3 100644 --- a/Editor/HumanoidControl/Configuration_Editor.cs +++ b/Editor/HumanoidControl/Configuration_Editor.cs @@ -850,8 +850,13 @@ namespace Passer.Humanoid { } public static bool CheckExtensionNeuron(Configuration configuration) { - bool enabled = configuration.neuronSupport; - return CheckExtension(enabled, neuronPath, "hNEURON"); +#if UNITY_STANDALONE_WIN + bool enabled = isNeuronSupportAvailable; +#else + bool enabled = false; +#endif + CheckExtension(enabled, "hNEURON"); + return enabled; } public static bool CheckExtensionHi5(Configuration configuration) { @@ -1375,7 +1380,7 @@ namespace Passer.Humanoid { private static bool isNeuronSupportAvailable { get { - return DoesTypeExist("Passer.Humanoid.NeuronTracker"); + return DoesTypeExist("Passer.Tracking.PerceptionNeuron"); } } diff --git a/Editor/HumanoidControl/HumanoidControl_Editor.cs b/Editor/HumanoidControl/HumanoidControl_Editor.cs index 1f6ca2d..2e3c59a 100644 --- a/Editor/HumanoidControl/HumanoidControl_Editor.cs +++ b/Editor/HumanoidControl/HumanoidControl_Editor.cs @@ -10,6 +10,7 @@ using Photon.Pun; #endif namespace Passer { + using Tracking; using Humanoid; [CanEditMultipleObjects] @@ -289,15 +290,6 @@ namespace Passer { #if pUNITYXR new UnityXR_Editor.TrackerProps(serializedObject, targetObjs, humanoid.unityXR), #endif -//#if hOPENVR && (UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX) -// new OpenVR_Editor.TrackerProps(serializedObject, targetObjs, humanoid.openVR), -//#endif -//#if hSTEAMVR && UNITY_STANDALONE_WIN -// //new SteamVR_Editor.TrackerProps(serializedObject, targetObjs, humanoid.steamVR), -//#endif -//#if hOCULUS && (UNITY_STANDALONE_WIN || UNITY_ANDROID) -// new Oculus_Editor.TrackerProps(serializedObject, targetObjs, humanoid.oculus), -//#endif #if hWINDOWSMR && UNITY_WSA_10_0 new WindowsMR_Editor.TrackerProps(serializedObject, targetObjs, humanoid.mixedReality), diff --git a/Editor/HumanoidControl/Targets/FootTarget_Editor.cs b/Editor/HumanoidControl/Targets/FootTarget_Editor.cs index a981db1..bfab7f9 100644 --- a/Editor/HumanoidControl/Targets/FootTarget_Editor.cs +++ b/Editor/HumanoidControl/Targets/FootTarget_Editor.cs @@ -48,9 +48,9 @@ namespace Passer { #if hORBBEC new Astra_Editor.FootTargetProps(serializedObject, footTarget), #endif -#if hNEURON - new Neuron_Editor.FootTargetProps(serializedObject, footTarget), -#endif +//#if hNEURON +// new Neuron_Editor.FootTargetProps(serializedObject, footTarget), +//#endif #if hOPTITRACK new Optitrack_Editor.FootTargetProps(serializedObject, footTarget), #endif diff --git a/Editor/HumanoidControl/Targets/HandTarget_Editor.cs b/Editor/HumanoidControl/Targets/HandTarget_Editor.cs index d8b8aea..8a37d7c 100644 --- a/Editor/HumanoidControl/Targets/HandTarget_Editor.cs +++ b/Editor/HumanoidControl/Targets/HandTarget_Editor.cs @@ -74,9 +74,9 @@ namespace Passer.Humanoid { #if hORBBEC new Astra_Editor.HandTargetProps(serializedObject, handTarget), #endif -#if hNEURON - new Neuron_Editor.HandTargetProps(serializedObject, handTarget), -#endif +//#if hNEURON +// new Neuron_Editor.HandTargetProps(serializedObject, handTarget), +//#endif #if hOPTITRACK new Optitrack_Editor.HandTargetProps(serializedObject, handTarget), #endif diff --git a/Editor/HumanoidControl/Targets/HeadTarget_Editor.cs b/Editor/HumanoidControl/Targets/HeadTarget_Editor.cs index e125d7c..bf29b96 100644 --- a/Editor/HumanoidControl/Targets/HeadTarget_Editor.cs +++ b/Editor/HumanoidControl/Targets/HeadTarget_Editor.cs @@ -61,9 +61,9 @@ namespace Passer.Humanoid { #if hOPTITRACK new Optitrack_Editor.HeadTargetProps(serializedObject, headTarget), #endif -#if hNEURON - new Neuron_Editor.HeadTargetProps(serializedObject, headTarget), -#endif +//#if hNEURON +// new Neuron_Editor.HeadTargetProps(serializedObject, headTarget), +//#endif #if hTOBII new Tobii_Editor.HeadTargetProps(serializedObject, headTarget), #endif diff --git a/Editor/HumanoidControl/Targets/HipsTarget_Editor.cs b/Editor/HumanoidControl/Targets/HipsTarget_Editor.cs index c71f368..e6d9d43 100644 --- a/Editor/HumanoidControl/Targets/HipsTarget_Editor.cs +++ b/Editor/HumanoidControl/Targets/HipsTarget_Editor.cs @@ -47,9 +47,9 @@ namespace Passer { #if hORBBEC new Astra_Editor.HipsTargetProps(serializedObject, hipsTarget), #endif -#if hNEURON - new Neuron_Editor.HipsTargetProps(serializedObject, hipsTarget), -#endif +//#if hNEURON +// new Neuron_Editor.HipsTargetProps(serializedObject, hipsTarget), +//#endif #if hOPTITRACK new Optitrack_Editor.HipsTargetProps(serializedObject, hipsTarget), #endif diff --git a/Runtime/HumanoidControl/Libraries/Core/Sensors/Sensor.cs b/Runtime/HumanoidControl/Libraries/Core/Sensors/Sensor.cs index 43f359f..544482d 100644 --- a/Runtime/HumanoidControl/Libraries/Core/Sensors/Sensor.cs +++ b/Runtime/HumanoidControl/Libraries/Core/Sensors/Sensor.cs @@ -1,4 +1,5 @@ using UnityEngine; // This should disappear! +using Passer.Tracking; namespace Passer.Humanoid.Tracking { public class Rotation_ { diff --git a/Runtime/HumanoidControl/Libraries/Tracking/Tracking.cs b/Runtime/HumanoidControl/Libraries/Tracking/Tracking.cs index d6f0b40..1ae8c20 100644 --- a/Runtime/HumanoidControl/Libraries/Tracking/Tracking.cs +++ b/Runtime/HumanoidControl/Libraries/Tracking/Tracking.cs @@ -636,8 +636,8 @@ namespace Passer.Humanoid.Tracking { lastTime = Time.frameCount; } - private Tracker.Status _status; - public Tracker.Status status { + private Passer.Tracking.Tracker.Status _status; + public Passer.Tracking.Tracker.Status status { get { Update(); return _status; @@ -805,7 +805,7 @@ namespace Passer.Humanoid.Tracking { public Vec3 position; public Quat rotation; - public Tracker.Status status; + public Passer.Tracking.Tracker.Status status; public int actorCount; } @@ -856,8 +856,8 @@ namespace Passer.Humanoid.Tracking { } #region Tracker - public virtual Tracker.Status status { - get { return Tracker.Status.Unavailable; } + public virtual Passer.Tracking.Tracker.Status status { + get { return Passer.Tracking.Tracker.Status.Unavailable; } } public virtual Vector3 position { set { } diff --git a/Runtime/HumanoidControl/Scripts/Extensions/ArmSensor.cs b/Runtime/HumanoidControl/Scripts/Extensions/ArmSensor.cs index 8032697..b8060c7 100644 --- a/Runtime/HumanoidControl/Scripts/Extensions/ArmSensor.cs +++ b/Runtime/HumanoidControl/Scripts/Extensions/ArmSensor.cs @@ -380,10 +380,10 @@ namespace Passer.Humanoid { - public override Tracker.Status status { + public override Passer.Tracking.Tracker.Status status { get { if (sensorComponent == null) - return Tracker.Status.Unavailable; + return Passer.Tracking.Tracker.Status.Unavailable; else return sensorComponent.status; } diff --git a/Runtime/HumanoidControl/Scripts/Extensions/BodySkeleton.cs b/Runtime/HumanoidControl/Scripts/Extensions/BodySkeleton.cs index fa1fbd6..799127e 100644 --- a/Runtime/HumanoidControl/Scripts/Extensions/BodySkeleton.cs +++ b/Runtime/HumanoidControl/Scripts/Extensions/BodySkeleton.cs @@ -87,7 +87,24 @@ namespace Passer.Tracking { rendered = false; } - #endregion + #endregion Update + + public Transform GetBoneTransform(Humanoid.Tracking.Bone boneId) { + TrackedBone trackedBone = GetBone(boneId); + if (trackedBone == null) + return null; + return trackedBone.transform; + } + + public TrackedBone GetBone(Humanoid.Tracking.Bone boneId) { + if (bones == null) + return null; + + if (boneId == Humanoid.Tracking.Bone.Count) + return null; + + return bones[(int)boneId]; + } } } diff --git a/Runtime/HumanoidControl/Scripts/Extensions/Tracker.cs b/Runtime/HumanoidControl/Scripts/Extensions/Tracker.cs index 984e121..c665d61 100644 --- a/Runtime/HumanoidControl/Scripts/Extensions/Tracker.cs +++ b/Runtime/HumanoidControl/Scripts/Extensions/Tracker.cs @@ -1,8 +1,7 @@ using System.Collections.Generic; using UnityEngine; -namespace Passer { - using Tracking; +namespace Passer.Tracking { /// /// A tracker diff --git a/Runtime/HumanoidControl/Scripts/Targets/FootTarget.cs b/Runtime/HumanoidControl/Scripts/Targets/FootTarget.cs index 38a9c18..f2d6a50 100644 --- a/Runtime/HumanoidControl/Scripts/Targets/FootTarget.cs +++ b/Runtime/HumanoidControl/Scripts/Targets/FootTarget.cs @@ -106,9 +106,9 @@ namespace Passer.Humanoid { #if hVIVETRACKER public ViveTrackerLeg viveTracker = new ViveTrackerLeg(); #endif -#if hNEURON - public PerceptionNeuronLeg neuron = new PerceptionNeuronLeg(); -#endif +//#if hNEURON +// public PerceptionNeuronLeg neuron = new PerceptionNeuronLeg(); +//#endif #if hKINECT1 public Kinect1Leg kinect1 = new Kinect1Leg(); #endif @@ -152,9 +152,9 @@ namespace Passer.Humanoid { #if hORBBEC astra, #endif -#if hNEURON - neuron, -#endif +//#if hNEURON +// neuron, +//#endif #if hOPTITRACK optitrack, #endif diff --git a/Runtime/HumanoidControl/Scripts/Targets/HandTarget.cs b/Runtime/HumanoidControl/Scripts/Targets/HandTarget.cs index 215df54..3cbb66e 100644 --- a/Runtime/HumanoidControl/Scripts/Targets/HandTarget.cs +++ b/Runtime/HumanoidControl/Scripts/Targets/HandTarget.cs @@ -199,9 +199,9 @@ namespace Passer.Humanoid { #if hWAVEVR public WaveVRHand waveVR = new WaveVRHand(); #endif -#if hNEURON - public NeuronHand neuron = new NeuronHand(); -#endif +//#if hNEURON +// public NeuronHand neuron = new NeuronHand(); +//#endif #if hLEAP public LeapHand leap = new LeapHand(); #endif @@ -287,9 +287,9 @@ namespace Passer.Humanoid { #if hREALSENSE //realsenseHand, #endif -#if hNEURON - neuron, -#endif +//#if hNEURON +// neuron, +//#endif #if hOPTITRACK optitrack, #endif diff --git a/Runtime/HumanoidControl/Scripts/Targets/HeadTarget.cs b/Runtime/HumanoidControl/Scripts/Targets/HeadTarget.cs index b7aeb82..98341e1 100644 --- a/Runtime/HumanoidControl/Scripts/Targets/HeadTarget.cs +++ b/Runtime/HumanoidControl/Scripts/Targets/HeadTarget.cs @@ -123,9 +123,9 @@ namespace Passer.Humanoid { #if hWAVEVR public WaveVRHead waveVR = new WaveVRHead(); #endif -#if hNEURON - public PerceptionNeuronHead neuron = new PerceptionNeuronHead(); -#endif +//#if hNEURON +// public PerceptionNeuronHead neuron = new PerceptionNeuronHead(); +//#endif #if hKINECT1 public Kinect1Head kinect1 = new Kinect1Head(); #endif @@ -235,9 +235,9 @@ namespace Passer.Humanoid { #if hORBBEC && (UNITY_STANDALONE_WIN || UNITY_ANDROID) astra, #endif -#if hNEURON - neuron, -#endif +//#if hNEURON +// neuron, +//#endif #if hREALSENSE realsense, #endif diff --git a/Runtime/HumanoidControl/Scripts/Targets/HipsTarget.cs b/Runtime/HumanoidControl/Scripts/Targets/HipsTarget.cs index 787b369..bb7a7eb 100644 --- a/Runtime/HumanoidControl/Scripts/Targets/HipsTarget.cs +++ b/Runtime/HumanoidControl/Scripts/Targets/HipsTarget.cs @@ -66,9 +66,9 @@ namespace Passer.Humanoid { #if hVIVETRACKER public ViveTrackerTorso viveTracker = new ViveTrackerTorso(); #endif -#if hNEURON - public PerceptionNeuronTorso neuron = new PerceptionNeuronTorso(); -#endif +//#if hNEURON +// public PerceptionNeuronTorso neuron = new PerceptionNeuronTorso(); +//#endif #if hKINECT1 public Kinect1Torso kinect1 = new Kinect1Torso(); #endif @@ -110,9 +110,9 @@ namespace Passer.Humanoid { #if hORBBEC astra, #endif -#if hNEURON - neuron, -#endif +//#if hNEURON +// neuron, +//#endif #if hOPTITRACK optitrack, #endif