-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Additional OrientedBoundingBox functionality #12178
base: main
Are you sure you want to change the base?
Conversation
Thank you for the pull request, @javagl! ✅ We can confirm we have a CLA on file for you. |
@lukemckinstry Could you please give this a first review pass? |
@lukemckinstry Sorry, I seem to have overlooked that. question/notification. The The other functions,
Both of these functions could also be implemented locally, without adding them to the public API of So, the bottom line: I think that the functions could be useful. But they are not "required" for anything. So if this is preferred, then this PR could be closed as it is. |
@javagl What you are saying about implementing We think it is best to remove intersect from this PR (since as you point out the fuctionality is already implemented elsewhere) and then move forward with just Let us know when this is ready for review again. Thanks! |
@javagl What is the status of this PR? If it is paused, can we close it for the time being to keep things tidy? |
This is still on my TODO list. When removing |
Description
Added a few functions to the
OrientedBoundingBox
class:fromMinMax
computes an OBB from given min/max pointstransform
transforms an OBB with a matrixintersect
tests for intersection between two OBBsThe first ones are rather simple "convenience" functions. I used these functions, for example, in #12112 , but there, only 'drafted' them, still outside of the
OrientedBoundingBox
class.The
intersect
function is a bit more involved. It implements the "Separating Axis Theorem", as described in https://gamma.cs.unc.edu/users/gottschalk/main.pdf . Strangely, this function already did exist, back when there was still a class calledObjectOrientedBoundingBox
. This class was deprecated in #2782 and eventually removed, without a replacement for theintersect
function. So I'm not even 100% sure whether it should be added again 😬Issue number and link
No specific issue, but ...
Testing plan
In addition to the Specs/UnitTests, the following is a sandcastle that can be used for testing the
intersect
function this when running this branch on localhost:http://localhost:8080/Apps/Sandcastle/#c=3Vhtb9s2EP4rhL9ExlzZWpqt0FxvdZJlBtq4SJMtMgwUlETbQijJkKjEbpH/viMpipL8kqSxjWFFapA88l6eO94d5cVRytB9QB5Igt6jiDygU5IGWWj+LdaMccMT89M4YjiISDJutND3cYTQlMYusdEE05S0xtFj87dxNI4mWeSxII6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ndVsoUOIe2fDA4KnW/Sz+D3uqDfESh4/5nlcC+UoPbebAMaFjvKpVbbUerml1oEttZ5rqaUttaSllAgORbHiDXh9zcrXcK2qKQ14VIniDmp8L0oaL5S6rNlgly5tNthXKm/QG5UqnI1O3paqnCKKdAZb357oqVOd5nsfhW45GHdR7N3FGTPh0eLdGYWuZUezOKYu5rnCj70sBKjMKWHnlPBhfzmAjqaR7xk3+ME6b3hL0WU/EGinWkZLca494OUdNSo1WWa+amuA0GUWuiTRHE0Brcqia6nOVupoI1W6YjvZ2U7ezFw6bzvZ2U4elXqtSrsHsJVrgd5QVABdDoQfik8C+pquuTJmkft4I94RTw5L16qYEpPGU4iMgdqHxg3ouINmLmRTh5yQMJbdvb51hVl6qYiG1edv0bKrPjRAv1c+L5hX52eo+sXB7H+8OdcIbmvfVzR7oTXWqjXWFms4rq2qrhdX5+eXL1PUeqailSQmReDa02bbg6xTvN/qOQAyxtBNSXKPXcjypRwwbohLC5nDTDM39ZLAJYZMAetyyRN8nB3xGe2Aj0wZu2Lk7IrRLkyTCWtXjJxdMdpo2jhSRQUm9W88ImgbrUY3ZUtKejzm/wjCeZwwlCXUMM02I+EcHtUkbbuZd0eY6aXis0q3rY50/eAeBf77NV+tkUdxmgJlklH6BWJr3Oh127C/cozGmGfW4T1JKF7yLTOr91EumqbZbcN09VRRdoXWXcZx6cmk12Vu7C976nXeZUlPv/O7zO+Ja9dtw6i6rmcwD6J5Bh3Ack5AWsK7bjAoDCKYQQvGx3gBY/ElAGYpI3M+hSHAjd+4UPRhLrpvO3/Ly178RvjDRkdCwlFuwXq5jCwYZw7HYXayhXmFTcU2mCRPgOEcHAxnn2A4rwJjdHAwRvsEY/TDYMgsflA01Bem/cChytJr8HAOj4ezVzyc1+ExOjweo73i8eP3RbYGu8Lj3dNoSIH7QkN1Oq9Bwzk0Gs5e0XBeh8bo0GiM9orG824KDIt2DMZ5n6Yaun8B
It uses one fixed bounding box, and allows editing the size, position, and orientation of the other one, showing the other one in red when they intersect (and printing infos to the console)
Author checklist
CONTRIBUTORS.md
CHANGES.md
with a short summary of my change