Skip to content

Commit

Permalink
Package update
Browse files Browse the repository at this point in the history
  • Loading branch information
Hackebein committed Mar 4, 2024
1 parent 6f104c2 commit f1b7103
Show file tree
Hide file tree
Showing 9 changed files with 545 additions and 179 deletions.
8 changes: 8 additions & 0 deletions Packages/dev.hackebein.object-tracking/Assets.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions Packages/dev.hackebein.object-tracking/Assets/World.prefab
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &4508875353715765265
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1720321125886419532}
m_Layer: 0
m_Name: GameObject
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 4294967295
m_IsActive: 1
--- !u!4 &1720321125886419532
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 4508875353715765265}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

49 changes: 40 additions & 9 deletions Packages/dev.hackebein.object-tracking/Editor/Editor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,14 @@ private void LabelAccuracy(int range, int bits, string suffix, GUILayoutOption[]
// ;)
GUILayout.Label("^,....^ remember i love you", guiLayoutOption);
}
else if (suffix == "m" && accuracy < 0.01)
else if (suffix == "m" && accuracy < 0.002)
{
GUILayout.Label("<0.01" + suffix, guiLayoutOption);
GUILayout.Label("<0.4in", guiLayoutOption);
GUILayout.Label("<0.002" + suffix, guiLayoutOption);
GUILayout.Label("<0.8in", guiLayoutOption);
}
else if (suffix == "°" && accuracy < 0.1)
else if (suffix == "°" && accuracy < 0.5)
{
GUILayout.Label("<0.1" + suffix, guiLayoutOption);
GUILayout.Label("<0.5" + suffix, guiLayoutOption);
}
else if (bits > 0 && suffix == "m")
{
Expand Down Expand Up @@ -139,8 +139,7 @@ public override void OnInspectorGUI()
{
path = EditorUtility.OpenFolderPanel("Select asset folder", path, "").Replace(Application.dataPath, "Assets");
}

if (!path.StartsWith("Assets/"))
if (GUILayout.Button("Reset") || !path.StartsWith("Assets/"))
{
path = "Assets/Hackebein/ObjectTracking/Generated";
}
Expand All @@ -161,6 +160,17 @@ public override void OnInspectorGUI()
}
}
}

using (new GUILayout.HorizontalScope())
{
GUILayout.Label("Oriantation Mode:");
EditorGUILayout.Popup(1, new string[]
{
"Animation (coming soon)",
"Constraint",
}, RelativeWidth(3 / 5f));
}

}
else
{
Expand Down Expand Up @@ -253,6 +263,8 @@ public override void OnInspectorGUI()
}
}

// TODO: support GoGoLoco and similar systems
// TODO: Multi configuration support
foreach (SetupTracker tracker in setup.trackers)
{
using (new GUILayout.VerticalScope("box"))
Expand All @@ -278,7 +290,6 @@ public override void OnInspectorGUI()
"None",
"Hackebein - X-Pole Pole Silkii mount (coming soon)",
"Hackebein - X-Pole Aerial Hoop mount (coming soon)",
"Jangxx - Bottle Mount (coming soon)", // https://www.thingiverse.com/thing:4732305
}, RelativeWidth(3 / 5f));

// TODO: show extra information about the prefab (License, Author, URL, etc.)
Expand All @@ -297,6 +308,21 @@ public override void OnInspectorGUI()
}, RelativeWidth(3 / 5f));
}
}
if (setup.mode == Utility.Modes.Expert)
{
using (new GUILayout.HorizontalScope())
{
GUILayout.Label("Smoothing:");
// TODO: Implement Smoothing Types
EditorGUILayout.Popup(0, new string[]
{
"Exponential (VRC Phys Bone, PC only)",
"Exponential (Animator) (coming soon)", // https://notes.sleightly.dev/Smoothing-Exponential-019e9e69f617451dabd8d64554e09671
"Damped (Animator) (coming soon)", // https://notes.sleightly.dev/Smoothed-Float-Half-21fe757e52da4e589e2b30997f459f44
"Linear (Animator) (coming soon)", // Assets/JelleScripts/Linear/Timing
}, RelativeWidth(3 / 5f));
}
}

if (setup.mode >= Utility.Modes.Advanced)
{
Expand Down Expand Up @@ -368,6 +394,7 @@ public override void OnInspectorGUI()

using (new GUILayout.VerticalScope())
{
// TODO: add support for >32 bits
tracker.bitsRPX = RangeNumberInputField(tracker.bitsRPX, 0, 32, RelativeWidth((float)1 / 5));
tracker.bitsRPX = SliderNumberInputField(tracker.bitsRPX, 0, 32, RelativeWidth((float)1 / 5));
}
Expand Down Expand Up @@ -452,6 +479,7 @@ public override void OnInspectorGUI()

using (new GUILayout.VerticalScope())
{
// TODO: add support for >32 bits
tracker.bitsRPY = RangeNumberInputField(tracker.bitsRPY, 0, 32, RelativeWidth((float)1 / 5));
tracker.bitsRPY = SliderNumberInputField(tracker.bitsRPY, 0, 32, RelativeWidth((float)1 / 5));
}
Expand Down Expand Up @@ -536,6 +564,7 @@ public override void OnInspectorGUI()

using (new GUILayout.VerticalScope())
{
// TODO: add support for >32 bits
tracker.bitsRPZ = RangeNumberInputField(tracker.bitsRPZ, 0, 32, RelativeWidth((float)1 / 5));
tracker.bitsRPZ = SliderNumberInputField(tracker.bitsRPZ, 0, 32, RelativeWidth((float)1 / 5));
}
Expand Down Expand Up @@ -940,6 +969,7 @@ public override void OnInspectorGUI()

using (new GUILayout.VerticalScope())
{
// TODO: add support for >32 bits
positionBits = RangeNumberInputField(positionBits, 0, 32, RelativeWidth((float)1 / 4));
positionBits = SliderNumberInputField(positionBits, 0, 32, RelativeWidth((float)1 / 4));
}
Expand Down Expand Up @@ -1026,10 +1056,11 @@ public override void OnInspectorGUI()

bool isTrackersValid = setup.trackers.Count != 0;
string[] trackerNames = new string[setup.trackers.Count];
string[] protectedNames = new string[]{"device", "index", "value", "global"};
foreach (SetupTracker tracker in setup.trackers)
{
string name = tracker.name;
if (name.Length == 0 || Array.Exists(trackerNames, trackerName => trackerName == name))
if (name.Length == 0 || Array.Exists(trackerNames, trackerName => trackerName == name) || Array.Exists(protectedNames, protectedName => protectedName == name))
{
isTrackersValid = false;
break;
Expand Down
Binary file not shown.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f1b7103

Please sign in to comment.