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
8ef6d036
Commit
8ef6d036
authored
4 years ago
by
Yoel
Browse files
Options
Downloads
Patches
Plain Diff
Group refactor: Texels working
parent
cbe1993b
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/shape/Group.cpp
+6
-1
6 additions, 1 deletion
RayTracer/shape/Group.cpp
RayTracer/shape/Group.h
+2
-0
2 additions, 0 deletions
RayTracer/shape/Group.h
with
8 additions
and
1 deletion
RayTracer/shape/Group.cpp
+
6
−
1
View file @
8ef6d036
...
@@ -40,11 +40,16 @@ std::optional<cam::Hit> Group::intersect(const cam::Ray& r) const {
...
@@ -40,11 +40,16 @@ std::optional<cam::Hit> Group::intersect(const cam::Ray& r) const {
if
(
result
)
{
if
(
result
)
{
result
=
std
::
optional
<
cam
::
Hit
>
(
result
=
std
::
optional
<
cam
::
Hit
>
(
{
transform
.
toWorld
.
transformPoint
(
result
->
point
()),
{
transform
.
toWorld
.
transformPoint
(
result
->
point
()),
transform
.
toWorldN
.
transformDir
(
result
->
normal
()),
transform
.
toWorldN
.
transformDir
(
result
->
normal
()),
result
->
texel
(),
result
->
scalar
(),
result
->
material
});
result
->
scalar
(),
result
->
material
});
}
}
return
result
;
return
result
;
}
}
// Not used
std
::
pair
<
float
,
float
>
Group
::
texture_coordinates
(
const
util
::
Vec3
&
pos
)
const
{
return
std
::
pair
<
float
,
float
>
({
0
,
0
});
}
util
::
AxisAlignedBoundingBox
Group
::
bounds
()
const
{
util
::
AxisAlignedBoundingBox
Group
::
bounds
()
const
{
return
boundingVolume
;
return
boundingVolume
;
}
}
...
...
This diff is collapsed.
Click to expand it.
RayTracer/shape/Group.h
+
2
−
0
View file @
8ef6d036
...
@@ -14,6 +14,8 @@ class Group : public Shape {
...
@@ -14,6 +14,8 @@ class Group : public Shape {
Group
(
const
util
::
Mat4
&
matrix
,
bool
rebuildBB
=
true
);
Group
(
const
util
::
Mat4
&
matrix
,
bool
rebuildBB
=
true
);
std
::
optional
<
cam
::
Hit
>
intersect
(
const
cam
::
Ray
&
r
)
const
override
;
std
::
optional
<
cam
::
Hit
>
intersect
(
const
cam
::
Ray
&
r
)
const
override
;
virtual
std
::
pair
<
float
,
float
>
texture_coordinates
(
const
util
::
Vec3
&
pos
)
const
override
;
util
::
AxisAlignedBoundingBox
bounds
()
const
override
;
util
::
AxisAlignedBoundingBox
bounds
()
const
override
;
void
setBounds
(
const
util
::
AxisAlignedBoundingBox
&
bb
);
void
setBounds
(
const
util
::
AxisAlignedBoundingBox
&
bb
);
void
add
(
const
Group
&
group
);
void
add
(
const
Group
&
group
);
...
...
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