Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CppRaytracer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Yoel
CppRaytracer
Commits
8d7e105c
Commit
8d7e105c
authored
4 years ago
by
Yoel
Browse files
Options
Downloads
Patches
Plain Diff
Fixed no arg constructor to box of infinite size
parent
56dcba7f
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
RayTracer/tools/AxisAlignedBoundingBox.cpp
+4
-2
4 additions, 2 deletions
RayTracer/tools/AxisAlignedBoundingBox.cpp
with
4 additions
and
2 deletions
RayTracer/tools/AxisAlignedBoundingBox.cpp
+
4
−
2
View file @
8d7e105c
...
...
@@ -6,7 +6,9 @@
namespace
util
{
// Constructor
AxisAlignedBoundingBox
::
AxisAlignedBoundingBox
()
:
min
(
Vec3
(
0
)),
max
(
Vec3
(
0
))
{
AxisAlignedBoundingBox
::
AxisAlignedBoundingBox
()
:
min
(
Vec3
(
-
std
::
numeric_limits
<
float
>::
infinity
())),
max
(
Vec3
(
std
::
numeric_limits
<
float
>::
infinity
()))
{
}
AxisAlignedBoundingBox
::
AxisAlignedBoundingBox
(
Vec3
&
min
,
Vec3
&
max
)
...
...
@@ -40,7 +42,7 @@ bool AxisAlignedBoundingBox::intersects(cam::Ray& r) const {
std
::
min
<
float
>
({
std
::
max
<
float
>
(
t1x
,
t2x
),
std
::
max
<
float
>
(
t1y
,
t2y
),
std
::
max
<
float
>
(
t1z
,
t2z
)});
return
tmax
>=
tmin
&&
tmax
>
0
;
return
tmax
>=
tmin
&&
r
.
in_range
(
tmax
)
;
}
bool
AxisAlignedBoundingBox
::
contains
(
Vec3
&
v
)
const
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment