Skip to content

Commit 6fd411b

Browse files
committed
CustomInputControl now updates grip position/rotation in the SourcePose
1 parent f532abb commit 6fd411b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

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)