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

Fix selecting semi-transparent visuals #800

Merged
merged 1 commit into from
Jan 6, 2023

Conversation

iche033
Copy link
Contributor

@iche033 iche033 commented Jan 5, 2023

Signed-off-by: Ian Chen [email protected]

🦟 Bug fix

Another fix for gazebosim/gz-sim#147, specifically the issue shown in the video in gazebosim/gz-sim#147 (comment)

Summary

The problem is that when clicking on semi-transparent visuals with nothing in the background, the ogre2 selection buffer returns nan point values. This causes entity selection to think that nothing is pressed by the mouse. Similarly when using the transform control tool, the user will not be able to click on the semi-transparent arrow visual if there is nothing in the background. For the entity selection and transform control functionality, we don't really need the point / distance results from the selection buffer ray query, so the workaround is to just make sure the visual object's ids is valid.

The issue with nan values returned the selection buffer for semi-transparent object still persist, and I added a todo note for this.

To test:

See video in gazebosim/gz-sim#147 (comment).

Alternatively:

  1. launch gz-sim with shapes.sdf world

    gz sim -v 4 shapes.sdf
    
  2. Right click the box and select View -> Transparent

  3. Click on another model in the scene to unselect the box

  4. Try positioning the camera so that there is nothing behind the semi-transparent box (i.e. no ground plane in the background) similar to the idea shown in the video.

  5. Use mouse to select the part of the box without background. Without this change, the box can not be selected.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

@github-actions github-actions bot added the 🌱 garden Ignition Garden label Jan 5, 2023
@codecov
Copy link

codecov bot commented Jan 5, 2023

Codecov Report

Merging #800 (2744dc1) into gz-rendering7 (4de8d1e) will not change coverage.
The diff coverage is 100.00%.

@@              Coverage Diff               @@
##           gz-rendering7     #800   +/-   ##
==============================================
  Coverage          76.19%   76.19%           
==============================================
  Files                164      164           
  Lines              14393    14393           
==============================================
  Hits               10967    10967           
  Misses              3426     3426           
Impacted Files Coverage Δ
ogre2/src/Ogre2SelectionBuffer.cc 93.25% <ø> (ø)
src/base/BaseScene.cc 78.07% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@iche033 iche033 merged commit 87f70e4 into gz-rendering7 Jan 6, 2023
@iche033 iche033 deleted the transparency_selection branch January 6, 2023 00:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌱 garden Ignition Garden
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants