Skip to content

Commit e8f1a40

Browse files
author
Jared Bienz
committed
Added SplitView. Added ability to remove the current (nearest) anchor. Added voice commands for SplitView and RemoveCurrentAnchor.
1 parent 293a192 commit e8f1a40

File tree

14 files changed

+453
-3
lines changed

14 files changed

+453
-3
lines changed

SpatialAlignment-Unity/Assembly-CSharp.csproj

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,6 @@
584584
<Compile Include="Assets\SpatialAlignment\Refinement\Scripts\RefinableModel.cs" />
585585
<Compile Include="Assets\SpatialAlignment\Refinement\Scripts\RefinementController.cs" />
586586
<Compile Include="Assets\SpatialAlignment\SpatialAlignmentManager.cs" />
587-
<Compile Include="Assets\SpatialAlignment\SpatialExtensions.cs" />
588587
<Compile Include="Assets\SpatialAlignment\SpatialFrame.cs" />
589588
<Compile Include="Assets\SpatialAlignment\SpatialFrameCollection.cs" />
590589
<Compile Include="Assets\SpatialAlignment\Strategies\AlignmentStrategy.cs" />
@@ -593,6 +592,8 @@
593592
<Compile Include="Assets\SpatialAlignment\Strategies\ParentAlignmentOptions.cs" />
594593
<Compile Include="Assets\SpatialAlignment\Strategies\SimulatedAlignment.cs" />
595594
<Compile Include="Assets\SpatialAlignment\Strategies\WorldAnchorAlignment.cs" />
595+
<Compile Include="Assets\SpatialAlignment\Utilities\Scripts\SpatialExtensions.cs" />
596+
<Compile Include="Assets\SpatialAlignment\Utilities\Scripts\SplitViewManager.cs" />
596597
<Compile Include="Assets\SpatialAlignment-Examples\Persistence\Scripts\PersistenceExampleManager.cs" />
597598
<Compile Include="Assets\SpatialAlignment-Examples\Refinement\Scripts\RefinementExampleManager.cs" />
598599
<None Include="Assets\HoloToolkit\Utilities\Scripts\GLTF\Shaders\GLTFConstant.cginc" />

SpatialAlignment-Unity/Assets/SpatialAlignment-Examples/Refinement/Prefabs/RefinementExample.prefab

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,10 @@ MonoBehaviour:
7676
KeyCode: 91
7777
- Keyword: Reset Anchors
7878
KeyCode: 93
79+
- Keyword: Remove Current Anchor
80+
KeyCode: 92
81+
- Keyword: Split View
82+
KeyCode: 39
7983
recognitionConfidenceLevel: 0
8084
--- !u!114 &1633407209877629856
8185
MonoBehaviour:
@@ -192,5 +196,39 @@ MonoBehaviour:
192196
m_CallState: 2
193197
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
194198
Culture=neutral, PublicKeyToken=null
199+
- Keyword: Remove Current Anchor
200+
Response:
201+
m_PersistentCalls:
202+
m_Calls:
203+
- m_Target: {fileID: 1633407209877629886}
204+
m_MethodName: RemoveCurrentAnchor
205+
m_Mode: 1
206+
m_Arguments:
207+
m_ObjectArgument: {fileID: 0}
208+
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
209+
m_IntArgument: 0
210+
m_FloatArgument: 0
211+
m_StringArgument:
212+
m_BoolArgument: 0
213+
m_CallState: 2
214+
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
215+
Culture=neutral, PublicKeyToken=null
216+
- Keyword: Split View
217+
Response:
218+
m_PersistentCalls:
219+
m_Calls:
220+
- m_Target: {fileID: 1633407209877629886}
221+
m_MethodName: SplitView
222+
m_Mode: 1
223+
m_Arguments:
224+
m_ObjectArgument: {fileID: 0}
225+
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
226+
m_IntArgument: 0
227+
m_FloatArgument: 0
228+
m_StringArgument:
229+
m_BoolArgument: 0
230+
m_CallState: 2
231+
m_TypeName: UnityEngine.Events.UnityEvent, UnityEngine.CoreModule, Version=0.0.0.0,
232+
Culture=neutral, PublicKeyToken=null
195233
IsGlobalListener: 1
196234
PersistentKeywords: 1

SpatialAlignment-Unity/Assets/SpatialAlignment-Examples/Refinement/Scenes/SA-RefinementBuilding.unity

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -943,6 +943,12 @@ Transform:
943943
m_Father: {fileID: 0}
944944
m_RootOrder: 6
945945
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
946+
--- !u!4 &1746543277 stripped
947+
Transform:
948+
m_CorrespondingSourceObject: {fileID: 4587520633816736, guid: d29bc40b7f3df26479d6a0aac211c355,
949+
type: 3}
950+
m_PrefabInstance: {fileID: 278386368}
951+
m_PrefabAsset: {fileID: 0}
946952
--- !u!1 &1891623026
947953
GameObject:
948954
m_ObjectHideFlags: 0
@@ -1094,6 +1100,75 @@ MeshFilter:
10941100
m_PrefabAsset: {fileID: 0}
10951101
m_GameObject: {fileID: 2059821774}
10961102
m_Mesh: {fileID: 10207, guid: 0000000000000000e000000000000000, type: 0}
1103+
--- !u!1001 &188249851934458066
1104+
PrefabInstance:
1105+
m_ObjectHideFlags: 0
1106+
serializedVersion: 2
1107+
m_Modification:
1108+
m_TransformParent: {fileID: 1746543277}
1109+
m_Modifications:
1110+
- target: {fileID: 188249851610165992, guid: 5bb225293e05e5846823a417d4471bc6,
1111+
type: 3}
1112+
propertyPath: m_Name
1113+
value: SplitView
1114+
objectReference: {fileID: 0}
1115+
- target: {fileID: 188249851610165993, guid: 5bb225293e05e5846823a417d4471bc6,
1116+
type: 3}
1117+
propertyPath: m_LocalPosition.x
1118+
value: 0
1119+
objectReference: {fileID: 0}
1120+
- target: {fileID: 188249851610165993, guid: 5bb225293e05e5846823a417d4471bc6,
1121+
type: 3}
1122+
propertyPath: m_LocalPosition.y
1123+
value: 0
1124+
objectReference: {fileID: 0}
1125+
- target: {fileID: 188249851610165993, guid: 5bb225293e05e5846823a417d4471bc6,
1126+
type: 3}
1127+
propertyPath: m_LocalPosition.z
1128+
value: 0.31
1129+
objectReference: {fileID: 0}
1130+
- target: {fileID: 188249851610165993, guid: 5bb225293e05e5846823a417d4471bc6,
1131+
type: 3}
1132+
propertyPath: m_LocalRotation.x
1133+
value: -0
1134+
objectReference: {fileID: 0}
1135+
- target: {fileID: 188249851610165993, guid: 5bb225293e05e5846823a417d4471bc6,
1136+
type: 3}
1137+
propertyPath: m_LocalRotation.y
1138+
value: -0
1139+
objectReference: {fileID: 0}
1140+
- target: {fileID: 188249851610165993, guid: 5bb225293e05e5846823a417d4471bc6,
1141+
type: 3}
1142+
propertyPath: m_LocalRotation.z
1143+
value: -0
1144+
objectReference: {fileID: 0}
1145+
- target: {fileID: 188249851610165993, guid: 5bb225293e05e5846823a417d4471bc6,
1146+
type: 3}
1147+
propertyPath: m_LocalRotation.w
1148+
value: 1
1149+
objectReference: {fileID: 0}
1150+
- target: {fileID: 188249851610165993, guid: 5bb225293e05e5846823a417d4471bc6,
1151+
type: 3}
1152+
propertyPath: m_RootOrder
1153+
value: 2
1154+
objectReference: {fileID: 0}
1155+
- target: {fileID: 188249851610165993, guid: 5bb225293e05e5846823a417d4471bc6,
1156+
type: 3}
1157+
propertyPath: m_LocalEulerAnglesHint.x
1158+
value: 0
1159+
objectReference: {fileID: 0}
1160+
- target: {fileID: 188249851610165993, guid: 5bb225293e05e5846823a417d4471bc6,
1161+
type: 3}
1162+
propertyPath: m_LocalEulerAnglesHint.y
1163+
value: 0
1164+
objectReference: {fileID: 0}
1165+
- target: {fileID: 188249851610165993, guid: 5bb225293e05e5846823a417d4471bc6,
1166+
type: 3}
1167+
propertyPath: m_LocalEulerAnglesHint.z
1168+
value: 0
1169+
objectReference: {fileID: 0}
1170+
m_RemovedComponents: []
1171+
m_SourcePrefab: {fileID: 100100000, guid: 5bb225293e05e5846823a417d4471bc6, type: 3}
10971172
--- !u!1001 &1633407210776251376
10981173
PrefabInstance:
10991174
m_ObjectHideFlags: 0

