Skip to content

Conversation

hollasch
Copy link
Collaborator

Lots of additional use cases for interval pending, but just tackling the hit methods for now.

@hollasch hollasch added this to the v4.0.0 milestone Oct 31, 2020
@hollasch hollasch requested a review from a team October 31, 2020 19:07
// Find the nearest root that lies in the acceptable range.
auto root = (-half_b - sqrtd) / a;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ C++ highlight
if (!t.contains(root)) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will fix this in subsequent commit.

for (int a = 0; a < 3; a++) {
auto t0 = fmin((minimum[a] - r.origin()[a]) / r.direction()[a],
(maximum[a] - r.origin()[a]) / r.direction()[a]);
auto t1 = fmax((minimum[a] - r.origin()[a]) / r.direction()[a],
(maximum[a] - r.origin()[a]) / r.direction()[a]);
ray_tmin = fmax(t0, ray_tmin);
ray_tmax = fmin(t1, ray_tmax);
auto ray_tmin = fmax(t0, ray_t.min);
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Future change using interval intersection.

@hollasch hollasch requested a review from trevordblack November 3, 2020 02:23
@hollasch hollasch self-assigned this Nov 3, 2020
@trevordblack
Copy link
Collaborator

CHANGELOG needs addition

@hollasch
Copy link
Collaborator Author

hollasch commented Nov 3, 2020

Oif.

@trevordblack
Copy link
Collaborator

What am I looking at?

this seems like a gargantuan omni-bus of a PR

@hollasch
Copy link
Collaborator Author

hollasch commented Nov 3, 2020

Yup. Basically, introduce the interval class, and then deploy its first use case: hittable::hit methods.

@hollasch
Copy link
Collaborator Author

hollasch commented Nov 3, 2020

I quickly identified at least eight different cases where this would help, and I'd rather develop/PR them one-by-one than submit one gigantic hairball.

@hollasch
Copy link
Collaborator Author

hollasch commented Nov 3, 2020

Ref: #777

Copy link
Collaborator

@trevordblack trevordblack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Comment on lines +3 to +10
//==============================================================================================
// To the extent possible under law, the author(s) have dedicated all copyright and related and
// neighboring rights to this software to the public domain worldwide. This software is
// distributed without any warranty.
//
// You should have received a copy (see file COPYING.txt) of the CC0 Public Domain Dedication
// along with this software. If not, see <http://creativecommons.org/publicdomain/zero/1.0/>.
//==============================================================================================
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

New copyright template

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the review. What about the copyright? It's the same as the others, except for the "Originally written" lines some have.

@hollasch hollasch merged commit f2becce into dev-major Nov 3, 2020
@hollasch hollasch deleted the interval branch November 3, 2020 03:06
@hollasch hollasch mentioned this pull request Nov 6, 2020
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants