Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Flattened BoundsControl collapse or expand to infinity #11745

Closed
johannes-weidenfeller opened this issue Jul 27, 2023 · 0 comments
Closed

Flattened BoundsControl collapse or expand to infinity #11745

johannes-weidenfeller opened this issue Jul 27, 2023 · 0 comments

Comments

@johannes-weidenfeller
Copy link

johannes-weidenfeller commented Jul 27, 2023

This issue has been migrated a new MRTK repository, and the status of this issue will now be tracked at the following location:


Describe the bug

When BoundsControls with the BoundingBoxWithHandles visuals prefab are flattened, the handles sometimes collapse along the wrong axis and sometimes expand out to infinity.

To reproduce

Steps to reproduce the behavior:

  1. Add a plane (flat object) to the scene
  2. Equip plane with ObjectManipulator and BoundsControl scripts
  3. Assign BoundingBoxWithHandles prefab to the Bounds Visual Prefab field of the BoundsControl component and set HandlesActive field to True
  4. Ensure that FlattenMode is set to either Auto or Always

Expected behavior

Bounds should automatically flatten across the flattest axis of the object.

Screenshots

image

image

Your setup (please complete the following information)

  • Unity Version 2021.3.19.f1
  • MRTK3 pre.17

Target platform (please complete the following information)

  • HoloLens 2

Additional context

It seems like the issue lies in the calculation of the flattenVector in the SqueezableBoxVisuals.cs script. When the flattenVector is calculated in line 193 it is calculated with respect to the newly spawned BoxVisuals. Since these are of uniform scale, the flattenVector always computes to one of the unit vectors.
This faulty flattenVector is then used in the BoundsHandleInteractable.cs script (line 138) to resize the handles.
Note that the BoundsControl component itself also (correctly) calculates a flattenVector which maybe could be used instead in the BoundsHandleInteractable script.

@github-actions github-actions bot added the MRTK3 label Jul 27, 2023
@johannes-weidenfeller johannes-weidenfeller changed the title Flattened BoundsControl Bug Flattened BoundsControl collapse or expand to inifinity Jul 27, 2023
@AMollis AMollis added this to the MRTK v3.0 GA milestone Jul 28, 2023
@johannes-weidenfeller johannes-weidenfeller changed the title Flattened BoundsControl collapse or expand to inifinity Flattened BoundsControl collapse or expand to infinity Jul 30, 2023
@AMollis AMollis closed this as completed Aug 14, 2023
@AMollis AMollis reopened this Aug 14, 2023
@AMollis AMollis closed this as completed Aug 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants