Repository navigation
Conversation
The corner radius was floored at 10.5 cm, so small models got a placement box and touch target far larger than the model. The radius now scales with the footprint (half the smaller side), capped at the old 10.5 cm and floored at 2.5 cm so tiny models stay grabbable. Footprints of 42 cm and up are unchanged. The controller hit box is now centred with the radius it is built with, so it still covers the bottom of small models. Fixes google#5150
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reference Issue
Fixes #5150
In WebXR AR a 10-15 cm model gets a placement box with ~10 cm of padding on every side, and you can start a drag from that far out too. @smirnov-artur tracked it down in the issue: the corner radius is
max(BASE_RADIUS * 0.7, modelSize * 0.2), so it's 10.5 cm for anything with a footprint under about a metre, and the same radius pads the touch hit plane and the controller hit box.The radius is now
modelSize * 0.5(modelSizebeing half the smaller footprint side), capped at the old 10.5 cm and floored at 2.5 cm (MIN_TOUCH_AREA / 2). The floor keeps tiny models grabbable and keeps the radius above the 1.4 cm minimum line width, so the corner arcs don't fold inward. Footprints of 42 cm and up get exactly what they got before.Hit plane width, square footprint:
The radius math was copied in three places, so it's one helper now. The controller hit box was also centred using
BASE_RADIUSinstead of the radius it's built with. That only cost ~2 cm before, but with the smaller radius it would have left the bottom 6 cm of a 10 cm model out of reach for controllers and hands, so it uses the real radius now.Left the distance scaling alone (the box grows 15-30% at 1-1.5 m). Happy to look at that separately if you want.
Added
PlacementBox-spec.ts. The 2 cm, 10 cm, thin wall model and hit box cases fail before the change; the 50 cm and 2 m cases pass both ways and pin the large-model behaviour. Haven't tried it on a device yet, only these tests and the existing AR suites.Heads up on phones: a one-finger drag that starts on the hit plane moves the model and one that starts outside it rotates, so small models now have a smaller area that moves them. That's also what lets you rotate them without reaching way out past the model. If you'd rather keep a bigger touch target than the visible box, I can split those two.