Skip to content

Commit ca8a57d

Browse files
author
David Kline
authored
Merge pull request #2133 from PJBowron/may18_fix_editorHands
Fix to allow in-Editor hands to properly support and report a 'grip' position
2 parents 5ec8a68 + 6fd411b commit ca8a57d

File tree

3 files changed

+19
-0
lines changed

3 files changed

+19
-0
lines changed

Assets/HoloToolkit/Input/Prefabs/LeftHandInputControl.prefab

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ MeshRenderer:
201201
m_Enabled: 1
202202
m_CastShadows: 1
203203
m_ReceiveShadows: 1
204+
m_DynamicOccludee: 1
204205
m_MotionVectors: 1
205206
m_LightProbeUsage: 1
206207
m_ReflectionProbeUsage: 1
@@ -216,6 +217,7 @@ MeshRenderer:
216217
m_PreserveUVs: 1
217218
m_IgnoreNormalsForChartDetection: 0
218219
m_ImportantGI: 0
220+
m_StitchLightmapSeams: 0
219221
m_SelectedEditorRenderState: 3
220222
m_MinimumChartSize: 4
221223
m_AutoUVMaxDistance: 0.5
@@ -326,13 +328,17 @@ MonoBehaviour:
326328
m_EditorClassIdentifier:
327329
SupportsPosition: 1
328330
SupportsRotation: 0
331+
SupportsGripPosition: 1
332+
SupportsGripRotation: 0
329333
SupportsRay: 0
330334
SupportsMenuButton: 0
331335
SupportsGrasp: 0
332336
RaiseEventsBasedOnVisibility: 1
333337
SourceKind: 1
334338
ControllerPosition: {x: 0, y: 0, z: 0}
335339
ControllerRotation: {x: 0, y: 0, z: 0, w: 0}
340+
ControllerGripPosition: {x: 0, y: 0, z: 0}
341+
ControllerGripRotation: {x: 0, y: 0, z: 0, w: 0}
336342
currentButtonStates:
337343
IsSelectButtonDown: 0
338344
SelectButtonStateChanged: 0
@@ -344,6 +350,7 @@ MonoBehaviour:
344350
ManipulationInProgress: 0
345351
HoldInProgress: 0
346352
CumulativeDelta: {x: 0, y: 0, z: 0}
353+
CumulativeGripDelta: {x: 0, y: 0, z: 0}
347354
manipulationStartMovementThreshold: 0.03
348355
--- !u!114 &114832010102587794
349356
MonoBehaviour:

Assets/HoloToolkit/Input/Prefabs/RightHandInputControl.prefab

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,7 @@ MeshRenderer:
201201
m_Enabled: 1
202202
m_CastShadows: 1
203203
m_ReceiveShadows: 1
204+
m_DynamicOccludee: 1
204205
m_MotionVectors: 1
205206
m_LightProbeUsage: 1
206207
m_ReflectionProbeUsage: 1
@@ -216,6 +217,7 @@ MeshRenderer:
216217
m_PreserveUVs: 1
217218
m_IgnoreNormalsForChartDetection: 0
218219
m_ImportantGI: 0
220+
m_StitchLightmapSeams: 0
219221
m_SelectedEditorRenderState: 3
220222
m_MinimumChartSize: 4
221223
m_AutoUVMaxDistance: 0.5
@@ -318,13 +320,17 @@ MonoBehaviour:
318320
m_EditorClassIdentifier:
319321
SupportsPosition: 1
320322
SupportsRotation: 0
323+
SupportsGripPosition: 1
324+
SupportsGripRotation: 0
321325
SupportsRay: 0
322326
SupportsMenuButton: 0
323327
SupportsGrasp: 0
324328
RaiseEventsBasedOnVisibility: 1
325329
SourceKind: 1
326330
ControllerPosition: {x: 0, y: 0, z: 0}
327331
ControllerRotation: {x: 0, y: 0, z: 0, w: 0}
332+
ControllerGripPosition: {x: 0, y: 0, z: 0}
333+
ControllerGripRotation: {x: 0, y: 0, z: 0, w: 0}
328334
currentButtonStates:
329335
IsSelectButtonDown: 0
330336
SelectButtonStateChanged: 0
@@ -336,6 +342,7 @@ MonoBehaviour:
336342
ManipulationInProgress: 0
337343
HoldInProgress: 0
338344
CumulativeDelta: {x: 0, y: 0, z: 0}
345+
CumulativeGripDelta: {x: 0, y: 0, z: 0}
339346
manipulationStartMovementThreshold: 0.03
340347
--- !u!114 &114983783085117614
341348
MonoBehaviour:

Assets/HoloToolkit/Input/Scripts/Utilities/Interactions/CustomInputControl.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,10 @@ private void Awake()
7878
InitialPosition = localPosition;
7979
ControllerSourceState.SourcePose.Position = localPosition;
8080
ControllerSourceState.SourcePose.Rotation = ControllerVisualizer.transform.rotation;
81+
// we reuse localPosition here as we have no real way to source a grip position
82+
// in the Editor, other than an arbitrary offset
83+
ControllerSourceState.SourcePose.GripPosition = localPosition;
84+
ControllerSourceState.SourcePose.GripRotation = ControllerVisualizer.transform.rotation;
8185

8286
visualRenderer = ControllerVisualizer.GetComponent<Renderer>();
8387
visualPropertyBlock = new MaterialPropertyBlock();
@@ -170,6 +174,7 @@ private void Update()
170174

171175
localPosition += translate;
172176
ControllerSourceState.SourcePose.Position = CameraCache.Main.transform.position + CameraCache.Main.transform.TransformVector(localPosition);
177+
ControllerSourceState.SourcePose.GripPosition = CameraCache.Main.transform.position + CameraCache.Main.transform.TransformVector(localPosition);
173178

174179
ControllerVisualizer.transform.position = ControllerSourceState.SourcePose.Position;
175180
ControllerVisualizer.transform.forward = CameraCache.Main.transform.forward;

0 commit comments

Comments
 (0)