Compare commits
No commits in common. "main" and "4.1.1" have entirely different histories.
5
.gitignore
vendored
5
.gitignore
vendored
@ -1,5 +0,0 @@
|
||||
Samples
|
||||
Samples.meta
|
||||
package.json
|
||||
package.json.meta
|
||||
Samples~.meta
|
||||
@ -1,5 +0,0 @@
|
||||
Contibuting to Humanoid Control Free
|
||||
====================================
|
||||
If you want to contribute to this project, make sure you have access to the repository.
|
||||
You can request access by logging into our [GitLab site](https://gitlab.passervr.com/) with an GitHub or Google account.
|
||||
Besides that, it is best to [contract us](https://passervr.com/contract) about you wanting to contribute to this project. This will ensure you will get access more quickly.
|
||||
@ -1,7 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c55d00a05de5d8340a1a49f5d8b2aeed
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,190 +0,0 @@
|
||||
#if hCUSTOM
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Passer.Humanoid {
|
||||
using Passer.Tracking;
|
||||
|
||||
public class Custom_Editor : Tracker_Editor {
|
||||
|
||||
#region Tracker
|
||||
|
||||
public class TrackerProps : HumanoidControl_Editor.HumanoidTrackerProps {
|
||||
protected SerializedProperty bodySkeletonProp;
|
||||
|
||||
public TrackerProps(SerializedObject serializedObject, HumanoidControl_Editor.HumanoidTargetObjs targetObjs, CustomTracker _custom)
|
||||
: base(serializedObject, targetObjs, _custom, "custom") {
|
||||
tracker = _custom;
|
||||
|
||||
bodySkeletonProp = serializedObject.FindProperty(nameof(HumanoidControl.custom) + "." + nameof(HumanoidControl.custom.bodySkeleton));
|
||||
}
|
||||
|
||||
public override void Inspector(HumanoidControl humanoid) {
|
||||
Inspector(humanoid, "Custom");
|
||||
|
||||
if (humanoid.custom.enabled == false)
|
||||
return;
|
||||
|
||||
EditorGUI.indentLevel++;
|
||||
bodySkeletonProp.objectReferenceValue = (BodySkeleton)EditorGUILayout.ObjectField("Body Skeleton", bodySkeletonProp.objectReferenceValue, typeof(BodySkeleton), true);
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Tracker
|
||||
|
||||
#region Head
|
||||
|
||||
public class HeadTargetProps : HeadTarget_Editor.TargetProps {
|
||||
protected SerializedProperty sensorProp;
|
||||
|
||||
public HeadTargetProps(SerializedObject serializedObject, HeadTarget headTarget)
|
||||
: base(serializedObject, headTarget.custom, headTarget, "custom") {
|
||||
|
||||
sensorProp = serializedObject.FindProperty("custom.sensorComponent");
|
||||
}
|
||||
|
||||
public override void Inspector() {
|
||||
if (headTarget.humanoid.custom.enabled == false)
|
||||
return;
|
||||
|
||||
enabledProp.boolValue = HumanoidTarget_Editor.ControllerInspector(headTarget.custom, headTarget);
|
||||
headTarget.custom.enabled = enabledProp.boolValue;
|
||||
if (!Application.isPlaying) {
|
||||
headTarget.custom.SetSensor2Target();
|
||||
headTarget.custom.ShowSensor(headTarget.humanoid.showRealObjects && headTarget.showRealObjects);
|
||||
}
|
||||
|
||||
if (enabledProp.boolValue) {
|
||||
EditorGUI.indentLevel++;
|
||||
if (sensorProp.objectReferenceValue == null && headTarget.custom.sensorComponent != null)
|
||||
sensorProp.objectReferenceValue = headTarget.custom.sensorComponent; // sensorTransform.GetComponent<SensorComponent>();
|
||||
|
||||
sensorProp.objectReferenceValue = (SensorComponent)EditorGUILayout.ObjectField("Sensor", sensorProp.objectReferenceValue, typeof(SensorComponent), true);
|
||||
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Head
|
||||
|
||||
#region Hand
|
||||
|
||||
public class HandTargetProps : HandTarget_Editor.TargetProps {
|
||||
protected SerializedProperty sensorProp;
|
||||
protected SerializedProperty attachedBoneProp;
|
||||
|
||||
public HandTargetProps(SerializedObject serializedObject, HandTarget handTarget)
|
||||
: base(serializedObject, handTarget.custom, handTarget, "custom") {
|
||||
|
||||
sensorProp = serializedObject.FindProperty("custom.sensorComponent");
|
||||
attachedBoneProp = serializedObject.FindProperty("custom.attachedBone");
|
||||
}
|
||||
|
||||
public override void Inspector() {
|
||||
if (handTarget.humanoid.custom.enabled == false)
|
||||
return;
|
||||
|
||||
enabledProp.boolValue = HumanoidTarget_Editor.ControllerInspector(handTarget.custom, handTarget);
|
||||
handTarget.custom.enabled = enabledProp.boolValue;
|
||||
if (!Application.isPlaying) {
|
||||
handTarget.custom.SetSensor2Target();
|
||||
handTarget.custom.ShowSensor(handTarget.humanoid.showRealObjects && handTarget.showRealObjects);
|
||||
}
|
||||
|
||||
if (enabledProp.boolValue) {
|
||||
EditorGUI.indentLevel++;
|
||||
if (sensorProp.objectReferenceValue == null && handTarget.custom.sensorComponent != null)
|
||||
sensorProp.objectReferenceValue = handTarget.custom.sensorComponent; //.GetComponent<SensorComponent>();
|
||||
|
||||
sensorProp.objectReferenceValue = (SensorComponent)EditorGUILayout.ObjectField("Sensor", sensorProp.objectReferenceValue, typeof(SensorComponent), true);
|
||||
attachedBoneProp.intValue = (int)(ArmBones)EditorGUILayout.EnumPopup("Bone", (ArmBones)attachedBoneProp.intValue);
|
||||
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Hand
|
||||
|
||||
#region Hips
|
||||
|
||||
public class HipsTargetProps : HipsTarget_Editor.TargetProps {
|
||||
protected SerializedProperty sensorProp;
|
||||
protected SerializedProperty attachedBoneProp;
|
||||
|
||||
public HipsTargetProps(SerializedObject serializedObject, HipsTarget hipsTarget)
|
||||
: base(serializedObject, hipsTarget.custom, hipsTarget, "custom") {
|
||||
|
||||
sensorProp = serializedObject.FindProperty("custom.sensorComponent");
|
||||
attachedBoneProp = serializedObject.FindProperty("custom.attachedBone");
|
||||
}
|
||||
|
||||
public override void Inspector() {
|
||||
if (hipsTarget.humanoid.custom.enabled == false)
|
||||
return;
|
||||
|
||||
enabledProp.boolValue = HumanoidTarget_Editor.ControllerInspector(hipsTarget.custom, hipsTarget);
|
||||
hipsTarget.custom.enabled = enabledProp.boolValue;
|
||||
if (!Application.isPlaying) {
|
||||
hipsTarget.custom.SetSensor2Target();
|
||||
hipsTarget.custom.ShowSensor(hipsTarget.humanoid.showRealObjects && hipsTarget.showRealObjects);
|
||||
}
|
||||
|
||||
if (enabledProp.boolValue) {
|
||||
EditorGUI.indentLevel++;
|
||||
if (sensorProp.objectReferenceValue == null && hipsTarget.custom.sensorComponent != null)
|
||||
sensorProp.objectReferenceValue = hipsTarget.custom.sensorComponent; //.GetComponent<SensorComponent>();
|
||||
|
||||
sensorProp.objectReferenceValue = (SensorComponent)EditorGUILayout.ObjectField("Sensor", sensorProp.objectReferenceValue, typeof(SensorComponent), true);
|
||||
attachedBoneProp.intValue = (int)(TorsoBones)EditorGUILayout.EnumPopup("Bone", (TorsoBones)attachedBoneProp.intValue);
|
||||
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Hips
|
||||
|
||||
#region Foot
|
||||
|
||||
public class FootTargetProps : FootTarget_Editor.TargetProps {
|
||||
protected SerializedProperty sensorProp;
|
||||
protected SerializedProperty attachedBoneProp;
|
||||
|
||||
public FootTargetProps(SerializedObject serializedObject, FootTarget footTarget)
|
||||
: base(serializedObject, footTarget.custom, footTarget, "custom") {
|
||||
|
||||
sensorProp = serializedObject.FindProperty("custom.sensorComponent");
|
||||
attachedBoneProp = serializedObject.FindProperty("custom.attachedBone");
|
||||
}
|
||||
|
||||
public override void Inspector() {
|
||||
if (footTarget.humanoid.custom.enabled == false)
|
||||
return;
|
||||
|
||||
enabledProp.boolValue = HumanoidTarget_Editor.ControllerInspector(footTarget.custom, footTarget);
|
||||
footTarget.custom.enabled = enabledProp.boolValue;
|
||||
if (!Application.isPlaying) {
|
||||
footTarget.custom.SetSensor2Target();
|
||||
footTarget.custom.ShowSensor(footTarget.humanoid.showRealObjects && footTarget.showRealObjects);
|
||||
}
|
||||
|
||||
if (enabledProp.boolValue) {
|
||||
EditorGUI.indentLevel++;
|
||||
if (sensorProp.objectReferenceValue == null && footTarget.custom.sensorComponent != null)
|
||||
sensorProp.objectReferenceValue = footTarget.custom.sensorComponent; //.GetComponent<SensorComponent>();
|
||||
|
||||
sensorProp.objectReferenceValue = (SensorComponent)EditorGUILayout.ObjectField("Sensor", sensorProp.objectReferenceValue, typeof(SensorComponent), true);
|
||||
attachedBoneProp.intValue = (int)(LegBones)EditorGUILayout.EnumPopup("Bone", (LegBones)attachedBoneProp.intValue);
|
||||
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Foot
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@ -1,143 +0,0 @@
|
||||
using UnityEngine;
|
||||
#if hPHOTON2
|
||||
using Photon.Pun;
|
||||
#if hPUNVOICE2 && !UNITY_WEBGL
|
||||
using Photon.Voice.PUN;
|
||||
using Photon.Voice.Unity;
|
||||
#endif
|
||||
#endif
|
||||
#if UNITY_EDITOR
|
||||
using UnityEditor;
|
||||
#endif
|
||||
|
||||
namespace Passer.Humanoid {
|
||||
|
||||
[InitializeOnLoad]
|
||||
public class OnLoadHumanoidPlayerPun {
|
||||
static OnLoadHumanoidPlayerPun() {
|
||||
CheckHumanoidPlayer();
|
||||
}
|
||||
|
||||
protected static void CheckHumanoidPlayerVoice() {
|
||||
#if hPUNVOICE2
|
||||
string prefabPath = OnLoadHumanoidPlayer.GetHumanoidPlayerPrefabPath();
|
||||
prefabPath = prefabPath.Substring(0, prefabPath.Length - 21) + "HumanoidPlayerVoice.prefab";
|
||||
GameObject playerVoicePrefab = OnLoadHumanoidPlayer.GetHumanoidPlayerPrefab(prefabPath);
|
||||
if (playerVoicePrefab == null)
|
||||
return;
|
||||
|
||||
bool hasChanged = false;
|
||||
#if UNITY_WEBGL
|
||||
PhotonView photonView = playerVoicePrefab.GetComponent<PhotonView>();
|
||||
if (photonView == null) {
|
||||
photonView = playerVoicePrefab.AddComponent<PhotonView>();
|
||||
hasChanged = true;
|
||||
}
|
||||
#else
|
||||
PhotonVoiceView photonVoiceView = playerVoicePrefab.GetComponent<PhotonVoiceView>();
|
||||
if (photonVoiceView == null) {
|
||||
photonVoiceView = playerVoicePrefab.AddComponent<PhotonVoiceView>();
|
||||
hasChanged = true;
|
||||
}
|
||||
if (photonVoiceView.UsePrimaryRecorder == false) {
|
||||
photonVoiceView.UsePrimaryRecorder = true;
|
||||
hasChanged = true;
|
||||
}
|
||||
PhotonTransformView photonTransformView = playerVoicePrefab.GetComponent<PhotonTransformView>();
|
||||
if (photonTransformView == null) {
|
||||
photonTransformView = playerVoicePrefab.AddComponent<PhotonTransformView>();
|
||||
hasChanged = true;
|
||||
}
|
||||
PhotonView photonView = playerVoicePrefab.GetComponent<PhotonView>();
|
||||
if (photonView != null) {
|
||||
// should always be there because of the photonVoiceView
|
||||
if (photonView.ObservedComponents == null) {
|
||||
photonView.ObservedComponents = new System.Collections.Generic.List<Component>();
|
||||
photonView.ObservedComponents.Add(photonTransformView);
|
||||
photonView.Synchronization = ViewSynchronization.UnreliableOnChange;
|
||||
hasChanged = true;
|
||||
}
|
||||
}
|
||||
//Speaker speaker = playerVoicePrefab.GetComponent<Speaker>();
|
||||
//if (speaker == null) {
|
||||
// speaker = playerVoicePrefab.AddComponent<Speaker>();
|
||||
// photonVoiceView.SpeakerInUse = speaker;
|
||||
// hasChanged = true;
|
||||
|
||||
// AudioSource audioSource = playerVoicePrefab.GetComponent<AudioSource>();
|
||||
// if (audioSource != null) {
|
||||
// Debug.Log("adjust rolloff");
|
||||
// // default logaritmic only work when people are closer than 0.5m...
|
||||
// audioSource.maxDistance = 5;
|
||||
// }
|
||||
//}
|
||||
#endif
|
||||
if (hasChanged)
|
||||
OnLoadHumanoidPlayer.UpdateHumanoidPrefab(playerVoicePrefab, prefabPath);
|
||||
#if !UNITY_WEBGL
|
||||
CheckVoiceNetwork();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
#if hPUNVOICE2 && !UNITY_WEBGL
|
||||
protected static void CheckVoiceNetwork() {
|
||||
NetworkingStarter networkingStarter = Object.FindObjectOfType<NetworkingStarter>();
|
||||
if (networkingStarter == null)
|
||||
return;
|
||||
|
||||
PhotonVoiceNetwork voiceNetwork = Object.FindObjectOfType<PhotonVoiceNetwork>();
|
||||
if (voiceNetwork != null)
|
||||
return;
|
||||
|
||||
GameObject voiceNetworkObject = new GameObject("Voice Network");
|
||||
voiceNetwork = voiceNetworkObject.AddComponent<PhotonVoiceNetwork>();
|
||||
|
||||
Recorder voiceRecorder = voiceNetworkObject.AddComponent<Recorder>();
|
||||
voiceRecorder.ReactOnSystemChanges = true;
|
||||
voiceRecorder.TransmitEnabled = true;
|
||||
voiceRecorder.SamplingRate = POpusCodec.Enums.SamplingRate.Sampling48000;
|
||||
|
||||
voiceNetwork.PrimaryRecorder = voiceRecorder;
|
||||
}
|
||||
#endif
|
||||
|
||||
public static void CheckHumanoidPlayer() {
|
||||
#if hPHOTON1 || hPHOTON2
|
||||
string prefabPath = OnLoadHumanoidPlayer.GetHumanoidPlayerPrefabPath();
|
||||
GameObject playerPrefab = OnLoadHumanoidPlayer.GetHumanoidPlayerPrefab(prefabPath);
|
||||
|
||||
bool hasChanged = false;
|
||||
#if hNW_PHOTON
|
||||
if (playerPrefab != null) {
|
||||
PhotonView photonView = playerPrefab.GetComponent<PhotonView>();
|
||||
if (photonView == null) {
|
||||
photonView = playerPrefab.AddComponent<PhotonView>();
|
||||
photonView.ObservedComponents = new System.Collections.Generic.List<Component>();
|
||||
#if hPHOTON2
|
||||
photonView.Synchronization = ViewSynchronization.UnreliableOnChange;
|
||||
#else
|
||||
photonView.synchronization = ViewSynchronization.UnreliableOnChange;
|
||||
#endif
|
||||
|
||||
HumanoidPlayer humanoidPun = playerPrefab.GetComponent<HumanoidPlayer>();
|
||||
if (humanoidPun != null)
|
||||
photonView.ObservedComponents.Add(humanoidPun);
|
||||
hasChanged = true;
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (playerPrefab != null) {
|
||||
PhotonView photonView = playerPrefab.GetComponent<PhotonView>();
|
||||
if (photonView != null)
|
||||
Object.DestroyImmediate(photonView, true);
|
||||
}
|
||||
#endif
|
||||
if (hasChanged)
|
||||
OnLoadHumanoidPlayer.UpdateHumanoidPrefab(playerPrefab, prefabPath);
|
||||
#endif
|
||||
CheckHumanoidPlayerVoice();
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 185ec4e1799d1ac4d867b69454f1cd0f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,108 +0,0 @@
|
||||
/*
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Networking;
|
||||
#if hNW_PHOTON
|
||||
#if hPHOTON2
|
||||
using Photon.Pun;
|
||||
#endif
|
||||
|
||||
namespace Passer {
|
||||
|
||||
[CustomEditor(typeof(PhotonStarter))]
|
||||
public class PunStarter_Editor : Editor {
|
||||
|
||||
public override void OnInspectorGUI() {
|
||||
base.OnInspectorGUI();
|
||||
|
||||
HumanoidControl[] humanoids = FindObjectsOfType<HumanoidControl>();
|
||||
if (humanoids.Length != 1)
|
||||
// We only support sitatuation with one humanoid in the scene
|
||||
return;
|
||||
|
||||
//HumanoidControl humanoid = humanoids[0];
|
||||
|
||||
if (Application.isPlaying)
|
||||
return;
|
||||
|
||||
//GameObject humanoidPrefab = CheckHumanoidPrefab(humanoid);
|
||||
//NetworkingComponentsInspectorPun(humanoid, humanoidPrefab);
|
||||
}
|
||||
|
||||
//private GameObject CheckHumanoidPrefab(HumanoidControl humanoid) {
|
||||
// GameObject humanoidPrefab = Resources.Load<GameObject>(humanoid.gameObject.name + "_generated");
|
||||
// if (humanoidPrefab == null) {
|
||||
// humanoidPrefab = PrefabUtility.CreatePrefab("Assets/Humanoid/Prefabs/Networking/Resources/" + humanoid.gameObject.name + "_generated.prefab", humanoid.gameObject);
|
||||
// humanoidPrefab.gameObject.SetActive(true);
|
||||
// }
|
||||
// return humanoidPrefab;
|
||||
//}
|
||||
|
||||
//private void UpdateHumanoidPrefab(HumanoidControl humanoid) {
|
||||
// if (humanoid != null) {
|
||||
// GameObject humanoidPrefab = Resources.Load<GameObject>(humanoid.gameObject.name + "_generated");
|
||||
// if (humanoidPrefab != null && humanoid.gameObject != humanoidPrefab)
|
||||
// PrefabUtility.ReplacePrefab(humanoid.gameObject, humanoidPrefab, ReplacePrefabOptions.ConnectToPrefab);
|
||||
// }
|
||||
//}
|
||||
|
||||
// private void NetworkingComponentsInspectorPun(HumanoidControl humanoid, GameObject humanoidPrefab) {
|
||||
//#if hPHOTON1 || hPHOTON2
|
||||
//#if hNW_PHOTON
|
||||
// CheckPunStarter(humanoid, humanoidPrefab);
|
||||
// PhotonView photonView = humanoid.GetComponent<PhotonView>();
|
||||
// if (photonView == null)
|
||||
// photonView = humanoid.gameObject.AddComponent<PhotonView>();
|
||||
// photonView.ObservedComponents = new System.Collections.Generic.List<Component>();
|
||||
// photonView.ObservedComponents.Add(humanoid);
|
||||
//#else
|
||||
// cleanupPhotonView = humanoid.GetComponent<PhotonView>();
|
||||
//#endif
|
||||
//#endif
|
||||
// }
|
||||
|
||||
// private void CheckPunStarter(HumanoidControl humanoid, GameObject humanoidPrefab) {
|
||||
// if (Application.isPlaying)
|
||||
// return;
|
||||
|
||||
//#if hNW_PHOTON
|
||||
// PhotonStarter photonStarter = FindObjectOfType<PhotonStarter>();
|
||||
// if (photonStarter != null && humanoidPrefab != null && photonStarter.playerPrefab != humanoidPrefab) {
|
||||
// Undo.RecordObject(photonStarter, "Updated Player Prefab");
|
||||
// photonStarter.playerPrefab = humanoidPrefab;
|
||||
// }
|
||||
//#endif
|
||||
// }
|
||||
public void OnDisable() {
|
||||
Cleanup();
|
||||
}
|
||||
|
||||
#if hNW_UNET
|
||||
private NetworkIdentity cleanupNetworkIdentity;
|
||||
#endif
|
||||
#if hPHOTON1 || hPHOTON2
|
||||
private PhotonView cleanupPhotonView;
|
||||
#endif
|
||||
private GameObject cleanupPunStarter;
|
||||
private void Cleanup() {
|
||||
#if hNW_UNET
|
||||
if (cleanupNetworkIdentity) {
|
||||
DestroyImmediate(cleanupNetworkIdentity, true);
|
||||
cleanupNetworkIdentity = null;
|
||||
}
|
||||
#endif
|
||||
#if hPHOTON1 || hPHOTON2
|
||||
if (cleanupPhotonView) {
|
||||
DestroyImmediate(cleanupPhotonView, true);
|
||||
cleanupPhotonView = null;
|
||||
}
|
||||
#endif
|
||||
if (cleanupPunStarter) {
|
||||
DestroyImmediate(cleanupPunStarter, true);
|
||||
cleanupPunStarter = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
*/
|
||||
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e86563dd015c559479420645216c4a70
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -219,7 +219,7 @@ namespace Passer.Humanoid {
|
||||
for (int i = 0; i < hcScripts.Length; i++) {
|
||||
string assetPath = AssetDatabase.GUIDToAssetPath(hcScripts[i]);
|
||||
if (assetPath.Length > 36 && assetPath.Substring(assetPath.Length - 27, 27) == "/Scripts/HumanoidControl.cs") {
|
||||
humanoidPath = assetPath.Substring(0, assetPath.Length - 18);
|
||||
humanoidPath = assetPath.Substring(6, assetPath.Length - 24);
|
||||
return humanoidPath;
|
||||
}
|
||||
}
|
||||
@ -250,6 +250,7 @@ namespace Passer.Humanoid {
|
||||
//anyChanged |= SteamVRSettingUI(serializedConfiguration);
|
||||
//anyChanged |= OculusSettingUI(serializedConfiguration);
|
||||
//anyChanged |= WindowsMRSettingUI(serializedConfiguration);
|
||||
//anyChanged |= VrtkSettingUI(serializedConfiguration);
|
||||
|
||||
//anyChanged |= LeapSettingUI(serializedConfiguration);
|
||||
//anyChanged |= Kinect1SettingUI(serializedConfiguration);
|
||||
@ -269,7 +270,7 @@ namespace Passer.Humanoid {
|
||||
|
||||
//anyChanged |= NetworkingSettingUI(serializedConfiguration);
|
||||
|
||||
//anyChanged |= HumanoidSceneInspector(serializedConfiguration);
|
||||
anyChanged |= HumanoidSceneInspector(serializedConfiguration);
|
||||
|
||||
return anyChanged;
|
||||
}
|
||||
@ -278,33 +279,35 @@ namespace Passer.Humanoid {
|
||||
|
||||
private static string[] personalHumanoidNames;
|
||||
|
||||
//public static bool HumanoidSceneInspector(SerializedObject serializedConfiguration) {
|
||||
// bool anyChanged = false;
|
||||
// SerializedProperty humanoidSceneNameProp = serializedConfiguration.FindProperty("humanoidSceneName");
|
||||
public static bool HumanoidSceneInspector(SerializedObject serializedConfiguration) {
|
||||
bool anyChanged = false;
|
||||
SerializedProperty humanoidSceneNameProp = serializedConfiguration.FindProperty("humanoidSceneName");
|
||||
|
||||
// if (HumanoidVisitors.visitors.Count <= 0)
|
||||
// return false;
|
||||
if (HumanoidVisitors.visitors.Count <= 0)
|
||||
return false;
|
||||
|
||||
// personalHumanoidNames = new string[HumanoidVisitors.visitors.Count];
|
||||
// int i = 0;
|
||||
// int ix;
|
||||
// foreach (string personalHumanoid in HumanoidVisitors.visitors) {
|
||||
// string name = personalHumanoid;
|
||||
// ix = name.LastIndexOf('/');
|
||||
// name = name.Substring(ix + 1);
|
||||
// name = name.Substring(0, name.Length - 6); // remove .unity
|
||||
// personalHumanoidNames[i++] = name;
|
||||
// }
|
||||
personalHumanoidNames = new string[HumanoidVisitors.visitors.Count];
|
||||
int i = 0;
|
||||
int ix;
|
||||
foreach (string personalHumanoid in HumanoidVisitors.visitors) {
|
||||
string name = personalHumanoid;
|
||||
ix = name.LastIndexOf('/');
|
||||
name = name.Substring(ix + 1);
|
||||
name = name.Substring(0, name.Length - 6); // remove .unity
|
||||
personalHumanoidNames[i++] = name;
|
||||
}
|
||||
|
||||
// ix = HumanoidVisitors.visitors.FindIndex(name => name == humanoidSceneNameProp.stringValue);
|
||||
// if (ix < 0)
|
||||
// ix = 0;
|
||||
// ix = EditorGUILayout.Popup("Testing Visitor", ix, personalHumanoidNames);
|
||||
// anyChanged = humanoidSceneNameProp.stringValue != HumanoidVisitors.visitors[ix];
|
||||
ix = HumanoidVisitors.visitors.FindIndex(name => name == humanoidSceneNameProp.stringValue);
|
||||
if (ix < 0)
|
||||
ix = 0;
|
||||
ix = EditorGUILayout.Popup("Testing Visitor", ix, personalHumanoidNames);
|
||||
anyChanged = humanoidSceneNameProp.stringValue != HumanoidVisitors.visitors[ix];
|
||||
if (anyChanged)
|
||||
Passer.Humanoid.HumanoidVisitors.SetPersonalHumanoid(humanoidSceneNameProp.stringValue, HumanoidVisitors.visitors[ix]);
|
||||
|
||||
// humanoidSceneNameProp.stringValue = HumanoidVisitors.visitors[ix];
|
||||
// return anyChanged;
|
||||
//}
|
||||
humanoidSceneNameProp.stringValue = HumanoidVisitors.visitors[ix];
|
||||
return anyChanged;
|
||||
}
|
||||
|
||||
public static bool OpenVRSettingUI(SerializedObject serializedConfiguration) {
|
||||
bool anyChanged = false;
|
||||
@ -429,6 +432,24 @@ namespace Passer.Humanoid {
|
||||
return anyChanged;
|
||||
}
|
||||
|
||||
public static bool VrtkSettingUI(SerializedObject serializedConfiguration) {
|
||||
|
||||
SerializedProperty vrtkSupportProp = serializedConfiguration.FindProperty("vrtkSupport");
|
||||
|
||||
if (!isVrtkSupportAvailable)
|
||||
vrtkSupportProp.boolValue = false;
|
||||
|
||||
else if (!isVrtkAvailable) {
|
||||
using (new EditorGUI.DisabledScope(true)) {
|
||||
EditorGUILayout.Toggle("VRTK Supoort", false);
|
||||
}
|
||||
EditorGUILayout.HelpBox("VRTK is not available. Please download it from the Asset Store.", MessageType.Warning, true);
|
||||
}
|
||||
else
|
||||
vrtkSupportProp.boolValue = EditorGUILayout.Toggle("VRTK Support", vrtkSupportProp.boolValue);
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool LeapSettingUI(SerializedObject serializedConfiguration) {
|
||||
SerializedProperty leapSupportProp = serializedConfiguration.FindProperty("leapSupport");
|
||||
|
||||
@ -781,6 +802,7 @@ namespace Passer.Humanoid {
|
||||
configuration.viveTrackerSupport = CheckExtensionViveTracker(configuration);
|
||||
configuration.oculusSupport = CheckExtensionOculus(configuration);
|
||||
configuration.windowsMRSupport = CheckExtensionWindowsMR(configuration);
|
||||
configuration.vrtkSupport = CheckExtensionVRTK(configuration);
|
||||
configuration.neuronSupport = CheckExtensionNeuron(configuration);
|
||||
configuration.hi5Support = CheckExtensionHi5(configuration);
|
||||
configuration.realsenseSupport = CheckExtensionRealsense(configuration);
|
||||
@ -813,7 +835,7 @@ namespace Passer.Humanoid {
|
||||
|
||||
public static bool CheckExtensionOpenVR(Configuration configuration) {
|
||||
bool enabled = true; // configuration.openVRSupport;
|
||||
CheckExtension(isViveHandTrackingAvailable & isViveHandSupportAvailable, "hVIVEHAND");
|
||||
CheckExtension(isViveHandTrackingAvailable, "hVIVEHAND");
|
||||
return CheckExtension(enabled, openVRPath, "hOPENVR");
|
||||
}
|
||||
|
||||
@ -828,12 +850,8 @@ namespace Passer.Humanoid {
|
||||
}
|
||||
|
||||
public static bool CheckExtensionViveTracker(Configuration configuration) {
|
||||
#if UNITY_STANDALONE_WIN
|
||||
bool available = isSteamVrAvailable && isViveTrackerSupportAvailable;
|
||||
#else
|
||||
bool available = false;
|
||||
#endif
|
||||
bool enabled = true; // configuration.viveTrackerSupport;
|
||||
bool available = isViveTrackerSupportAvailable;
|
||||
bool enabled = configuration.viveTrackerSupport;
|
||||
CheckExtension(available && enabled, "hVIVETRACKER");
|
||||
return available && enabled;
|
||||
}
|
||||
@ -849,16 +867,17 @@ namespace Passer.Humanoid {
|
||||
return CheckExtension(enabled, windowsMRPath, "hWINDOWSMR");
|
||||
}
|
||||
|
||||
public static bool CheckExtensionNeuron(Configuration configuration) {
|
||||
#if UNITY_STANDALONE_WIN
|
||||
bool enabled = isNeuronSupportAvailable;
|
||||
#else
|
||||
bool enabled = false;
|
||||
#endif
|
||||
CheckExtension(enabled, "hNEURON");
|
||||
public static bool CheckExtensionVRTK(Configuration configuration) {
|
||||
bool enabled = configuration.vrtkSupport && isVrtkAvailable;
|
||||
CheckExtension(enabled, "hVRTK");
|
||||
return enabled;
|
||||
}
|
||||
|
||||
public static bool CheckExtensionNeuron(Configuration configuration) {
|
||||
bool enabled = configuration.neuronSupport;
|
||||
return CheckExtension(enabled, neuronPath, "hNEURON");
|
||||
}
|
||||
|
||||
public static bool CheckExtensionHi5(Configuration configuration) {
|
||||
bool available = configuration.hi5Support;
|
||||
CheckExtension(available, "hHI5");
|
||||
@ -874,7 +893,6 @@ namespace Passer.Humanoid {
|
||||
public static bool CheckExtensionLeap(Configuration configuration) {
|
||||
bool available = isLeapAvailable && isLeapSupportAvailable;
|
||||
CheckExtension(available, "hLEAP");
|
||||
CheckExtension(isUltraLeapAvailable, "hULTRALEAP");
|
||||
configuration.leapSupport = available;
|
||||
return available;
|
||||
}
|
||||
@ -933,7 +951,6 @@ namespace Passer.Humanoid {
|
||||
|
||||
public static bool CheckExtensionOptitrack(Configuration configuration) {
|
||||
bool available = isOptitrackAvailable && isOptitrackSupportAvailable;
|
||||
available = false; // hard disable because the code currently contains bugs
|
||||
CheckExtension(available, "hOPTITRACK");
|
||||
configuration.optitrackSupport = available;
|
||||
return available;
|
||||
@ -953,7 +970,7 @@ namespace Passer.Humanoid {
|
||||
}
|
||||
|
||||
private static void CheckExtensionNetworking(Configuration configuration) {
|
||||
if (isPhotonPun2Available && isPhotonPun2SupportAvailable) {
|
||||
if (isPhotonPun2Available) {
|
||||
GlobalDefine("hPHOTON2");
|
||||
GlobalUndefine("hPHOTON1");
|
||||
//Debug.Log(isPhotonVoice2Available);
|
||||
@ -1023,7 +1040,7 @@ namespace Passer.Humanoid {
|
||||
}
|
||||
|
||||
private static void CheckFaceTracking(Configuration configuration) {
|
||||
if (DoesTypeExist("Passer.Humanoid.FaceTarget")) {
|
||||
if (IsFileAvailable(facePath)) {
|
||||
GlobalDefine("hFACE");
|
||||
}
|
||||
else {
|
||||
@ -1098,9 +1115,9 @@ namespace Passer.Humanoid {
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Availability
|
||||
#region Availability
|
||||
|
||||
public static bool DoesTypeExist(string className) {
|
||||
System.Reflection.Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies();
|
||||
@ -1111,7 +1128,7 @@ namespace Passer.Humanoid {
|
||||
return false;
|
||||
}
|
||||
|
||||
#region SDKs
|
||||
#region SDKs
|
||||
|
||||
protected static bool isUnityXRAvailable {
|
||||
get {
|
||||
@ -1120,9 +1137,6 @@ namespace Passer.Humanoid {
|
||||
return false;
|
||||
if (ConfigurationCheck.packageNameList.Contains("com.unity.xr.management"))
|
||||
return true;
|
||||
else if (ConfigurationCheck.packageNameList.Contains("com.unity.xr.oculus"))
|
||||
// Somehow management is no longer available when Oculus is used
|
||||
return true;
|
||||
else if (ConfigurationCheck.packageNameList.Contains("com.unity.xr.openxr"))
|
||||
// Somehow management is no longer available when OpenXR is used
|
||||
return true;
|
||||
@ -1136,7 +1150,8 @@ namespace Passer.Humanoid {
|
||||
|
||||
private static bool isSteamVrAvailable {
|
||||
get {
|
||||
return DoesTypeExist("Valve.VR.SteamVR");
|
||||
return false;
|
||||
//return DoesTypeExist("Valve.VR.SteamVR");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1150,15 +1165,15 @@ namespace Passer.Humanoid {
|
||||
}
|
||||
}
|
||||
|
||||
private static bool isLeapAvailable {
|
||||
private static bool isVrtkAvailable {
|
||||
get {
|
||||
return DoesTypeExist("Leap.Hand");
|
||||
return DoesTypeExist("VRTK.VRTK_SDKManager");
|
||||
}
|
||||
}
|
||||
|
||||
private static bool isUltraLeapAvailable {
|
||||
private static bool isLeapAvailable {
|
||||
get {
|
||||
return DoesTypeExist("Leap.Unity.LeapTestProvider") == false;
|
||||
return DoesTypeExist("Leap.Hand");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1278,12 +1293,6 @@ namespace Passer.Humanoid {
|
||||
}
|
||||
}
|
||||
|
||||
private static bool isViveHandSupportAvailable {
|
||||
get {
|
||||
return DoesTypeExist("Passer.Tracking.ViveHandSkeleton");
|
||||
}
|
||||
}
|
||||
|
||||
private static bool isViveTrackerSupportAvailable {
|
||||
get {
|
||||
return DoesTypeExist("Passer.Tracking.ViveTrackerComponent");
|
||||
@ -1313,6 +1322,11 @@ namespace Passer.Humanoid {
|
||||
}
|
||||
}
|
||||
#endif
|
||||
private static bool isVrtkSupportAvailable {
|
||||
get {
|
||||
return DoesTypeExist("Passer.Humanoid.VrtkTracker");
|
||||
}
|
||||
}
|
||||
|
||||
private static bool isLeapSupportAvailable {
|
||||
get {
|
||||
@ -1390,7 +1404,7 @@ namespace Passer.Humanoid {
|
||||
|
||||
private static bool isNeuronSupportAvailable {
|
||||
get {
|
||||
return DoesTypeExist("Passer.Tracking.PerceptionNeuron");
|
||||
return DoesTypeExist("Passer.Humanoid.NeuronTracker");
|
||||
}
|
||||
}
|
||||
|
||||
@ -1421,12 +1435,6 @@ namespace Passer.Humanoid {
|
||||
}
|
||||
}
|
||||
|
||||
private static bool isPhotonPun2SupportAvailable {
|
||||
get {
|
||||
return DoesTypeExist("Passer.Humanoid.HumanoidPlayerPunVoice");
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Support
|
||||
|
||||
#endregion
|
||||
@ -54,33 +54,27 @@ namespace Passer.Humanoid {
|
||||
protected void OculusHandTrackingInspector() {
|
||||
#if hOCHAND
|
||||
GUIContent labelText = new GUIContent(
|
||||
"Quest Hand Tracking",
|
||||
"Enables hand tracking on the Meta Quest"
|
||||
"Oculus Hand Tracking",
|
||||
"Enables hand tracking on the Oculus Quest"
|
||||
);
|
||||
oculusHandTrackingProp.boolValue = EditorGUILayout.ToggleLeft(labelText, oculusHandTrackingProp.boolValue);
|
||||
#endif
|
||||
}
|
||||
|
||||
protected virtual void CheckQuestManifest() {
|
||||
try {
|
||||
string manifestPath = Application.dataPath + "/Plugins/Android/AndroidManifest.xml";
|
||||
FileInfo fileInfo = new FileInfo(manifestPath);
|
||||
fileInfo.Directory.Create();
|
||||
bool manifestAvailable = File.Exists(manifestPath);
|
||||
if (manifestAvailable)
|
||||
return;
|
||||
|
||||
string humanoidPath = Configuration_Editor.FindHumanoidFolder();
|
||||
string questManifestPath = Application.dataPath.Substring(0, Application.dataPath.Length - 6) + // remove /Assets
|
||||
humanoidPath + "Extensions/Oculus/QuestManifest.xml";
|
||||
Debug.Log(questManifestPath);
|
||||
File.Copy(questManifestPath, manifestPath);
|
||||
}
|
||||
catch (System.Exception ) {
|
||||
string manifestPath = Application.dataPath + "/Plugins/Android/AndroidManifest.xml";
|
||||
FileInfo fileInfo = new FileInfo(manifestPath);
|
||||
fileInfo.Directory.Create();
|
||||
bool manifestAvailable = File.Exists(manifestPath);
|
||||
if (manifestAvailable)
|
||||
return;
|
||||
}
|
||||
|
||||
string humanoidPath = Configuration_Editor.FindHumanoidFolder();
|
||||
string questManifestPath = Application.dataPath + humanoidPath + "Extensions/Oculus/QuestManifest.xml";
|
||||
File.Copy(questManifestPath, manifestPath);
|
||||
}
|
||||
|
||||
|
||||
protected void ViveHandTrackingInspector(HumanoidControl humanoid) {
|
||||
#if hVIVEHAND
|
||||
GUIContent labelText = new GUIContent(
|
||||
@ -110,7 +104,7 @@ namespace Passer.Humanoid {
|
||||
public HeadTargetProps(SerializedObject serializedObject, HeadTarget headTarget)
|
||||
: base(serializedObject, headTarget.unityXR, headTarget, nameof(HeadTarget.unityXR)) {
|
||||
|
||||
hmdProp = serializedObject.FindProperty(nameof(HeadTarget.unityXR) + ".sensorComponent");
|
||||
hmdProp = serializedObject.FindProperty(nameof(HeadTarget.unityXR) + ".hmd");
|
||||
}
|
||||
|
||||
public override void Inspector() {
|
||||
@ -122,18 +116,17 @@ namespace Passer.Humanoid {
|
||||
|
||||
if (enabledProp.boolValue) {
|
||||
EditorGUI.indentLevel++;
|
||||
if (headTarget.unityXR.sensorComponent == null) {
|
||||
if (headTarget.unityXR.hmd == null) {
|
||||
// Hmd does not exist
|
||||
using (new EditorGUILayout.HorizontalScope()) {
|
||||
EditorGUILayout.LabelField("Hmd", GUILayout.Width(120));
|
||||
if (GUILayout.Button("Show")) {
|
||||
//headTarget.unityXR.CheckSensor(headTarget);
|
||||
headTarget.unityXR.CheckSensor(headTarget); //.GetSensorComponent();
|
||||
headTarget.unityXR.CheckSensor(headTarget);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
hmdProp.objectReferenceValue = (UnityXRHmd)EditorGUILayout.ObjectField("Hmd", headTarget.unityXR.sensorComponent, typeof(UnityXRHmd), true);
|
||||
hmdProp.objectReferenceValue = (UnityXRHmd)EditorGUILayout.ObjectField("Hmd", headTarget.unityXR.hmd, typeof(UnityXRHmd), true);
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
else
|
||||
@ -152,7 +145,7 @@ namespace Passer.Humanoid {
|
||||
public HandTargetProps(SerializedObject serializedObject, HandTarget handTarget)
|
||||
: base(serializedObject, handTarget.unityXR, handTarget, "unityXR") {
|
||||
|
||||
controllerProp = serializedObject.FindProperty("unityXR.sensorComponent");
|
||||
controllerProp = serializedObject.FindProperty("unityXR.controller");
|
||||
}
|
||||
|
||||
public override void Inspector() {
|
||||
@ -10,7 +10,6 @@ using Photon.Pun;
|
||||
#endif
|
||||
|
||||
namespace Passer {
|
||||
using Tracking;
|
||||
using Humanoid;
|
||||
|
||||
[CanEditMultipleObjects]
|
||||
@ -290,6 +289,15 @@ 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),
|
||||
|
||||
@ -297,11 +305,14 @@ namespace Passer {
|
||||
#if hWAVEVR
|
||||
new WaveVR_Editor.TrackerProps(serializedObject, targetObjs, humanoid.waveVR),
|
||||
#endif
|
||||
#if hVRTK
|
||||
new Vrtk_Editor.TrackerProps(serializedObject, targetObjs, humanoid.vrtk),
|
||||
#endif
|
||||
#if hHYDRA && (UNITY_STANDALONE_WIN || UNITY_WSA_10_0)
|
||||
new Hydra_Editor.TrackerProps(serializedObject, targetObjs, humanoid.hydra),
|
||||
#endif
|
||||
#if hLEAP && (UNITY_STANDALONE_WIN || UNITY_WSA_10_0)
|
||||
new LeapMotion_Editor.TrackerProps(serializedObject, targetObjs, humanoid.leap),
|
||||
new LeapMotion_Editor.TrackerProps(serializedObject, targetObjs, humanoid.leapTracker),
|
||||
#endif
|
||||
#if hKINECT1 && (UNITY_STANDALONE_WIN || UNITY_WSA_10_0)
|
||||
new Kinect1_Editor.TrackerProps(serializedObject, targetObjs, humanoid.kinect1),
|
||||
@ -377,11 +388,24 @@ namespace Passer {
|
||||
|
||||
#region Animations
|
||||
|
||||
private void InitAnimations(HumanoidControl humanoid) { }
|
||||
private SerializedProperty animatorParamForwardProp;
|
||||
private SerializedProperty animatorParamSidewardProp;
|
||||
private SerializedProperty animatorParamRotationProp;
|
||||
private SerializedProperty animatorParamHeightProp;
|
||||
|
||||
|
||||
private void InitAnimations(HumanoidControl humanoid) {
|
||||
|
||||
animatorParamForwardProp = serializedObject.FindProperty("animatorParameterForwardIndex");
|
||||
animatorParamSidewardProp = serializedObject.FindProperty("animatorParameterSidewardIndex");
|
||||
animatorParamRotationProp = serializedObject.FindProperty("animatorParameterRotationIndex");
|
||||
animatorParamHeightProp = serializedObject.FindProperty("animatorParameterHeightIndex");
|
||||
}
|
||||
|
||||
bool showAnimatorParameters = false;
|
||||
private void AnimatorInspector(HumanoidControl humanoid) {
|
||||
AnimatorControllerInspector(humanoid);
|
||||
AnimatorParametersInspector(humanoid);
|
||||
}
|
||||
|
||||
private void AnimatorControllerInspector(HumanoidControl humanoid) {
|
||||
@ -410,6 +434,44 @@ namespace Passer {
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
|
||||
private void AnimatorParametersInspector(HumanoidControl humanoid) {
|
||||
if (showAnimatorParameters && humanoid.animatorEnabled && humanoid.targetsRig.runtimeAnimatorController != null) {
|
||||
if (animatorParameterNames == null)
|
||||
animatorParameterNames = GetAnimatorParameters(humanoid);
|
||||
|
||||
EditorGUI.indentLevel++;
|
||||
|
||||
GUIContent forwardSpeedText = new GUIContent(
|
||||
"Forward Speed",
|
||||
"Animator parameter controlling the forward motion animation"
|
||||
);
|
||||
animatorParamForwardProp.intValue = SetAnimatorInput(forwardSpeedText, animatorParamForwardProp.intValue, ref humanoid.animatorParameterForward);
|
||||
|
||||
GUIContent sidewardSpeedText = new GUIContent(
|
||||
"Sideward Speed",
|
||||
"Animator parameter controlling the sideward motion animation"
|
||||
);
|
||||
animatorParamSidewardProp.intValue = SetAnimatorInput(sidewardSpeedText, animatorParamSidewardProp.intValue, ref humanoid.animatorParameterSideward);
|
||||
|
||||
GUIContent turnSpeedText = new GUIContent(
|
||||
"Turn Speed",
|
||||
"Animator parameter controlling the rotation animation"
|
||||
);
|
||||
animatorParamRotationProp.intValue = SetAnimatorInput(turnSpeedText, animatorParamRotationProp.intValue, ref humanoid.animatorParameterRotation);
|
||||
|
||||
GUIContent headHeightText = new GUIContent(
|
||||
"Head Height",
|
||||
"Animation parameter controlling the squatting animation"
|
||||
);
|
||||
animatorParamHeightProp.intValue = SetAnimatorInput(headHeightText, animatorParamHeightProp.intValue, ref humanoid.animatorParameterHeight);
|
||||
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
else
|
||||
showAnimatorParameters = false;
|
||||
|
||||
}
|
||||
|
||||
protected GUIContent[] animatorParameterNames;
|
||||
public GUIContent[] GetAnimatorParameters(HumanoidControl humanoid) {
|
||||
if (humanoid == null || humanoid.targetsRig.runtimeAnimatorController == null)
|
||||
@ -661,7 +723,6 @@ namespace Passer {
|
||||
CalibrateAtStartSetting();
|
||||
StartPositionSetting();
|
||||
ScalingSetting();
|
||||
FloatCorrectionSetting();
|
||||
DontDestroySetting();
|
||||
if (IsPrefab(humanoid))
|
||||
DisconnectInstancesSetting();
|
||||
@ -720,15 +781,6 @@ namespace Passer {
|
||||
scalingProp.intValue = (int)(HumanoidControl.ScalingType)EditorGUILayout.EnumPopup(text, (HumanoidControl.ScalingType)scalingProp.intValue);
|
||||
}
|
||||
|
||||
protected void FloatCorrectionSetting() {
|
||||
SerializedProperty floatCorrectionProp = serializedObject.FindProperty(nameof(HumanoidControl.floatCorrection));
|
||||
GUIContent text = new GUIContent(
|
||||
"Float Correction",
|
||||
"Correct floating avatars when user is taller than the avatar"
|
||||
);
|
||||
floatCorrectionProp.boolValue = EditorGUILayout.Toggle(text, floatCorrectionProp.boolValue);
|
||||
}
|
||||
|
||||
private void ShowTrackers(HumanoidControl humanoid, bool shown) {
|
||||
foreach (Tracker tracker in humanoid.trackers)
|
||||
tracker.ShowTracker(shown);
|
||||
@ -855,7 +907,6 @@ namespace Passer {
|
||||
else {
|
||||
humanoid.pose.Show(humanoid);
|
||||
humanoid.CopyRigToTargets();
|
||||
humanoid.MatchTargetsToAvatar();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1085,7 +1136,7 @@ namespace Passer {
|
||||
|
||||
private void RemoveControllers() {
|
||||
foreach (HumanoidSensor sensor in tracker.sensors)
|
||||
RemoveSensor(sensor.sensorComponent);
|
||||
RemoveTransform(sensor.sensorTransform);
|
||||
|
||||
if (tracker.headSensor != null)
|
||||
tracker.headSensor.RemoveController(headSensorProp);
|
||||
@ -1101,16 +1152,11 @@ namespace Passer {
|
||||
tracker.rightFootSensor.RemoveController(rightFootSensorProp);
|
||||
}
|
||||
|
||||
private void RemoveSensor(Tracking.SensorComponent sensorComponent) {
|
||||
if (sensorComponent != null)
|
||||
DestroyImmediate(sensorComponent.gameObject, true);
|
||||
private void RemoveTransform(Transform trackerTransform) {
|
||||
if (trackerTransform != null)
|
||||
DestroyImmediate(trackerTransform.gameObject, true);
|
||||
}
|
||||
|
||||
//private void RemoveTransform(Transform trackerTransform) {
|
||||
// if (trackerTransform != null)
|
||||
// DestroyImmediate(trackerTransform.gameObject, true);
|
||||
//}
|
||||
|
||||
private void SetSensors2Target() {
|
||||
foreach (HumanoidSensor sensor in tracker.sensors) {
|
||||
sensor.SetSensor2Target();
|
||||
|
Before Width: | Height: | Size: 363 B After Width: | Height: | Size: 363 B |
|
Before Width: | Height: | Size: 355 B After Width: | Height: | Size: 355 B |
@ -22,8 +22,7 @@ namespace Passer.Humanoid {
|
||||
}
|
||||
|
||||
public static GameObject GetHumanoidPlayerPrefab(string prefabPath) {
|
||||
//GameObject prefab = PrefabUtility.LoadPrefabContents(prefabPath);
|
||||
GameObject prefab = null;
|
||||
GameObject prefab = PrefabUtility.LoadPrefabContents(prefabPath);
|
||||
return prefab;
|
||||
}
|
||||
|
||||
@ -236,13 +236,7 @@ namespace Passer.Humanoid {
|
||||
if (bones[i] == null || bones[i].bone == null || bones[i].bone.transform == null)
|
||||
continue;
|
||||
|
||||
#if UNITY_2022_1_OR_NEWER
|
||||
Handles.FreeMoveHandle(bones[i].bone.transform.position, 0.002F, Vector3.zero, DotHandleCapSaveID);
|
||||
#else
|
||||
Handles.FreeMoveHandle(bones[i].bone.transform.position, bones[i].bone.transform.rotation, 0.002F, Vector3.zero, DotHandleCapSaveID);
|
||||
#endif
|
||||
|
||||
|
||||
controlIds[i] = lastControlID;
|
||||
boneIds[i] = bones[i].boneId;
|
||||
}
|
||||
@ -323,6 +317,6 @@ namespace Passer.Humanoid {
|
||||
return;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@ -33,7 +33,7 @@ namespace Passer {
|
||||
|
||||
private void InitEditors() {
|
||||
allProps = new TargetProps[] {
|
||||
#if hVIVETRACKER
|
||||
#if hOPENVR && hVIVETRACKER && (UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX)
|
||||
new ViveTracker_Editor.FootTargetProps(serializedObject, footTarget),
|
||||
#endif
|
||||
#if hKINECT1
|
||||
@ -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
|
||||
@ -63,9 +63,9 @@ namespace Passer {
|
||||
};
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Disable
|
||||
#region Disable
|
||||
public void OnDisable() {
|
||||
if (humanoid == null) {
|
||||
// This target is not connected to a humanoid, so we delete it
|
||||
@ -82,9 +82,9 @@ namespace Passer {
|
||||
foreach (TargetProps props in allProps)
|
||||
props.SetSensor2Target();
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Inspector
|
||||
#region Inspector
|
||||
public override void OnInspectorGUI() {
|
||||
if (footTarget == null || humanoid == null)
|
||||
return;
|
||||
@ -142,7 +142,7 @@ namespace Passer {
|
||||
return foundHumanoid;
|
||||
}
|
||||
|
||||
#region Sensors
|
||||
#region Sensors
|
||||
private static bool showControllers = true;
|
||||
private void ControllerInspectors(FootTarget footTarget) {
|
||||
showControllers = EditorGUILayout.Foldout(showControllers, "Controllers", true);
|
||||
@ -157,9 +157,9 @@ namespace Passer {
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Configuration
|
||||
#region Configuration
|
||||
private void InitConfiguration(FootTarget footTarget) {
|
||||
if (footTarget.humanoid.avatarRig == null)
|
||||
return;
|
||||
@ -200,7 +200,7 @@ namespace Passer {
|
||||
UpdateToesBones(target.toes);
|
||||
}
|
||||
|
||||
#region UpperLeg
|
||||
#region UpperLeg
|
||||
//private string upperLegXname;
|
||||
//private SerializedProperty upperLegMinX;
|
||||
//private SerializedProperty upperLegMaxX;
|
||||
@ -276,9 +276,9 @@ namespace Passer {
|
||||
//upperLeg.bone.maxAngles.z = upperLegMaxZ.floatValue;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region LowerLeg
|
||||
#region LowerLeg
|
||||
//private string lowerLegYname;
|
||||
//private SerializedProperty lowerLegMinX;
|
||||
//private SerializedProperty lowerLegMaxX;
|
||||
@ -326,9 +326,9 @@ namespace Passer {
|
||||
//lowerLeg.bone.minAngles.x = lowerLegMinX.floatValue;
|
||||
//lowerLeg.bone.maxAngles.x = lowerLegMaxX.floatValue;
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Foot
|
||||
#region Foot
|
||||
//private string footXname;
|
||||
//private SerializedProperty footMinX;
|
||||
//private SerializedProperty footMaxX;
|
||||
@ -390,9 +390,9 @@ namespace Passer {
|
||||
//foot.bone.minAngles.z = footMinZ.floatValue;
|
||||
//foot.bone.maxAngles.z = footMaxZ.floatValue;
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Toes
|
||||
#region Toes
|
||||
//private string toesXname;
|
||||
//private SerializedProperty toesMinX;
|
||||
//private SerializedProperty toesMaxX;
|
||||
@ -441,10 +441,10 @@ namespace Passer {
|
||||
//toes.bone.maxAngles.x = toesMaxX.floatValue;
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Settings
|
||||
#region Settings
|
||||
private SerializedProperty rotationSpeedLimitationProp;
|
||||
private SerializedProperty slidePreventionProp;
|
||||
|
||||
@ -470,9 +470,9 @@ namespace Passer {
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
}
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Events
|
||||
#region Events
|
||||
|
||||
protected SerializedProperty groundEventProp;
|
||||
|
||||
@ -534,11 +534,11 @@ namespace Passer {
|
||||
// }
|
||||
//}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
#region Scene
|
||||
#region Scene
|
||||
|
||||
public void OnSceneGUI() {
|
||||
if (footTarget == null || humanoid == null)
|
||||
@ -551,13 +551,12 @@ namespace Passer {
|
||||
humanoid.pose.UpdatePose(humanoid);
|
||||
else {
|
||||
humanoid.pose.Show(humanoid);
|
||||
humanoid.CopyRigToTargets();
|
||||
humanoid.MatchTargetsToAvatar();
|
||||
footTarget.CopyRigToTarget();
|
||||
}
|
||||
}
|
||||
|
||||
// update the target rig from the current foot target
|
||||
humanoid.CopyTargetsToRig();
|
||||
footTarget.CopyTargetToRig();
|
||||
// update the avatar bones from the target rig
|
||||
humanoid.UpdateMovements();
|
||||
// match the target rig with the new avatar pose
|
||||
@ -569,11 +568,11 @@ namespace Passer {
|
||||
humanoid.UpdateSensorsFromTargets();
|
||||
}
|
||||
|
||||
#endregion
|
||||
#endregion
|
||||
|
||||
public abstract class TargetProps {
|
||||
public SerializedProperty enabledProp;
|
||||
public SerializedProperty sensorComponentProp;
|
||||
public SerializedProperty sensorTransformProp;
|
||||
public SerializedProperty sensor2TargetPositionProp;
|
||||
public SerializedProperty sensor2TargetRotationProp;
|
||||
|
||||
@ -582,7 +581,7 @@ namespace Passer {
|
||||
|
||||
public TargetProps(SerializedObject serializedObject, LegSensor _sensor, FootTarget _footTarget, string unitySensorName) {
|
||||
enabledProp = serializedObject.FindProperty(unitySensorName + ".enabled");
|
||||
sensorComponentProp = serializedObject.FindProperty(unitySensorName + ".sensorComponent");
|
||||
sensorTransformProp = serializedObject.FindProperty(unitySensorName + ".sensorTransform");
|
||||
sensor2TargetPositionProp = serializedObject.FindProperty(unitySensorName + ".sensor2TargetPosition");
|
||||
sensor2TargetRotationProp = serializedObject.FindProperty(unitySensorName + ".sensor2TargetRotation");
|
||||
|
||||
@ -593,11 +592,11 @@ namespace Passer {
|
||||
}
|
||||
|
||||
public virtual void SetSensor2Target() {
|
||||
if (sensor.sensorComponent == null)
|
||||
if (sensor.sensorTransform == null)
|
||||
return;
|
||||
|
||||
sensor2TargetRotationProp.quaternionValue = Quaternion.Inverse(sensor.sensorComponent.transform.rotation) * footTarget.foot.target.transform.rotation;
|
||||
sensor2TargetPositionProp.vector3Value = -footTarget.foot.target.transform.InverseTransformPoint(sensor.sensorComponent.transform.position);
|
||||
sensor2TargetRotationProp.quaternionValue = Quaternion.Inverse(sensor.sensorTransform.rotation) * footTarget.foot.target.transform.rotation;
|
||||
sensor2TargetPositionProp.vector3Value = -footTarget.foot.target.transform.InverseTransformPoint(sensor.sensorTransform.position);
|
||||
}
|
||||
|
||||
public abstract void Inspector();
|
||||
@ -44,8 +44,17 @@ namespace Passer.Humanoid {
|
||||
#if pUNITYXR
|
||||
new UnityXR_Editor.HandTargetProps(serializedObject, handTarget),
|
||||
#endif
|
||||
//#if hOPENVR && (UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX)
|
||||
// new OpenVR_Editor.HandTargetProps(serializedObject, handTarget),
|
||||
//#if hVIVETRACKER
|
||||
// new ViveTracker_Editor.HandTargetProps(serializedObject, handTarget),
|
||||
//#endif
|
||||
//#endif
|
||||
#if hSTEAMVR && UNITY_STANDALONE_WIN
|
||||
//new SteamVR_Editor.HandTargetProps(serializedObject, handTarget),
|
||||
#if hVIVETRACKER
|
||||
new ViveTracker_Editor.HandTargetProps(serializedObject, handTarget),
|
||||
//new ViveTracker_Editor.HandTargetProps(serializedObject, handTarget),
|
||||
#endif
|
||||
#endif
|
||||
//#if hOCULUS && (UNITY_STANDALONE_WIN || UNITY_ANDROID)
|
||||
// new Oculus_Editor.HandTargetProps(serializedObject, handTarget),
|
||||
@ -56,6 +65,9 @@ namespace Passer.Humanoid {
|
||||
#if hWAVEVR
|
||||
new WaveVR_Editor.HandTargetProps(serializedObject, handTarget),
|
||||
#endif
|
||||
#if hVRTK
|
||||
new Vrtk_Editor.HandTargetProps(serializedObject, handTarget),
|
||||
#endif
|
||||
#if hLEAP
|
||||
new LeapMotion_Editor.HandTargetProps(serializedObject, handTarget),
|
||||
#endif
|
||||
@ -74,9 +86,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
|
||||
@ -145,6 +157,8 @@ namespace Passer.Humanoid {
|
||||
InteractionPointerButton(handTarget);
|
||||
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
//serializedObject.Update();
|
||||
//serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
public static HandTarget Inspector(HandTarget handTarget, string name) {
|
||||
@ -437,8 +451,8 @@ namespace Passer.Humanoid {
|
||||
if (showSettings) {
|
||||
EditorGUI.indentLevel++;
|
||||
|
||||
SerializedProperty showObjectsProp = serializedObject.FindProperty("_showRealObjects");
|
||||
bool showRealObjects = EditorGUILayout.Toggle("Show Real Objects", showObjectsProp.boolValue);
|
||||
// Cannot use serializedPropery because showRealObjects is a getter/setter
|
||||
bool showRealObjects = EditorGUILayout.Toggle("Show Real Objects", handTarget.showRealObjects);
|
||||
if (showRealObjects != handTarget.showRealObjects) {
|
||||
handTarget.showRealObjects = showRealObjects;
|
||||
handTarget.ShowSensors(showRealObjects, true);
|
||||
@ -695,13 +709,12 @@ namespace Passer.Humanoid {
|
||||
humanoid.pose.UpdatePose(humanoid);
|
||||
else {
|
||||
humanoid.pose.Show(humanoid);
|
||||
humanoid.CopyRigToTargets();
|
||||
humanoid.MatchTargetsToAvatar();
|
||||
handTarget.CopyRigToTarget();
|
||||
}
|
||||
}
|
||||
|
||||
// update the target rig from the current hand target
|
||||
humanoid.CopyTargetsToRig();
|
||||
handTarget.CopyTargetToRig();
|
||||
// update the avatar bones from the target rig
|
||||
humanoid.UpdateMovements();
|
||||
// match the target rig with the new avatar pose
|
||||
@ -717,8 +730,7 @@ namespace Passer.Humanoid {
|
||||
|
||||
public abstract class TargetProps {
|
||||
public SerializedProperty enabledProp;
|
||||
//public SerializedProperty sensorTransformProp;
|
||||
public SerializedProperty sensorComponentProp;
|
||||
public SerializedProperty sensorTransformProp;
|
||||
public SerializedProperty sensor2TargetPositionProp;
|
||||
public SerializedProperty sensor2TargetRotationProp;
|
||||
|
||||
@ -727,8 +739,7 @@ namespace Passer.Humanoid {
|
||||
|
||||
public TargetProps(SerializedObject serializedObject, Humanoid.ArmSensor _sensor, HandTarget _handTarget, string unitySensorName) {
|
||||
enabledProp = serializedObject.FindProperty(unitySensorName + ".enabled");
|
||||
//sensorTransformProp = serializedObject.FindProperty(unitySensorName + ".sensorTransform");
|
||||
sensorComponentProp = serializedObject.FindProperty(unitySensorName + ".sensorComponent");
|
||||
sensorTransformProp = serializedObject.FindProperty(unitySensorName + ".sensorTransform");
|
||||
sensor2TargetPositionProp = serializedObject.FindProperty(unitySensorName + ".sensor2TargetPosition");
|
||||
sensor2TargetRotationProp = serializedObject.FindProperty(unitySensorName + ".sensor2TargetRotation");
|
||||
|
||||
@ -34,8 +34,10 @@ namespace Passer.Humanoid {
|
||||
#if pUNITYXR
|
||||
new UnityXR_Editor.HeadTargetProps(serializedObject, headTarget),
|
||||
#endif
|
||||
#if hSTEAMVR && UNITY_STANDALONE_WIN
|
||||
#if hVIVETRACKER
|
||||
new ViveTracker_Editor.HeadTargetProps(serializedObject, headTarget),
|
||||
//new ViveTracker_Editor.HeadTargetProps(serializedObject, headTarget),
|
||||
#endif
|
||||
#endif
|
||||
#if hWINDOWSMR && UNITY_WSA_10_0
|
||||
new WindowsMR_Editor.HeadTargetProps(serializedObject, headTarget),
|
||||
@ -43,6 +45,9 @@ namespace Passer.Humanoid {
|
||||
#if hWAVEVR
|
||||
new WaveVR_Editor.HeadTargetProps(serializedObject, headTarget),
|
||||
#endif
|
||||
#if hVRTK
|
||||
new Vrtk_Editor.HeadTargetProps(serializedObject, headTarget),
|
||||
#endif
|
||||
#if hREALSENSE
|
||||
new Realsense_Editor.HeadTargetProps(serializedObject, headTarget),
|
||||
#endif
|
||||
@ -61,9 +66,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
|
||||
@ -172,7 +177,7 @@ namespace Passer.Humanoid {
|
||||
showControllers = EditorGUILayout.Foldout(showControllers, "Controllers", true);
|
||||
if (showControllers) {
|
||||
EditorGUI.indentLevel++;
|
||||
//FirstPersonCameraInspector(headTarget);
|
||||
FirstPersonCameraInspector(headTarget);
|
||||
ScreenInspector(headTarget);
|
||||
|
||||
foreach (TargetProps props in allProps)
|
||||
@ -275,7 +280,7 @@ namespace Passer.Humanoid {
|
||||
if (headTarget.humanoid == null)
|
||||
return;
|
||||
|
||||
SerializedProperty animatorProp = serializedObject.FindProperty(nameof(HeadTarget.headAnimator) + "." + nameof(HeadTarget.headAnimator.enabled));
|
||||
SerializedProperty animatorProp = serializedObject.FindProperty(nameof(HeadTarget.headAnimator)+ "." +nameof(HeadTarget.headAnimator.enabled));
|
||||
if (animatorProp != null && headTarget.humanoid.animatorEnabled) {
|
||||
|
||||
GUIContent text = new GUIContent(
|
||||
@ -482,13 +487,12 @@ namespace Passer.Humanoid {
|
||||
humanoid.pose.UpdatePose(humanoid);
|
||||
else {
|
||||
humanoid.pose.Show(humanoid);
|
||||
humanoid.CopyRigToTargets();
|
||||
humanoid.MatchTargetsToAvatar();
|
||||
headTarget.CopyRigToTarget();
|
||||
}
|
||||
}
|
||||
|
||||
// update the target rig from the current head target
|
||||
humanoid.CopyTargetsToRig();
|
||||
headTarget.CopyTargetToRig();
|
||||
// update the avatar bones from the target rig
|
||||
humanoid.UpdateMovements();
|
||||
// match the target rig with the new avatar pose
|
||||
@ -505,8 +509,7 @@ namespace Passer.Humanoid {
|
||||
|
||||
public abstract class TargetProps {
|
||||
public SerializedProperty enabledProp;
|
||||
//public SerializedProperty sensorTransformProp;
|
||||
public SerializedProperty sensorComponentProp;
|
||||
public SerializedProperty sensorTransformProp;
|
||||
public SerializedProperty sensor2TargetPositionProp;
|
||||
public SerializedProperty sensor2TargetRotationProp;
|
||||
|
||||
@ -515,7 +518,7 @@ namespace Passer.Humanoid {
|
||||
|
||||
public TargetProps(SerializedObject serializedObject, HeadSensor _sensor, HeadTarget _headTarget, string unitySensorName) {
|
||||
enabledProp = serializedObject.FindProperty(unitySensorName + ".enabled");
|
||||
sensorComponentProp = serializedObject.FindProperty(unitySensorName + ".sensorComponent");
|
||||
sensorTransformProp = serializedObject.FindProperty(unitySensorName + ".sensorTransform");
|
||||
sensor2TargetPositionProp = serializedObject.FindProperty(unitySensorName + ".sensor2TargetPosition");
|
||||
sensor2TargetRotationProp = serializedObject.FindProperty(unitySensorName + ".sensor2TargetRotation");
|
||||
|
||||
@ -526,11 +529,11 @@ namespace Passer.Humanoid {
|
||||
}
|
||||
|
||||
public virtual void SetSensor2Target() {
|
||||
if (sensor.sensorComponent == null)
|
||||
if (sensor.sensorTransform == null)
|
||||
return;
|
||||
|
||||
sensor2TargetRotationProp.quaternionValue = Quaternion.Inverse(sensor.sensorComponent.transform.rotation) * headTarget.head.target.transform.rotation;
|
||||
sensor2TargetPositionProp.vector3Value = -headTarget.head.target.transform.InverseTransformPoint(sensor.sensorComponent.transform.position);
|
||||
sensor2TargetRotationProp.quaternionValue = Quaternion.Inverse(sensor.sensorTransform.rotation) * headTarget.head.target.transform.rotation;
|
||||
sensor2TargetPositionProp.vector3Value = -headTarget.head.target.transform.InverseTransformPoint(sensor.sensorTransform.position);
|
||||
}
|
||||
|
||||
public abstract void Inspector();
|
||||
@ -32,7 +32,7 @@ namespace Passer {
|
||||
|
||||
private void InitEditors() {
|
||||
allProps = new TargetProps[] {
|
||||
#if hVIVETRACKER
|
||||
#if hOPENVR && hVIVETRACKER && (UNITY_STANDALONE_WIN || UNITY_STANDALONE_OSX)
|
||||
new ViveTracker_Editor.HipsTargetProps(serializedObject, hipsTarget),
|
||||
#endif
|
||||
#if hKINECT1
|
||||
@ -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
|
||||
@ -276,13 +276,12 @@ namespace Passer {
|
||||
humanoid.pose.UpdatePose(humanoid);
|
||||
else {
|
||||
humanoid.pose.Show(humanoid);
|
||||
humanoid.CopyRigToTargets();
|
||||
humanoid.MatchTargetsToAvatar();
|
||||
hipsTarget.CopyRigToTarget();
|
||||
}
|
||||
}
|
||||
|
||||
// update the target rig from the current hips target
|
||||
humanoid.CopyTargetsToRig();
|
||||
hipsTarget.CopyTargetToRig();
|
||||
// update the avatar bones to match the target rig
|
||||
humanoid.UpdateMovements();
|
||||
// match the target rig with the new avatar pose
|
||||
@ -298,8 +297,7 @@ namespace Passer {
|
||||
|
||||
public abstract class TargetProps {
|
||||
public SerializedProperty enabledProp;
|
||||
//public SerializedProperty sensorTransformProp;
|
||||
public SerializedProperty sensorComponentProp;
|
||||
public SerializedProperty sensorTransformProp;
|
||||
public SerializedProperty sensor2TargetPositionProp;
|
||||
public SerializedProperty sensor2TargetRotationProp;
|
||||
|
||||
@ -308,8 +306,7 @@ namespace Passer {
|
||||
|
||||
public TargetProps(SerializedObject serializedObject, TorsoSensor _sensor, HipsTarget _hipsTarget, string unitySensorName) {
|
||||
enabledProp = serializedObject.FindProperty(unitySensorName + ".enabled");
|
||||
//sensorTransformProp = serializedObject.FindProperty(unitySensorName + ".sensorTransform");
|
||||
sensorComponentProp = serializedObject.FindProperty(unitySensorName + ".sensorComponent");
|
||||
sensorTransformProp = serializedObject.FindProperty(unitySensorName + ".sensorTransform");
|
||||
sensor2TargetPositionProp = serializedObject.FindProperty(unitySensorName + ".sensor2TargetPosition");
|
||||
sensor2TargetRotationProp = serializedObject.FindProperty(unitySensorName + ".sensor2TargetRotation");
|
||||
|
||||
@ -320,11 +317,11 @@ namespace Passer {
|
||||
}
|
||||
|
||||
public virtual void SetSensor2Target() {
|
||||
if (sensor.sensorComponent == null)
|
||||
if (sensor.sensorTransform == null)
|
||||
return;
|
||||
|
||||
sensor2TargetRotationProp.quaternionValue = Quaternion.Inverse(sensor.sensorComponent.transform.rotation) * hipsTarget.hips.target.transform.rotation;
|
||||
sensor2TargetPositionProp.vector3Value = -hipsTarget.hips.target.transform.InverseTransformPoint(sensor.sensorComponent.transform.position);
|
||||
sensor2TargetRotationProp.quaternionValue = Quaternion.Inverse(sensor.sensorTransform.rotation) * hipsTarget.hips.target.transform.rotation;
|
||||
sensor2TargetPositionProp.vector3Value = -hipsTarget.hips.target.transform.InverseTransformPoint(sensor.sensorTransform.position);
|
||||
}
|
||||
|
||||
public abstract void Inspector();
|
||||
@ -7,8 +7,7 @@
|
||||
"PhotonVoice",
|
||||
"PhotonVoice.PUN",
|
||||
"PhotonRealtime",
|
||||
"PhotonVoice.API",
|
||||
"SteamVR"
|
||||
"PhotonVoice.API"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
|
||||
@ -12,7 +12,7 @@ using UnityEditor;
|
||||
namespace Passer {
|
||||
|
||||
[CustomEditor(typeof(Possessable))]
|
||||
public class Possessable_Editor : Editor {
|
||||
public class Possession_Editor : Editor {
|
||||
|
||||
protected Possessable possession;
|
||||
|
||||
@ -42,16 +42,13 @@ namespace Passer {
|
||||
Scene activeScene = UnityEngine.SceneManagement.SceneManager.GetActiveScene();
|
||||
|
||||
if (IsPrefab(possession.gameObject)) {
|
||||
//Debug.Log("is prefab");
|
||||
Debug.Log("is prefab");
|
||||
possession.assetPath = AssetDatabase.GetAssetPath(possession.gameObject);
|
||||
|
||||
string scenePath = activeScene.path;
|
||||
AssetImporter assetImporter = AssetImporter.GetAtPath(possession.assetPath);
|
||||
if (assetImporter != null)
|
||||
// HACK: force avatars to avatarhops because we cannot change assetbundle in package prefabs
|
||||
assetImporter.assetBundleName = activeScene.name + "_possessions";
|
||||
|
||||
Debug.Log(possession.gameObject + ": Set AssetBundleName to " + assetImporter.assetBundleName + " - " + possession.siteLocation);
|
||||
assetImporter.assetBundleName = "possessions"; //activeScene.name + "_possessions";
|
||||
return;
|
||||
}
|
||||
|
||||
@ -61,9 +58,8 @@ namespace Passer {
|
||||
|
||||
string scenePath = activeScene.path;
|
||||
AssetImporter assetImporter = AssetImporter.GetAtPath(possession.assetPath);
|
||||
// HACK: force avatars to avatarhops because we cannot change assetbundle in package prefabs
|
||||
assetImporter.assetBundleName = activeScene.name + "_possessions";
|
||||
Debug.Log(possession.gameObject + ": Set AssetBundleName to " + assetImporter.assetBundleName + " - " + possession.siteLocation);
|
||||
assetImporter.assetBundleName = "possessions"; //activeScene.name + "_possessions";
|
||||
//Debug.Log(possession.gameObject + ": Set AssetBundleName to " + assetImporter.assetBundleName);
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,7 +15,6 @@ namespace Passer {
|
||||
/// by selecting the appropriate sites in the dialog:
|
||||
///
|
||||
/// \image html BuildSitesDialog.png
|
||||
/// \image rtf BuildSitesDialog.png
|
||||
///
|
||||
/// When the Build button is pressed, all sites will be build and become available in the Assets/SiteBuilds folder
|
||||
/// with a submap for each platform (like Windows, Android...)
|
||||
@ -37,6 +36,38 @@ namespace Passer {
|
||||
window.ShowUtility();
|
||||
}
|
||||
|
||||
private static void GenerateSiteBuilds() {
|
||||
string[] assetbundles = AssetDatabase.GetAllAssetBundleNames();
|
||||
|
||||
if (assetbundles.Length > 0) {
|
||||
if (siteBuilds == null) {
|
||||
siteBuilds = AssetDatabase.LoadAssetAtPath<Sites>("Assets/SiteBuilds/SiteList.asset");
|
||||
if (siteBuilds == null) {
|
||||
if (!Directory.Exists("Assets/SiteBuilds"))
|
||||
Directory.CreateDirectory("Assets/SiteBuilds");
|
||||
|
||||
siteBuilds = (Sites)ScriptableObject.CreateInstance(typeof(Sites));
|
||||
AssetDatabase.CreateAsset(siteBuilds, "Assets/SiteBuilds/SiteList.asset");
|
||||
}
|
||||
}
|
||||
}
|
||||
bool hasChanged = false;
|
||||
|
||||
for (int i = 0; i < assetbundles.Length; i++) {
|
||||
Sites.SiteBuild siteBuild = siteBuilds.list.Find(sb => sb.siteName == assetbundles[i]);
|
||||
if (siteBuild == null) {
|
||||
siteBuild = new Sites.SiteBuild() {
|
||||
siteName = assetbundles[i],
|
||||
enabled = true,
|
||||
};
|
||||
siteBuilds.list.Add(siteBuild);
|
||||
hasChanged = true;
|
||||
}
|
||||
}
|
||||
if (hasChanged)
|
||||
AssetDatabase.SaveAssets();
|
||||
}
|
||||
|
||||
private Vector2 scrollPos;
|
||||
|
||||
private void OnGUI() {
|
||||
@ -64,55 +95,6 @@ namespace Passer {
|
||||
}
|
||||
}
|
||||
|
||||
public static void GenerateSiteBuilds() {
|
||||
string[] assetbundles = AssetDatabase.GetAllAssetBundleNames();
|
||||
|
||||
if (assetbundles.Length > 0) {
|
||||
if (siteBuilds == null) {
|
||||
siteBuilds = AssetDatabase.LoadAssetAtPath<Sites>("Assets/SiteBuilds/SiteList.asset");
|
||||
if (siteBuilds == null) {
|
||||
if (!Directory.Exists("Assets/SiteBuilds"))
|
||||
Directory.CreateDirectory("Assets/SiteBuilds");
|
||||
|
||||
siteBuilds = (Sites)ScriptableObject.CreateInstance(typeof(Sites));
|
||||
AssetDatabase.CreateAsset(siteBuilds, "Assets/SiteBuilds/SiteList.asset");
|
||||
}
|
||||
}
|
||||
}
|
||||
bool hasChanged = false;
|
||||
|
||||
for (int i = 0; i < assetbundles.Length; i++) {
|
||||
PrepareSite(assetbundles[i]);
|
||||
|
||||
Sites.SiteBuild siteBuild = siteBuilds.list.Find(sb => sb.siteName == assetbundles[i]);
|
||||
if (siteBuild == null) {
|
||||
siteBuild = new Sites.SiteBuild() {
|
||||
siteName = assetbundles[i],
|
||||
enabled = true,
|
||||
};
|
||||
siteBuilds.list.Add(siteBuild);
|
||||
hasChanged = true;
|
||||
}
|
||||
}
|
||||
if (hasChanged)
|
||||
AssetDatabase.SaveAssets();
|
||||
}
|
||||
|
||||
private static void PrepareSite(string sitename) {
|
||||
string[] paths = AssetDatabase.GetAssetPathsFromAssetBundleAndAssetName(sitename, sitename);
|
||||
if (paths.Length == 0)
|
||||
return;
|
||||
|
||||
Scene scene = UnityEditor.SceneManagement.EditorSceneManager.OpenScene(paths[0]);
|
||||
if (scene == null) {
|
||||
Debug.Log("Could not load " + sitename);
|
||||
return;
|
||||
}
|
||||
Debug.Log("Prepare " + sitename);
|
||||
NetworkObject_Check.CheckNetworkObjects();
|
||||
UnityEditor.SceneManagement.EditorSceneManager.SaveScene(UnityEngine.SceneManagement.SceneManager.GetActiveScene());
|
||||
}
|
||||
|
||||
private static void StartBuildToFolder() {
|
||||
string savePath = EditorUtility.SaveFolderPanel("Target folder", "", "");
|
||||
BuildSites(savePath);
|
||||
|
||||
@ -9,54 +9,42 @@ namespace Passer {
|
||||
public class SiteNavigator_Editor : Editor {
|
||||
protected SiteNavigator siteNavigator;
|
||||
|
||||
//protected string[] siteNames;
|
||||
protected string[] siteNames;
|
||||
|
||||
#region Enable
|
||||
|
||||
protected virtual void OnEnable() {
|
||||
siteNavigator = (SiteNavigator)target;
|
||||
|
||||
//InitializeSiteNames();
|
||||
InitializeSiteNames();
|
||||
}
|
||||
|
||||
//protected virtual void InitializeSiteNames() {
|
||||
// //HumanoidVisitors.CheckScenes();
|
||||
// //List<string> humanoidVisitors = HumanoidVisitors.visitors;
|
||||
protected virtual void InitializeSiteNames() {
|
||||
EditorBuildSettingsScene[] editorBuildSettingsScenes = EditorBuildSettings.scenes;
|
||||
int siteCount = editorBuildSettingsScenes.Length - HumanoidVisitors.visitors.Count;
|
||||
|
||||
// EditorBuildSettingsScene[] editorBuildSettingsScenes = EditorBuildSettings.scenes;
|
||||
// int siteCount = editorBuildSettingsScenes.Length; // - HumanoidVisitors.visitors.Count;
|
||||
List<string> siteList = new List<string>();
|
||||
siteList.Add("-none-");
|
||||
int j = 0;
|
||||
for (int i = 0; i < siteCount; i++) {
|
||||
if (!editorBuildSettingsScenes[j].enabled) {
|
||||
j++;
|
||||
continue;
|
||||
}
|
||||
|
||||
// List<string> siteList = new List<string>();
|
||||
// siteList.Add("-none-");
|
||||
// for (int i = 0; i < siteCount; i++) {
|
||||
// if (!editorBuildSettingsScenes[i].enabled) {
|
||||
// continue;
|
||||
// }
|
||||
string sceneName = editorBuildSettingsScenes[j].path;
|
||||
int lastSlash = sceneName.LastIndexOf('/');
|
||||
sceneName = sceneName.Substring(lastSlash + 1);
|
||||
sceneName = sceneName.Substring(0, sceneName.Length - 6); // remove .unity
|
||||
|
||||
// string sceneName = editorBuildSettingsScenes[i].path;
|
||||
// if (sceneName.Length > 6) {
|
||||
// int lastSlash = sceneName.LastIndexOf('/');
|
||||
// sceneName = sceneName.Substring(lastSlash + 1);
|
||||
// sceneName = sceneName.Substring(0, sceneName.Length - 6); // remove .unity
|
||||
|
||||
// // Does not work at the moment the visitors are all scenes
|
||||
// //bool isVisitor = IsHumanoidVisitor(sceneName, humanoidVisitors);
|
||||
// //if (!isVisitor) {
|
||||
// siteList.Add(sceneName);
|
||||
// //}
|
||||
// }
|
||||
// }
|
||||
// siteNames = siteList.ToArray();//new string[siteCount];
|
||||
//}
|
||||
|
||||
private bool IsHumanoidVisitor(string sceneName, List<string> humanoidVisitors) {
|
||||
foreach(string visitor in humanoidVisitors) {
|
||||
int lastSlash = visitor.LastIndexOf('/');
|
||||
string visitorSceneName = visitor.Substring(lastSlash + 1, visitor.Length - lastSlash - 7);
|
||||
if (visitorSceneName == sceneName)
|
||||
return true;
|
||||
bool isVisitor = HumanoidVisitors.visitors.Contains(sceneName);
|
||||
if (!isVisitor) {
|
||||
//siteNames[i] = sceneName;
|
||||
siteList.Add(sceneName);
|
||||
j++;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
siteNames = siteList.ToArray();//new string[siteCount];
|
||||
}
|
||||
|
||||
#endregion Enable
|
||||
@ -94,17 +82,34 @@ namespace Passer {
|
||||
}
|
||||
|
||||
protected void StartSceneInspector() {
|
||||
SerializedProperty startSceneProp = serializedObject.FindProperty(nameof(siteNavigator.startScene));
|
||||
SceneAsset sceneAsset = AssetDatabase.LoadAssetAtPath<SceneAsset>(startSceneProp.stringValue);
|
||||
|
||||
GUIContent text = new GUIContent(
|
||||
"Start Scene",
|
||||
""
|
||||
);
|
||||
sceneAsset = (SceneAsset)EditorGUILayout.ObjectField(text, sceneAsset, typeof(SceneAsset), false);
|
||||
|
||||
startSceneProp.stringValue = AssetDatabase.GetAssetPath(sceneAsset);
|
||||
SerializedProperty startSceneProp = serializedObject.FindProperty(nameof(siteNavigator.startScene));
|
||||
|
||||
if (siteNames == null || siteNames.Length == 0) {
|
||||
startSceneProp.stringValue = "";
|
||||
return;
|
||||
}
|
||||
|
||||
int ix = 0;
|
||||
for (; ix < siteNames.Length; ix++) {
|
||||
if (siteNames[ix] == startSceneProp.stringValue)
|
||||
break;
|
||||
}
|
||||
if (ix == siteNames.Length) ix = 0;
|
||||
if (Application.isPlaying) {
|
||||
using (new EditorGUI.DisabledScope(true)) {
|
||||
EditorGUILayout.Popup(text, ix, siteNames);
|
||||
}
|
||||
}
|
||||
else {
|
||||
|
||||
ix = EditorGUILayout.Popup(text, ix, siteNames);
|
||||
startSceneProp.stringValue = siteNames[ix];
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Inspector
|
||||
|
||||
@ -4,7 +4,6 @@ using UnityEngine;
|
||||
namespace Passer {
|
||||
using Humanoid;
|
||||
|
||||
[CanEditMultipleObjects]
|
||||
[CustomEditor(typeof(Handle), true)]
|
||||
public class Handle_Editor : Editor {
|
||||
|
||||
@ -43,14 +42,9 @@ namespace Passer {
|
||||
//if (HumanoidPreferences.help)
|
||||
// EditorGUILayout.HelpBox("Component to specify behaviour when grabbing the GameObject", MessageType.None);
|
||||
|
||||
SerializedProperty handProp = serializedObject.FindProperty(nameof(Handle.hand));
|
||||
handProp.intValue = (int)(Handle.Hand)EditorGUILayout.EnumPopup("Hand", (Handle.Hand)handProp.intValue);
|
||||
|
||||
SerializedProperty grabTypeProp = serializedObject.FindProperty(nameof(Handle.grabType));
|
||||
grabTypeProp.intValue = (int)(Handle.GrabType)EditorGUILayout.EnumPopup("Grab type", (Handle.GrabType)grabTypeProp.intValue);
|
||||
|
||||
SerializedProperty rangeProp = serializedObject.FindProperty(nameof(Handle.range));
|
||||
rangeProp.floatValue = EditorGUILayout.FloatField("Range", rangeProp.floatValue);
|
||||
handle.hand = (Handle.Hand)EditorGUILayout.EnumPopup("Hand", handle.hand);
|
||||
handle.grabType = (Handle.GrabType)EditorGUILayout.EnumPopup("Grab type", handle.grabType);
|
||||
handle.range = EditorGUILayout.FloatField("Range", handle.range);
|
||||
|
||||
HandPoseInspector(handle);
|
||||
CheckHandTarget(handle);
|
||||
|
||||
@ -4,7 +4,7 @@ using UnityEngine;
|
||||
namespace Passer {
|
||||
using Humanoid;
|
||||
|
||||
[CustomEditor(typeof(ControllerInput), true)]
|
||||
[CustomEditor(typeof(ControllerInput))]
|
||||
public class ControllerInput_Editor : Editor {
|
||||
protected ControllerInput controllerInput;
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
using UnityEngine;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Build;
|
||||
#if UNITY_2021_2_OR_NEWER
|
||||
using UnityEditor.SceneManagement;
|
||||
#else
|
||||
@ -11,26 +10,14 @@ namespace Passer {
|
||||
|
||||
[InitializeOnLoad]
|
||||
public class NetworkObject_Check {
|
||||
public int callbackOrder => 0;
|
||||
|
||||
public void OnPreprocessBuild(UnityEditor.Build.Reporting.BuildReport report) {
|
||||
CheckNetworkObjects();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>Check if this gameObject has the right network transform code</summary>
|
||||
static NetworkObject_Check() {
|
||||
CheckNetworkObjects();
|
||||
}
|
||||
|
||||
public static void CheckNetworkObjects() {
|
||||
NetworkObject[] networkObjects = Object.FindObjectsOfType<NetworkObject>();
|
||||
|
||||
foreach (NetworkObject networkObject in networkObjects)
|
||||
CheckForNetworkObject(networkObject.gameObject);
|
||||
}
|
||||
|
||||
|
||||
public static void CheckForNetworkObject(GameObject gameObject) {
|
||||
CheckNetworkObjectNone(gameObject);
|
||||
CheckNetworkObjectUnet(gameObject);
|
||||
@ -111,13 +98,6 @@ namespace Passer {
|
||||
Photon.Pun.PhotonView photonView = gameObject.GetComponent<Photon.Pun.PhotonView>();
|
||||
if (photonView == null)
|
||||
photonView = gameObject.AddComponent<Photon.Pun.PhotonView>();
|
||||
if (photonView.ViewID == 0) {
|
||||
NetworkObject networkObject = gameObject.GetComponent<NetworkObject>();
|
||||
if (networkObject != null && networkObject.objectIdentity != 0)
|
||||
photonView.ViewID = (int)networkObject.objectIdentity;
|
||||
else
|
||||
Photon.Pun.PhotonNetwork.AllocateViewID(photonView);
|
||||
}
|
||||
|
||||
Photon.Pun.PhotonTransformView transformView = gameObject.GetComponent<Photon.Pun.PhotonTransformView>();
|
||||
if (transformView == null) {
|
||||
|
||||
@ -76,20 +76,17 @@ namespace Passer.Humanoid {
|
||||
}
|
||||
|
||||
protected virtual void AttachPrefab(Socket socket, SerializedProperty attachedTransformProp, GameObject prefab) {
|
||||
SerializedProperty attachedHandleProp = serializedObject.FindProperty("attachedHandle");
|
||||
|
||||
if (attachedTransformProp.objectReferenceValue != null)
|
||||
ReleaseObject(socket, attachedTransformProp);
|
||||
|
||||
GameObject obj = Instantiate(prefab, socket.transform.position, socket.transform.rotation);
|
||||
obj.name = prefab.name; // Remove the (Clone)
|
||||
|
||||
socket.Attach(obj.transform, false);
|
||||
socket.Attach(obj.transform);
|
||||
if (socket.attachedTransform == null)
|
||||
Debug.LogWarning("Could not attach transform");
|
||||
else {
|
||||
attachedTransformProp.objectReferenceValue = obj;
|
||||
attachedHandleProp.objectReferenceValue = socket.attachedHandle;
|
||||
//Handle handle = socket.attachedHandle;
|
||||
//if (handle == null)
|
||||
// Handle.Create(obj, socket);
|
||||
|
||||
Binary file not shown.
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ef89ebf080626664e9353fa0565b680e
|
||||
guid: 4465d1dbeab5b4e48a3b1a5a237ce59a
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
18
README.md
18
README.md
@ -1,25 +1,19 @@
|
||||
Installation
|
||||
============
|
||||
You can import the Humanoid Control Free package in Unity directly with the Package Manager git package importer.
|
||||
Import this package in Unity directlywith the Package Manager git package importer
|
||||
|
||||
See [Unity: Installing from a Git URL](https://docs.unity3d.com/Manual/upm-ui-giturl.html)
|
||||
|
||||
Use the link from 'Clone with HTTP' (for example: https://git.passer.life/HumanoidControl/HumanoidControl_Free.git)
|
||||
In this way you can always retrieve the latest version by pressing the `Update` button in the Package Manager.
|
||||
Use the link from 'Clone with HTTP' (for example: https://http://gitlab.passervr.com/passer/unity/humanoidcontrol4_free.git)
|
||||
In this way you can always retrieve the latest version by pressing the Update button in the Package Manager.
|
||||
|
||||
Optionally, you can use a tag to retrieve a specific version. For example:https://git.passer.life/HumanoidControl/HumanoidControl_Free.git#4.1.0.
|
||||
Optionally, you can use a tag to retrieve a specific version. For example:http://gitlab.passervr.com/passer/unity/humanoidcontrol4_free.git#4.1.0.
|
||||
This will give you a stable version which does not change. Updating can be done by retrieving the package with a link to a new release.
|
||||
|
||||
ChangeLog and Releases
|
||||
======================
|
||||
All releases with UnityPackages and links for the Unity Package Manager: [Tags page](https://git.passer.life/HumanoidControl/HumanoidControl_Free/tags).
|
||||
|
||||
An RSS/Atom feed with all releases can be found on the [Tags page](https://git.passer.life/HumanoidControl/HumanoidControl_Free/tags). Click on the _RSS Feed_ icon in the top-right corner to retrieve the feed.
|
||||
You will find all releases with links which can be used in the Unity Package Manager here: https://gitlab.passervr.com/passer/unity/humanoidcontrol4_free/-/releases
|
||||
|
||||
Documentation
|
||||
=============
|
||||
For the latest version of the documentation, see [PasserVR HumanoidControl Documentation](https://docs.humanoidcontrol.com/)
|
||||
|
||||
Video
|
||||
=====
|
||||
[](https://passervr.com/PasserVR/videos/HC4Free.mp4)
|
||||
See [PasserVR HumanoidControl Documentation](https://passervr.com/apis/HumanoidControl/Unity/index.html)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 9bd4d529ee013784db3923a2bdbc5bef
|
||||
guid: 7fb2df2e4831fc94782d95487f732d65
|
||||
TextScriptImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
|
||||
@ -1,271 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 176353f8dc15fbd41aec3c678c7246e4, type: 3}
|
||||
m_Name: Hand Closed
|
||||
m_EditorClassIdentifier:
|
||||
bonePoses:
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 10
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 5
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.5, w: 0.8660254}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 11
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 10
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.81915206, w: 0.57357645}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 12
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 11
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.42261827, w: 0.90630776}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 14
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 5
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.57357645, w: 0.81915206}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 15
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 14
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.81915206, w: 0.57357645}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 16
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 11
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.6087614, w: 0.7933533}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 18
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 5
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.6087614, w: 0.7933533}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 19
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 18
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.86602545, w: 0.49999997}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 20
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 19
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.53729963, w: 0.8433914}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 22
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 5
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.6427876, w: 0.76604444}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 23
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 22
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.9063078, w: 0.42261824}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 24
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 23
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.5, w: 0.8660254}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 6
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 5
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: -0.0000008311435, y: -0.0000014144609, z: 0.46759272, w: 0.88394445}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 7
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 6
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.00008726646, w: 1}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 8
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 7
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.00008726646, w: 1}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
blendshapePoses: []
|
||||
@ -1,254 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 176353f8dc15fbd41aec3c678c7246e4, type: 3}
|
||||
m_Name: Hand Gun
|
||||
m_EditorClassIdentifier:
|
||||
bonePoses:
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 10
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 5
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 11
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 10
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 12
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 11
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 14
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 5
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.57357645, w: 0.81915206}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 15
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 14
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.81915206, w: 0.57357645}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 16
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 15
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.6087614, w: 0.7933533}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 18
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 5
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.6087614, w: 0.7933533}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 19
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 18
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.86602545, w: 0.49999997}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 20
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 19
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.53729963, w: 0.8433914}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 22
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 5
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.6427876, w: 0.76604444}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 23
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 22
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.9063078, w: 0.42261824}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 24
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 23
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.5, w: 0.8660254}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 6
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 5
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: -8.242821e-13, y: 0.4226183, z: 3.843691e-13, w: 0.90630776}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 7
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 6
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0.08715572, z: 0, w: 0.9961947}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
blendshapePoses: []
|
||||
@ -1,254 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 176353f8dc15fbd41aec3c678c7246e4, type: 3}
|
||||
m_Name: Hand Pointing
|
||||
m_EditorClassIdentifier:
|
||||
bonePoses:
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 6
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 5
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0.022665638, y: 0.17216259, z: 0.12854323, w: 0.9763826}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 7
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 6
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0.08715588, z: 0, w: -0.99619466}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 14
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 5
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.57357645, w: 0.81915206}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 15
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 14
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.81915206, w: 0.57357645}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 16
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 15
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.6087614, w: 0.7933533}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 18
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 5
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.6087614, w: 0.7933533}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 19
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 18
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.86602545, w: 0.49999997}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 20
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 19
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.53729963, w: 0.8433914}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 22
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 5
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.6427876, w: 0.76604444}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 23
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 22
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.9063078, w: 0.42261824}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 24
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 23
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.5, w: 0.8660254}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 10
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 5
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 11
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 10
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 12
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 11
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0, w: 1}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
blendshapePoses: []
|
||||
@ -1,254 +0,0 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 0}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 176353f8dc15fbd41aec3c678c7246e4, type: 3}
|
||||
m_Name: Hand Thumb Up
|
||||
m_EditorClassIdentifier:
|
||||
bonePoses:
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 10
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 5
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.57357645, w: 0.81915206}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 11
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 10
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.81915206, w: 0.57357645}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 12
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 11
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.6087614, w: 0.7933533}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 14
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 5
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.57357645, w: 0.81915206}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 15
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 14
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.81915206, w: 0.57357645}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 16
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 15
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.6087614, w: 0.7933533}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 18
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 5
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.6087614, w: 0.7933533}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 19
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 18
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.86602545, w: 0.49999997}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 20
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 19
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.53729963, w: 0.8433914}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 22
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 5
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.6427876, w: 0.76604444}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 23
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 22
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.9063078, w: 0.42261824}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 24
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 23
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0, z: 0.5, w: 0.8660254}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 6
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 5
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: -8.242821e-13, y: 0.4226183, z: 3.843691e-13, w: 0.90630776}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
- boneType: 0
|
||||
boneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 7
|
||||
referenceBoneRef:
|
||||
type: 2
|
||||
side: 0
|
||||
_boneId: 0
|
||||
_sideBoneId: 6
|
||||
setTranslation: 0
|
||||
setRotation: 1
|
||||
setScale: 0
|
||||
translation: {x: 0, y: 0, z: 0}
|
||||
rotation: {x: 0, y: 0.08715572, z: 0, w: 0.9961947}
|
||||
scale: {x: 0, y: 0, z: 0}
|
||||
blendshapePoses: []
|
||||
File diff suppressed because it is too large
Load Diff
@ -1,19 +0,0 @@
|
||||
namespace Passer.Humanoid {
|
||||
/// \page AnimatorDoc Animator
|
||||
///
|
||||
/// Animations can be used when other trackers are not tracking or not available. They
|
||||
/// can be enabled using the Animator option in the Input section of the Humanoid
|
||||
/// Control script.
|
||||
///
|
||||
/// By default, the animator uses a builtin procedural animation. This is overridden
|
||||
/// when setting the Runtime Animator Controller parameter which is standard
|
||||
/// [Unity Animator Controller](https://docs.unity3d.com/Manual/class-AnimatorController.html).
|
||||
///
|
||||
/// Targets
|
||||
/// =======
|
||||
/// When the Animation option is enabled on the Humanoid Control script,
|
||||
/// it is possible to select whether procedural animation should be used for each target.
|
||||
/// If Procedural Animation is deselected the animation controlled by the Runtime Animator Controller
|
||||
/// set in the Humanoid Control script will be used.
|
||||
/// If the Runtime Animator Controller is not set, no animation will be used.
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 900575d4e62003c41b95e2470e3eb96d
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,134 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Passer.Tracking {
|
||||
|
||||
/// <summary>
|
||||
/// The representation of a tracked body
|
||||
/// </summary>
|
||||
/// The bone hierarchy will be created below this transform at runtime.
|
||||
public abstract class BodySkeleton : TrackerComponent {
|
||||
|
||||
/// <summary>
|
||||
/// Determines whether the skeleton should be rendered
|
||||
/// </summary>
|
||||
public bool show = false;
|
||||
|
||||
/// <summary>
|
||||
/// The list of tracked bones
|
||||
/// </summary>
|
||||
protected List<TrackedBone> bones;
|
||||
//protected static Material boneWhite;
|
||||
|
||||
#region Start
|
||||
|
||||
/// <summary>
|
||||
/// This function is used to intialize the tracked bones.
|
||||
/// </summary>
|
||||
protected abstract void InitializeSkeleton();
|
||||
|
||||
// protected TrackedBone AddBone(string name, Transform parent) {
|
||||
// GameObject boneGO = new GameObject(name);
|
||||
// boneGO.transform.SetParent(parent, false);
|
||||
|
||||
// AddBoneRenderer(boneGO);
|
||||
|
||||
// TrackedBone bone = new TrackedBone() {
|
||||
// transform = boneGO.transform
|
||||
// };
|
||||
// return bone;
|
||||
// }
|
||||
|
||||
// protected void AddBoneRenderer(GameObject boneGO) {
|
||||
// LineRenderer boneRenderer = boneGO.AddComponent<LineRenderer>();
|
||||
// boneRenderer.startWidth = 0.01F;
|
||||
// boneRenderer.endWidth = 0.01F;
|
||||
// boneRenderer.useWorldSpace = false;
|
||||
// boneRenderer.SetPosition(0, Vector3.zero);
|
||||
// boneRenderer.SetPosition(1, Vector3.zero);
|
||||
// boneRenderer.generateLightingData = true;
|
||||
// boneRenderer.material = boneWhite;
|
||||
// }
|
||||
|
||||
#endregion
|
||||
|
||||
#region Update
|
||||
|
||||
/// <summary>
|
||||
/// Updates the rendering of the bones
|
||||
/// </summary>
|
||||
protected void UpdateSkeletonRender() {
|
||||
if (bones == null)
|
||||
return;
|
||||
|
||||
// Render Skeleton
|
||||
foreach (TrackedBone bone in bones) {
|
||||
if (bone == null)
|
||||
continue;
|
||||
LineRenderer boneRenderer = bone.transform.GetComponent<LineRenderer>();
|
||||
if (boneRenderer != null) {
|
||||
Vector3 localParentPosition = bone.transform.InverseTransformPoint(bone.transform.parent.position);
|
||||
boneRenderer.SetPosition(1, localParentPosition);
|
||||
boneRenderer.enabled = show;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected bool rendered;
|
||||
protected void EnableRenderer() {
|
||||
if (rendered || !show)
|
||||
return;
|
||||
|
||||
Renderer[] renderers = this.GetComponentsInChildren<Renderer>();
|
||||
foreach (Renderer renderer in renderers) {
|
||||
if (!(renderer is LineRenderer))
|
||||
renderer.enabled = true;
|
||||
}
|
||||
|
||||
rendered = true;
|
||||
}
|
||||
|
||||
protected void DisableRenderer() {
|
||||
if (!rendered)
|
||||
return;
|
||||
|
||||
Renderer[] renderers = this.GetComponentsInChildren<Renderer>();
|
||||
foreach (Renderer renderer in renderers) {
|
||||
if (!(renderer is LineRenderer))
|
||||
renderer.enabled = false;
|
||||
}
|
||||
|
||||
rendered = false;
|
||||
}
|
||||
|
||||
#endregion Update
|
||||
|
||||
/// <summary>
|
||||
/// Gets the transform of the tracked bone
|
||||
/// </summary>
|
||||
/// <param name="boneId">The requested bone</param>
|
||||
/// <returns>The tracked bone transform or *null* if it does not exist</returns>
|
||||
public Transform GetBoneTransform(Humanoid.Tracking.Bone boneId) {
|
||||
TrackedBone trackedBone = GetBone(boneId);
|
||||
if (trackedBone == null)
|
||||
return null;
|
||||
return trackedBone.transform;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the tracked bone
|
||||
/// </summary>
|
||||
/// <param name="boneId">The requested bone</param>
|
||||
/// <returns>The tracked bone or *null* if it does not exist</returns>
|
||||
public TrackedBone GetBone(Humanoid.Tracking.Bone boneId) {
|
||||
if (bones == null)
|
||||
return null;
|
||||
|
||||
if (boneId == Humanoid.Tracking.Bone.Count)
|
||||
return null;
|
||||
|
||||
return bones[(int)boneId];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@ -1,209 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Passer.Humanoid {
|
||||
using Passer.Tracking;
|
||||
|
||||
/// <summary>
|
||||
/// A custom sensor used on the arm of a humanoid
|
||||
/// </summary>
|
||||
/// This tracking option supports a custom developed ControllerComponent or HandSkeleton for the hand and/or arm.
|
||||
[System.Serializable]
|
||||
public class CustomArm : Passer.Humanoid.ArmSensor {
|
||||
|
||||
/// <summary>
|
||||
/// The name of this sensor
|
||||
/// </summary>
|
||||
public override string name => "Custom Sensor";
|
||||
|
||||
/// <summary>
|
||||
/// THe tracker for this sensor
|
||||
/// </summary>
|
||||
#if hCUSTOM
|
||||
public override HumanoidTracker tracker => humanoid.custom;
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// The tracker controller to use for this arm
|
||||
/// </summary>
|
||||
protected ControllerComponent controllerComponent;
|
||||
|
||||
/// <summary>
|
||||
/// The bone on the arm controlled by the sensor
|
||||
/// </summary>
|
||||
public ArmBones attachedBone = ArmBones.Hand;
|
||||
|
||||
/// <summary>
|
||||
/// The controller input for this humanoid
|
||||
/// </summary>
|
||||
protected Controller controllerInput;
|
||||
|
||||
#region Manage
|
||||
|
||||
/// <summary>
|
||||
/// Updates the arm targets based on the current sensor position and rotation
|
||||
/// </summary>
|
||||
public override void SetSensor2Target() {
|
||||
if (sensorComponent == null)
|
||||
return;
|
||||
|
||||
HumanoidTarget.TargetedBone targetBone = handTarget.GetTargetBone(attachedBone);
|
||||
if (targetBone == null)
|
||||
return;
|
||||
|
||||
sensor2TargetRotation = Quaternion.Inverse(sensorComponent.transform.rotation) * targetBone.target.transform.rotation;
|
||||
sensor2TargetPosition = -targetBone.target.transform.InverseTransformPoint(sensorComponent.transform.position);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the sensor position and rotation based on the current position of the arm targets.
|
||||
/// </summary>
|
||||
/// <param name="_">Not used</param>
|
||||
public override void UpdateSensorTransformFromTarget(Transform _) {
|
||||
if (handTarget == null)
|
||||
return;
|
||||
|
||||
HumanoidTarget.TargetedBone targetBone = handTarget.GetTargetBone(attachedBone);
|
||||
base.UpdateSensorTransformFromTarget(targetBone.target.transform);
|
||||
}
|
||||
|
||||
#endregion Manage
|
||||
|
||||
#region Start
|
||||
|
||||
/// <summary>
|
||||
/// Prepares the arm for tracking with the tracked controller and/or skeleton
|
||||
/// </summary>
|
||||
/// <param name="_humanoid">The humanoid for which this arm is tracked</param>
|
||||
/// <param name="targetTransform">The transform of the hand target</param>
|
||||
/// This will find and initialize the controllerInput for the given humanoid.
|
||||
/// It will initialize the sensor2TargetPosition and sensor2TargetRotation values.
|
||||
/// It will determine whether the sensor should be shown and rendered.
|
||||
/// It will start the tracking for the controller and/or hand skeleton.
|
||||
public override void Start(HumanoidControl _humanoid, Transform targetTransform) {
|
||||
base.Start(_humanoid, targetTransform);
|
||||
|
||||
if (tracker == null || !tracker.enabled || !enabled)
|
||||
return;
|
||||
|
||||
controllerComponent = sensorComponent as ControllerComponent;
|
||||
controllerInput = Controllers.GetController(0);
|
||||
|
||||
handSkeleton = sensorComponent as HandSkeleton;
|
||||
|
||||
SetSensor2Target();
|
||||
ShowSensor(handTarget.humanoid.showRealObjects && target.showRealObjects);
|
||||
|
||||
if (controllerComponent != null) {
|
||||
if (tracker.trackerComponent != null)
|
||||
controllerComponent.StartComponent(tracker.trackerComponent.transform, handTarget.isLeft);
|
||||
else
|
||||
controllerComponent.StartComponent(controllerComponent.transform.parent, handTarget.isLeft);
|
||||
}
|
||||
if (handSkeleton != null) {
|
||||
if (tracker.trackerComponent != null)
|
||||
handSkeleton.StartComponent(tracker.trackerComponent.transform);
|
||||
else
|
||||
handSkeleton.StartComponent(handSkeleton.transform.parent);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Start
|
||||
|
||||
#region Update
|
||||
|
||||
/// <summary>
|
||||
/// Updates the arm target based on the status of the tracked controller and/or skeleton
|
||||
/// </summary>
|
||||
public override void Update() {
|
||||
status = Tracker.Status.Unavailable;
|
||||
if (tracker == null || !tracker.enabled || !enabled)
|
||||
return;
|
||||
|
||||
if (sensorComponent == null)
|
||||
return;
|
||||
|
||||
sensorComponent.UpdateComponent();
|
||||
status = sensorComponent.status;
|
||||
if (status != Tracker.Status.Tracking)
|
||||
return;
|
||||
|
||||
HumanoidTarget.TargetedBone targetBone = handTarget.GetTargetBone(attachedBone);
|
||||
|
||||
UpdateTarget(targetBone.target, sensorComponent);
|
||||
|
||||
UpdateControllerInput();
|
||||
|
||||
UpdateHandFromSkeleton();
|
||||
}
|
||||
|
||||
#region Controller
|
||||
|
||||
/// <summary>
|
||||
/// Updates the Controller Input for this side
|
||||
/// </summary>
|
||||
protected void UpdateControllerInput() {
|
||||
if (handTarget.isLeft)
|
||||
UpdateControllerInput(controllerInput.left);
|
||||
else
|
||||
UpdateControllerInput(controllerInput.right);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates one side of the ControllerInput from the values of the tracked ControllerComponent
|
||||
/// </summary>
|
||||
/// <param name="controllerSide">The controller side to update</param>
|
||||
/// This function does nothing when the controller is not available or not tracking.
|
||||
protected virtual void UpdateControllerInput(ControllerSide controllerSide) {
|
||||
if (controllerSide == null)
|
||||
return;
|
||||
|
||||
if (controllerComponent == null || controllerComponent.status != Tracker.Status.Tracking)
|
||||
return;
|
||||
|
||||
controllerSide.stickHorizontal += controllerComponent.primaryAxis.x;
|
||||
controllerSide.stickVertical += controllerComponent.primaryAxis.y;
|
||||
controllerSide.stickButton |= (controllerComponent.primaryAxis.z > 0.5F);
|
||||
controllerSide.stickTouch = true;
|
||||
|
||||
controllerSide.buttons[0] |= controllerComponent.button1 > 0.5F;
|
||||
controllerSide.buttons[1] |= controllerComponent.button2 > 0.5F;
|
||||
controllerSide.buttons[2] |= controllerComponent.button3 > 0.5F;
|
||||
controllerSide.buttons[3] |= controllerComponent.button4 > 0.5F;
|
||||
|
||||
controllerSide.trigger1 += controllerComponent.trigger1;
|
||||
controllerSide.trigger2 += controllerComponent.trigger2;
|
||||
|
||||
controllerSide.option |= controllerComponent.option > 0.5F;
|
||||
}
|
||||
|
||||
#endregion Controller
|
||||
|
||||
#region Skeleton
|
||||
|
||||
/// <summary>
|
||||
/// This function uses the tracked HandSkeleton to update the pose of the hand
|
||||
/// </summary>
|
||||
/// This function does nothing when the hand skeleton is not available or not tracking.
|
||||
protected override void UpdateHandFromSkeleton() {
|
||||
if (handSkeleton == null || handSkeleton.status != Tracker.Status.Tracking)
|
||||
return;
|
||||
|
||||
Transform wristBone = handSkeleton.GetWristBone();
|
||||
handTarget.hand.target.transform.position = wristBone.transform.position;
|
||||
if (handTarget.isLeft)
|
||||
handTarget.hand.target.transform.rotation = wristBone.transform.rotation * Quaternion.Euler(-90, 0, 90);
|
||||
else
|
||||
handTarget.hand.target.transform.rotation = wristBone.transform.rotation * Quaternion.Euler(-90, 0, -90);
|
||||
|
||||
UpdateThumbFromSkeleton();
|
||||
UpdateIndexFingerFromSkeleton();
|
||||
UpdateMiddleFingerFromSkeleton();
|
||||
UpdateRingFingerFromSkeleton();
|
||||
UpdateLittleFingerFromSkeleton();
|
||||
}
|
||||
|
||||
#endregion Skeleton
|
||||
|
||||
#endregion Update
|
||||
}
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: b1d7b6728893ceb4bb7e73e43cace60b
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,79 +0,0 @@
|
||||
using UnityEngine;
|
||||
using Passer.Tracking;
|
||||
|
||||
namespace Passer.Humanoid {
|
||||
|
||||
/// <summary>
|
||||
/// A custom sensor used on the head of a humanoid.
|
||||
/// </summary>
|
||||
/// This tracking option supports a custom developed SensorComponent for the head.
|
||||
[System.Serializable]
|
||||
public class CustomHead : HeadSensor {
|
||||
public override string name => "Custom Sensor";
|
||||
|
||||
#if hCUSTOM
|
||||
public override HumanoidTracker tracker => humanoid.custom;
|
||||
#endif
|
||||
|
||||
//private static readonly Vector3 defaultLocalTrackerPosition = Vector3.zero;
|
||||
//private static readonly Quaternion defaultLocalTrackerRotation = Quaternion.identity;
|
||||
|
||||
#region Manage
|
||||
|
||||
#endregion Manage
|
||||
|
||||
#region Start
|
||||
|
||||
/// <summary>
|
||||
/// Prepares the head for tracking with the tracked sensor
|
||||
/// </summary>
|
||||
/// <param name="_humanoid">The humanoid for which this head is tracked</param>
|
||||
/// <param name="targetTransform">The transform of the head target</param>
|
||||
/// It will initialize the sensor2TargetPosition and sensor2TargetRotation values.
|
||||
/// It will determine whether the sensor should be shown and rendered.
|
||||
/// It will start the tracking of the sensor.
|
||||
public override void Start(HumanoidControl _humanoid, Transform targetTransform) {
|
||||
base.Start(_humanoid, targetTransform);
|
||||
|
||||
if (tracker == null || !tracker.enabled || !enabled)
|
||||
return;
|
||||
|
||||
SetSensor2Target();
|
||||
ShowSensor(headTarget.humanoid.showRealObjects && target.showRealObjects);
|
||||
|
||||
if (sensorComponent != null) {
|
||||
if (tracker.trackerComponent != null)
|
||||
sensorComponent.StartComponent(tracker.trackerComponent.transform);
|
||||
else
|
||||
sensorComponent.StartComponent(sensorComponent.transform.parent);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Start
|
||||
|
||||
#region Update
|
||||
|
||||
/// <summary>
|
||||
/// Updates the head target based on the status of the tracke sensor
|
||||
/// </summary>
|
||||
public override void Update() {
|
||||
status = Tracker.Status.Unavailable;
|
||||
if (tracker == null || !tracker.enabled || !enabled)
|
||||
return;
|
||||
|
||||
if (sensorComponent == null)
|
||||
return;
|
||||
|
||||
sensorComponent.UpdateComponent();
|
||||
status = sensorComponent.status;
|
||||
if (status != Tracker.Status.Tracking)
|
||||
return;
|
||||
|
||||
UpdateTarget(headTarget.head.target, sensorComponent);
|
||||
|
||||
UpdateNeckTargetFromHead();
|
||||
}
|
||||
|
||||
#endregion Update
|
||||
}
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 33addd0b8cb0bbb41b80554896116e1e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1,105 +0,0 @@
|
||||
using UnityEngine;
|
||||
|
||||
namespace Passer.Humanoid {
|
||||
using Passer.Tracking;
|
||||
|
||||
/// <summary>
|
||||
/// A custom sensor used on the leg of a humanoid.
|
||||
/// </summary>
|
||||
/// This tracking option supports a custom developed SensorComponent on the leg or foot.
|
||||
[System.Serializable]
|
||||
public class CustomLeg : LegSensor {
|
||||
|
||||
public override string name => "Custom Sensor";
|
||||
|
||||
/// <summary>
|
||||
/// The bone on the leg controlled by the sensor
|
||||
/// </summary>
|
||||
public LegBones attachedBone = LegBones.Foot;
|
||||
|
||||
#if hCUSTOM
|
||||
public override HumanoidTracker tracker => humanoid.custom;
|
||||
#endif
|
||||
|
||||
#region Manage
|
||||
|
||||
/// <summary>
|
||||
/// Updates the leg targets based on the current sensor position and rotation
|
||||
/// </summary>
|
||||
public override void SetSensor2Target() {
|
||||
if (sensorComponent == null)
|
||||
return;
|
||||
|
||||
HumanoidTarget.TargetedBone targetBone = footTarget.GetTargetBone(attachedBone);
|
||||
if (targetBone == null)
|
||||
return;
|
||||
|
||||
sensor2TargetRotation = Quaternion.Inverse(sensorComponent.transform.rotation) * targetBone.target.transform.rotation;
|
||||
sensor2TargetPosition = -targetBone.target.transform.InverseTransformPoint(sensorComponent.transform.position);
|
||||
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Updates the sensor position and rotation based on the current position of the leg targets
|
||||
/// </summary>
|
||||
/// <param name="_">Not used</param>
|
||||
public override void UpdateSensorTransformFromTarget(Transform _) {
|
||||
HumanoidTarget.TargetedBone targetBone = footTarget.GetTargetBone(attachedBone);
|
||||
base.UpdateSensorTransformFromTarget(targetBone.target.transform);
|
||||
}
|
||||
|
||||
#endregion Manage
|
||||
|
||||
#region Start
|
||||
|
||||
/// <summary>
|
||||
/// Prepares the leg for tracking with the sensor
|
||||
/// </summary>
|
||||
/// <param name="_humanoid">The humanoid for which this leg is tracked</param>
|
||||
/// <param name="targetTransform">The transform of the foot target</param>
|
||||
/// It will initialze the sensor2TargetPosition and sensor2TargetRotation values.
|
||||
/// It will determine whether the sensor should be shown and rendered.
|
||||
/// It will start the tracking of the sensor.
|
||||
public override void Start(HumanoidControl _humanoid, Transform targetTransform) {
|
||||
base.Start(_humanoid, targetTransform);
|
||||
|
||||
SetSensor2Target();
|
||||
ShowSensor(footTarget.humanoid.showRealObjects && target.showRealObjects);
|
||||
|
||||
if (sensorComponent != null) {
|
||||
if (tracker.trackerComponent != null)
|
||||
sensorComponent.StartComponent(tracker.trackerComponent.transform);
|
||||
else
|
||||
sensorComponent.StartComponent(sensorComponent.transform.parent);
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Start
|
||||
|
||||
#region Update
|
||||
|
||||
/// <summary>
|
||||
/// Updates the leg target based on the status of the tracked sensor
|
||||
/// </summary>
|
||||
public override void Update() {
|
||||
status = Tracker.Status.Unavailable;
|
||||
if (tracker == null || !tracker.enabled || !enabled)
|
||||
return;
|
||||
|
||||
if (sensorComponent == null)
|
||||
return;
|
||||
|
||||
sensorComponent.UpdateComponent();
|
||||
status = sensorComponent.status;
|
||||
if (status != Tracker.Status.Tracking)
|
||||
return;
|
||||
|
||||
HumanoidTarget.TargetedBone targetBone = footTarget.GetTargetBone(attachedBone);
|
||||
|
||||
UpdateTarget(targetBone.target, sensorComponent);
|
||||
}
|
||||
|
||||
#endregion Update
|
||||
}
|
||||
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user