Improved BodySkeleton support

This commit is contained in:
Pascal Serrarens 2022-07-01 13:59:00 +02:00
parent 47223965a2
commit 3aed07a76a
15 changed files with 72 additions and 58 deletions

View File

@ -850,8 +850,13 @@ namespace Passer.Humanoid {
} }
public static bool CheckExtensionNeuron(Configuration configuration) { public static bool CheckExtensionNeuron(Configuration configuration) {
bool enabled = configuration.neuronSupport; #if UNITY_STANDALONE_WIN
return CheckExtension(enabled, neuronPath, "hNEURON"); bool enabled = isNeuronSupportAvailable;
#else
bool enabled = false;
#endif
CheckExtension(enabled, "hNEURON");
return enabled;
} }
public static bool CheckExtensionHi5(Configuration configuration) { public static bool CheckExtensionHi5(Configuration configuration) {
@ -1375,7 +1380,7 @@ namespace Passer.Humanoid {
private static bool isNeuronSupportAvailable { private static bool isNeuronSupportAvailable {
get { get {
return DoesTypeExist("Passer.Humanoid.NeuronTracker"); return DoesTypeExist("Passer.Tracking.PerceptionNeuron");
} }
} }

View File

@ -10,6 +10,7 @@ using Photon.Pun;
#endif #endif
namespace Passer { namespace Passer {
using Tracking;
using Humanoid; using Humanoid;
[CanEditMultipleObjects] [CanEditMultipleObjects]
@ -289,15 +290,6 @@ namespace Passer {
#if pUNITYXR #if pUNITYXR
new UnityXR_Editor.TrackerProps(serializedObject, targetObjs, humanoid.unityXR), new UnityXR_Editor.TrackerProps(serializedObject, targetObjs, humanoid.unityXR),
#endif #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 #if hWINDOWSMR && UNITY_WSA_10_0
new WindowsMR_Editor.TrackerProps(serializedObject, targetObjs, humanoid.mixedReality), new WindowsMR_Editor.TrackerProps(serializedObject, targetObjs, humanoid.mixedReality),

View File

@ -48,9 +48,9 @@ namespace Passer {
#if hORBBEC #if hORBBEC
new Astra_Editor.FootTargetProps(serializedObject, footTarget), new Astra_Editor.FootTargetProps(serializedObject, footTarget),
#endif #endif
#if hNEURON //#if hNEURON
new Neuron_Editor.FootTargetProps(serializedObject, footTarget), // new Neuron_Editor.FootTargetProps(serializedObject, footTarget),
#endif //#endif
#if hOPTITRACK #if hOPTITRACK
new Optitrack_Editor.FootTargetProps(serializedObject, footTarget), new Optitrack_Editor.FootTargetProps(serializedObject, footTarget),
#endif #endif

View File

@ -74,9 +74,9 @@ namespace Passer.Humanoid {
#if hORBBEC #if hORBBEC
new Astra_Editor.HandTargetProps(serializedObject, handTarget), new Astra_Editor.HandTargetProps(serializedObject, handTarget),
#endif #endif
#if hNEURON //#if hNEURON
new Neuron_Editor.HandTargetProps(serializedObject, handTarget), // new Neuron_Editor.HandTargetProps(serializedObject, handTarget),
#endif //#endif
#if hOPTITRACK #if hOPTITRACK
new Optitrack_Editor.HandTargetProps(serializedObject, handTarget), new Optitrack_Editor.HandTargetProps(serializedObject, handTarget),
#endif #endif

View File

@ -61,9 +61,9 @@ namespace Passer.Humanoid {
#if hOPTITRACK #if hOPTITRACK
new Optitrack_Editor.HeadTargetProps(serializedObject, headTarget), new Optitrack_Editor.HeadTargetProps(serializedObject, headTarget),
#endif #endif
#if hNEURON //#if hNEURON
new Neuron_Editor.HeadTargetProps(serializedObject, headTarget), // new Neuron_Editor.HeadTargetProps(serializedObject, headTarget),
#endif //#endif
#if hTOBII #if hTOBII
new Tobii_Editor.HeadTargetProps(serializedObject, headTarget), new Tobii_Editor.HeadTargetProps(serializedObject, headTarget),
#endif #endif

View File

@ -47,9 +47,9 @@ namespace Passer {
#if hORBBEC #if hORBBEC
new Astra_Editor.HipsTargetProps(serializedObject, hipsTarget), new Astra_Editor.HipsTargetProps(serializedObject, hipsTarget),
#endif #endif
#if hNEURON //#if hNEURON
new Neuron_Editor.HipsTargetProps(serializedObject, hipsTarget), // new Neuron_Editor.HipsTargetProps(serializedObject, hipsTarget),
#endif //#endif
#if hOPTITRACK #if hOPTITRACK
new Optitrack_Editor.HipsTargetProps(serializedObject, hipsTarget), new Optitrack_Editor.HipsTargetProps(serializedObject, hipsTarget),
#endif #endif

View File

@ -1,4 +1,5 @@
using UnityEngine; // This should disappear! using UnityEngine; // This should disappear!
using Passer.Tracking;
namespace Passer.Humanoid.Tracking { namespace Passer.Humanoid.Tracking {
public class Rotation_ { public class Rotation_ {

View File

@ -636,8 +636,8 @@ namespace Passer.Humanoid.Tracking {
lastTime = Time.frameCount; lastTime = Time.frameCount;
} }
private Tracker.Status _status; private Passer.Tracking.Tracker.Status _status;
public Tracker.Status status { public Passer.Tracking.Tracker.Status status {
get { get {
Update(); Update();
return _status; return _status;
@ -805,7 +805,7 @@ namespace Passer.Humanoid.Tracking {
public Vec3 position; public Vec3 position;
public Quat rotation; public Quat rotation;
public Tracker.Status status; public Passer.Tracking.Tracker.Status status;
public int actorCount; public int actorCount;
} }
@ -856,8 +856,8 @@ namespace Passer.Humanoid.Tracking {
} }
#region Tracker #region Tracker
public virtual Tracker.Status status { public virtual Passer.Tracking.Tracker.Status status {
get { return Tracker.Status.Unavailable; } get { return Passer.Tracking.Tracker.Status.Unavailable; }
} }
public virtual Vector3 position { public virtual Vector3 position {
set { } set { }

View File

@ -380,10 +380,10 @@ namespace Passer.Humanoid {
public override Tracker.Status status { public override Passer.Tracking.Tracker.Status status {
get { get {
if (sensorComponent == null) if (sensorComponent == null)
return Tracker.Status.Unavailable; return Passer.Tracking.Tracker.Status.Unavailable;
else else
return sensorComponent.status; return sensorComponent.status;
} }

View File

@ -87,7 +87,24 @@ namespace Passer.Tracking {
rendered = false; 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];
}
} }
} }

View File

@ -1,8 +1,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
namespace Passer { namespace Passer.Tracking {
using Tracking;
/// <summary> /// <summary>
/// A tracker /// A tracker

View File

@ -106,9 +106,9 @@ namespace Passer.Humanoid {
#if hVIVETRACKER #if hVIVETRACKER
public ViveTrackerLeg viveTracker = new ViveTrackerLeg(); public ViveTrackerLeg viveTracker = new ViveTrackerLeg();
#endif #endif
#if hNEURON //#if hNEURON
public PerceptionNeuronLeg neuron = new PerceptionNeuronLeg(); // public PerceptionNeuronLeg neuron = new PerceptionNeuronLeg();
#endif //#endif
#if hKINECT1 #if hKINECT1
public Kinect1Leg kinect1 = new Kinect1Leg(); public Kinect1Leg kinect1 = new Kinect1Leg();
#endif #endif
@ -152,9 +152,9 @@ namespace Passer.Humanoid {
#if hORBBEC #if hORBBEC
astra, astra,
#endif #endif
#if hNEURON //#if hNEURON
neuron, // neuron,
#endif //#endif
#if hOPTITRACK #if hOPTITRACK
optitrack, optitrack,
#endif #endif

View File

@ -199,9 +199,9 @@ namespace Passer.Humanoid {
#if hWAVEVR #if hWAVEVR
public WaveVRHand waveVR = new WaveVRHand(); public WaveVRHand waveVR = new WaveVRHand();
#endif #endif
#if hNEURON //#if hNEURON
public NeuronHand neuron = new NeuronHand(); // public NeuronHand neuron = new NeuronHand();
#endif //#endif
#if hLEAP #if hLEAP
public LeapHand leap = new LeapHand(); public LeapHand leap = new LeapHand();
#endif #endif
@ -287,9 +287,9 @@ namespace Passer.Humanoid {
#if hREALSENSE #if hREALSENSE
//realsenseHand, //realsenseHand,
#endif #endif
#if hNEURON //#if hNEURON
neuron, // neuron,
#endif //#endif
#if hOPTITRACK #if hOPTITRACK
optitrack, optitrack,
#endif #endif

View File

@ -123,9 +123,9 @@ namespace Passer.Humanoid {
#if hWAVEVR #if hWAVEVR
public WaveVRHead waveVR = new WaveVRHead(); public WaveVRHead waveVR = new WaveVRHead();
#endif #endif
#if hNEURON //#if hNEURON
public PerceptionNeuronHead neuron = new PerceptionNeuronHead(); // public PerceptionNeuronHead neuron = new PerceptionNeuronHead();
#endif //#endif
#if hKINECT1 #if hKINECT1
public Kinect1Head kinect1 = new Kinect1Head(); public Kinect1Head kinect1 = new Kinect1Head();
#endif #endif
@ -235,9 +235,9 @@ namespace Passer.Humanoid {
#if hORBBEC && (UNITY_STANDALONE_WIN || UNITY_ANDROID) #if hORBBEC && (UNITY_STANDALONE_WIN || UNITY_ANDROID)
astra, astra,
#endif #endif
#if hNEURON //#if hNEURON
neuron, // neuron,
#endif //#endif
#if hREALSENSE #if hREALSENSE
realsense, realsense,
#endif #endif

View File

@ -66,9 +66,9 @@ namespace Passer.Humanoid {
#if hVIVETRACKER #if hVIVETRACKER
public ViveTrackerTorso viveTracker = new ViveTrackerTorso(); public ViveTrackerTorso viveTracker = new ViveTrackerTorso();
#endif #endif
#if hNEURON //#if hNEURON
public PerceptionNeuronTorso neuron = new PerceptionNeuronTorso(); // public PerceptionNeuronTorso neuron = new PerceptionNeuronTorso();
#endif //#endif
#if hKINECT1 #if hKINECT1
public Kinect1Torso kinect1 = new Kinect1Torso(); public Kinect1Torso kinect1 = new Kinect1Torso();
#endif #endif
@ -110,9 +110,9 @@ namespace Passer.Humanoid {
#if hORBBEC #if hORBBEC
astra, astra,
#endif #endif
#if hNEURON //#if hNEURON
neuron, // neuron,
#endif //#endif
#if hOPTITRACK #if hOPTITRACK
optitrack, optitrack,
#endif #endif