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
779ef151
Commit
779ef151
authored
4 years ago
by
Yoel
Browse files
Options
Downloads
Patches
Plain Diff
Changed const members to private and declared and defined getter
parent
1218ed36
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
RayTracer/camera/Hit.cpp
+12
-3
12 additions, 3 deletions
RayTracer/camera/Hit.cpp
RayTracer/camera/Hit.h
+8
-3
8 additions, 3 deletions
RayTracer/camera/Hit.h
with
20 additions
and
6 deletions
RayTracer/camera/Hit.cpp
+
12
−
3
View file @
779ef151
...
...
@@ -7,9 +7,6 @@ Hit::Hit(const util::Vec3& hit, const util::Vec3& n, float t,
const
std
::
shared_ptr
<
material
::
Material
>&
material
)
:
hit
(
hit
),
n
(
n
),
t
(
t
),
material
(
material
)
{
}
bool
Hit
::
scatter
()
const
{
return
material
->
scatter
();
}
Ray
Hit
::
scattered_ray
(
const
Ray
&
inc_ray
)
const
{
return
Ray
(
hit
,
material
->
scattered_d
(
inc_ray
.
d
,
n
),
std
::
numeric_limits
<
float
>::
epsilon
(),
inc_ray
.
tmax
,
true
);
...
...
@@ -20,4 +17,16 @@ util::Vec3 Hit::albedo() const {
util
::
Vec3
Hit
::
emission
()
const
{
return
material
->
emission
(
0
,
0
);
}
bool
Hit
::
scatter
()
const
{
return
material
->
scatter
();
}
util
::
Vec3
Hit
::
hitpoint
()
const
{
return
hit
;
}
util
::
Vec3
Hit
::
normal
()
const
{
return
n
;
}
float
Hit
::
scalar
()
const
{
return
t
;
}
}
// namespace cam
\ No newline at end of file
This diff is collapsed.
Click to expand it.
RayTracer/camera/Hit.h
+
8
−
3
View file @
779ef151
...
...
@@ -8,15 +8,20 @@ class Hit {
public:
Hit
(
const
util
::
Vec3
&
hit
,
const
util
::
Vec3
&
n
,
float
t
,
const
std
::
shared_ptr
<
material
::
Material
>&
material
);
Ray
scattered_ray
(
const
Ray
&
inc_ray
)
const
;
util
::
Vec3
albedo
()
const
;
// TODO TexelPos
util
::
Vec3
emission
()
const
;
// TODO TexelPos
bool
scatter
()
const
;
util
::
Vec3
hitpoint
()
const
;
util
::
Vec3
normal
()
const
;
float
scalar
()
const
;
// Attributes
// TODO TexelPos
const
util
::
Vec3
hit
,
n
;
const
float
t
;
const
std
::
shared_ptr
<
material
::
Material
>
material
;
private:
util
::
Vec3
hit
,
n
;
float
t
;
std
::
shared_ptr
<
material
::
Material
>
material
;
};
}
// namespace cam
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