SpatialAlignment-Unity/Assets/SpatialAlignment-Examples/Refinement/Scripts/RefinementExampleManager.cs

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535

3636
namespace Microsoft.SpatialAlignment.Persistence
3737
{
38-
39-
4038
/// <summary>
4139
/// An example manager that shows how to add and edit refinement anchors.
4240
/// </summary>
@@ -505,6 +503,17 @@ public void RemoveAnchor(ParentAlignmentOptions parentOption)
505503
}
506504
}
507505

506+
/// <summary>
507+
/// Removes the current active anchor.
508+
/// </summary>
509+
public void RemoveCurrentAnchor()
510+
{
511+
if (multiParent.CurrentParent != null)
512+
{
513+
RemoveAnchor(multiParent.CurrentParent);
514+
}
515+
}
516+
508517
/// <summary>
509518
/// Removes the last anchor that was created.
510519
/// </summary>
@@ -544,6 +553,21 @@ public void ShowModel()
544553
{
545554
largeScaleModel.gameObject.SetActive(true);
546555
}
556+
557+
/// <summary>
558+
/// Toggles on and off split view.
559+
/// </summary>
560+
public void SplitView()
561+
{
562+
if (SplitViewManager.Instance.Mode == SplitViewMode.Unoccluded)
563+
{
564+
SplitViewManager.Instance.Mode = SplitViewMode.OccludedRight;
565+
}
566+
else
567+
{
568+
SplitViewManager.Instance.Mode = SplitViewMode.Unoccluded;
569+
}
570+
}
547571
#endregion // Public Methods
548572

549573
#region Public Properties

SpatialAlignment-Unity/Assets/SpatialAlignment/Refinement/Scripts/RayRefinement.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,7 @@ private void StopAndCleanup()
340340
#endregion // Internal Methods
341341

342342
#region Overrides / Event Handlers
343+
/// <inheritdoc />
343344
protected virtual void OnInputClicked(InputClickedEventData eventData)
344345
{
345346
// If the current target has been successfully placed at least
@@ -353,12 +354,14 @@ protected virtual void OnInputClicked(InputClickedEventData eventData)
353354
eventData.Use();
354355
}
355356

357+
/// <inheritdoc />
356358
protected override void OnRefinementCanceled()
357359
{
358360
StopAndCleanup();
359361
base.OnRefinementCanceled();
360362
}
361363

364+
/// <inheritdoc />
362365
protected override void OnRefinementFinished()
363366
{
364367
// Cleanup resources
@@ -368,6 +371,7 @@ protected override void OnRefinementFinished()
368371
base.OnRefinementFinished();
369372
}
370373

374+
/// <inheritdoc />
371375
protected override void OnRefinementStarted()
372376
{
373377
// Capture input handler (released in StopAndCleanup)

SpatialAlignment-Unity/Assets/SpatialAlignment/Utilities.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SpatialAlignment-Unity/Assets/SpatialAlignment/Utilities/Prefabs.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
%YAML 1.1
2+
%TAG !u! tag:unity3d.com,2011:
3+
--- !u!1 &188249851610165992
4+
GameObject:
5+
m_ObjectHideFlags: 0
6+
m_CorrespondingSourceObject: {fileID: 0}
7+
m_PrefabInstance: {fileID: 0}
8+
m_PrefabAsset: {fileID: 0}
9+
serializedVersion: 6
10+
m_Component:
11+
- component: {fileID: 188249851610165993}
12+
- component: {fileID: 188249851610165997}
13+
- component: {fileID: 188249851610165996}
14+
- component: {fileID: 188249851610165998}
15+
- component: {fileID: 188249851610165999}
16+
m_Layer: 0
17+
m_Name: SplitView
18+
m_TagString: Untagged
19+
m_Icon: {fileID: 0}
20+
m_NavMeshLayer: 0
21+
m_StaticEditorFlags: 0
22+
m_IsActive: 1
23+
--- !u!4 &188249851610165993
24+
Transform:
25+
m_ObjectHideFlags: 0
26+
m_CorrespondingSourceObject: {fileID: 0}
27+
m_PrefabInstance: {fileID: 0}
28+
m_PrefabAsset: {fileID: 0}
29+
m_GameObject: {fileID: 188249851610165992}
30+
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
31+
m_LocalPosition: {x: 0, y: 0, z: 0.31}
32+
m_LocalScale: {x: 1, y: 1, z: 1}
33+
m_Children: []
34+
m_Father: {fileID: 0}
35+
m_RootOrder: 0
36+
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
37+
--- !u!33 &188249851610165997
38+
MeshFilter:
39+
m_ObjectHideFlags: 0
40+
m_CorrespondingSourceObject: {fileID: 0}
41+
m_PrefabInstance: {fileID: 0}
42+
m_PrefabAsset: {fileID: 0}
43+
m_GameObject: {fileID: 188249851610165992}
44+
m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0}
45+
--- !u!23 &188249851610165996
46+
MeshRenderer:
47+
m_ObjectHideFlags: 0
48+
m_CorrespondingSourceObject: {fileID: 0}
49+
m_PrefabInstance: {fileID: 0}
50+
m_PrefabAsset: {fileID: 0}
51+
m_GameObject: {fileID: 188249851610165992}
52+
m_Enabled: 0
53+
m_CastShadows: 0
54+
m_ReceiveShadows: 0
55+
m_DynamicOccludee: 1
56+
m_MotionVectors: 1
57+
m_LightProbeUsage: 1
58+
m_ReflectionProbeUsage: 1
59+
m_RenderingLayerMask: 1
60+
m_RendererPriority: 0
61+
m_Materials:
62+
- {fileID: 2100000, guid: d16fa791f451d2c40a6f24bfd3ac789c, type: 2}
63+
m_StaticBatchInfo:
64+
firstSubMesh: 0
65+
subMeshCount: 0
66+
m_StaticBatchRoot: {fileID: 0}
67+
m_ProbeAnchor: {fileID: 0}
68+
m_LightProbeVolumeOverride: {fileID: 0}
69+
m_ScaleInLightmap: 1
70+
m_PreserveUVs: 1
71+
m_IgnoreNormalsForChartDetection: 0
72+
m_ImportantGI: 0
73+
m_StitchLightmapSeams: 0
74+
m_SelectedEditorRenderState: 3
75+
m_MinimumChartSize: 4
76+
m_AutoUVMaxDistance: 0.5
77+
m_AutoUVMaxAngle: 89
78+
m_LightmapParameters: {fileID: 0}
79+
m_SortingLayerID: 0
80+
m_SortingLayer: 0
81+
m_SortingOrder: 0
82+
--- !u!114 &188249851610165998
83+
MonoBehaviour:
84+
m_ObjectHideFlags: 0
85+
m_CorrespondingSourceObject: {fileID: 0}
86+
m_PrefabInstance: {fileID: 0}
87+
m_PrefabAsset: {fileID: 0}
88+
m_GameObject: {fileID: 188249851610165992}
89+
m_Enabled: 1
90+
m_EditorHideFlags: 0
91+
m_Script: {fileID: 11500000, guid: a1cd1da56c40bf34ba82df9fe22d49cc, type: 3}
92+
m_Name:
93+
m_EditorClassIdentifier:
94+
UseLastLayer: 1
95+
TargetSortingLayerName: Default
96+
renderers: []
97+
--- !u!114 &188249851610165999
98+
MonoBehaviour:
99+
m_ObjectHideFlags: 0
100+
m_CorrespondingSourceObject: {fileID: 0}
101+
m_PrefabInstance: {fileID: 0}
102+
m_PrefabAsset: {fileID: 0}
103+
m_GameObject: {fileID: 188249851610165992}
104+
m_Enabled: 1
105+
m_EditorHideFlags: 0
106+
m_Script: {fileID: 11500000, guid: 6551bd8be37fb2640b017d9addf16596, type: 3}
107+
m_Name:
108+
m_EditorClassIdentifier:
109+
mode: 0

SpatialAlignment-Unity/Assets/SpatialAlignment/Utilities/Prefabs/SplitView.prefab.meta

Lines changed: 7 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

SpatialAlignment-Unity/Assets/SpatialAlignment/Utilities/Scripts.meta

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)