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) {
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");
}
}

View File

@ -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),

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

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

View File

@ -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 { }

View File

@ -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;
}

View File

@ -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];
}
}
}

View File

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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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