Skip to content

Commit 0dcab03

Browse files
author
David Kline
authored
Merge pull request #6528 from gilbdev/bugfix/boundingbox_rotationhandle
Bugfix boundingbox rotationhandle
2 parents 3a0aac1 + 67d51d1 commit 0dcab03

File tree

1 file changed

+4
-1
lines changed
  • Assets/MixedRealityToolkit.SDK/Features/UX/Scripts/BoundingBox

1 file changed

+4
-1
lines changed

Assets/MixedRealityToolkit.SDK/Features/UX/Scripts/BoundingBox/BoundingBox.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1590,8 +1590,11 @@ private void AddLinks()
15901590
midpointVisual.transform.parent = midpoint.transform;
15911591
midpointVisual.transform.localScale = new Vector3(invScale, invScale, invScale);
15921592
midpointVisual.transform.localPosition = Vector3.zero;
1593+
1594+
Bounds bounds = new Bounds(midpointBounds.center * invScale, midpointBounds.size * invScale);
1595+
bounds.size = bounds.size.RotateAround(bounds.center, midpointVisual.transform.localRotation);
15931596

1594-
AddComponentsToAffordance(midpoint, new Bounds(midpointBounds.center * invScale, midpointBounds.size * invScale), rotationHandlePrefabColliderType, CursorContextInfo.CursorAction.Rotate, rotateHandleColliderPadding);
1597+
AddComponentsToAffordance(midpoint, bounds, rotationHandlePrefabColliderType, CursorContextInfo.CursorAction.Rotate, rotateHandleColliderPadding);
15951598

15961599
balls.Add(midpoint.transform);
15971600

0 commit comments

Comments
 (0)