File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
Assets/HoloToolkit/Input/Scripts/Interactions Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -42,6 +42,14 @@ public enum RotationModeEnum
4242
4343 public RotationModeEnum RotationMode = RotationModeEnum . Default ;
4444
45+ [ Tooltip ( "Controls the speed at which the object will interpolate toward the desired position" ) ]
46+ [ Range ( 0.01f , 1.0f ) ]
47+ public float PositionLerpSpeed = 0.2f ;
48+
49+ [ Tooltip ( "Controls the speed at which the object will interpolate toward the desired rotation" ) ]
50+ [ Range ( 0.01f , 1.0f ) ]
51+ public float RotationLerpSpeed = 0.2f ;
52+
4553 public bool IsDraggingEnabled = true ;
4654
4755 private Camera mainCamera ;
@@ -214,9 +222,10 @@ private void UpdateDragging()
214222 }
215223
216224 // Apply Final Position
217- HostTransform . position = draggingPosition + mainCamera . transform . TransformDirection ( objRefGrabPoint ) ;
225+ HostTransform . position = Vector3 . Lerp ( HostTransform . position , draggingPosition + mainCamera . transform . TransformDirection ( objRefGrabPoint ) , PositionLerpSpeed ) ;
218226 // Apply Final Rotation
219- HostTransform . rotation = draggingRotation ;
227+ HostTransform . rotation = Quaternion . Lerp ( HostTransform . rotation , draggingRotation , RotationLerpSpeed ) ;
228+
220229 if ( RotationMode == RotationModeEnum . OrientTowardUserAndKeepUpright )
221230 {
222231 Quaternion upRotation = Quaternion . FromToRotation ( HostTransform . up , Vector3 . up ) ;
You can’t perform that action at this time.
0 commit comments