Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Johannes Braun
glare
Commits
a0f5455a
Commit
a0f5455a
authored
Jun 10, 2017
by
Johannes Braun
Browse files
Alter existing line instead of creating a new one.
parent
27d47ca9
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/executables/FullExecutable/Application.cpp
View file @
a0f5455a
...
...
@@ -47,7 +47,7 @@ namespace glare
//Create a skybox from cube map.
m_skybox
=
std
::
make_shared
<
core
::
Skybox
>
(
core
::
Skybox
::
collectFilesFrom
(
core
::
asset
(
"/textures/ryfjallet/"
)));
initializeScene
(
core
::
asset
(
"/meshes/scenery/
cube
.dae"
),
1.
f
);
initializeScene
(
core
::
asset
(
"/meshes/scenery/
bunny
.dae"
),
1.
f
);
initializeRenderRequirements
();
initializeAdvanced
();
initializeGUI
();
...
...
src/libraries/linespace/LineSpace.cpp
View file @
a0f5455a
...
...
@@ -51,7 +51,6 @@ namespace glare
const
advanced
::
LocalBVH
&
line_bvh
=
static_cast
<
const
advanced
::
LocalBVH
&>
(
collector
.
datastructure
());
core
::
ClockMS
clock
;
Line
line
;
size_t
index
=
0
;
...
...
@@ -71,30 +70,27 @@ namespace glare
//For all start patches...
for
(
begin
.
index_horizontal
=
0
;
begin
.
index_horizontal
<
face_widths
[
unsigned
(
begin
.
face
)
%
3
];
++
begin
.
index_horizontal
)
for
(
begin
.
index_vertical
=
0
;
begin
.
index_vertical
<
face_heights
[
unsigned
(
begin
.
face
)
%
3
];
++
begin
.
index_vertical
)
for
(
begin
.
index_vertical
=
0
;
begin
.
index_vertical
<
face_heights
[
unsigned
(
begin
.
face
)
%
3
];
++
begin
.
index_vertical
)
{
//... and all end patches...
for
(
end
.
index_horizontal
=
0
;
end
.
index_horizontal
<
face_widths
[
unsigned
(
end
.
face
)
%
3
];
++
end
.
index_horizontal
)
for
(
end
.
index_vertical
=
0
;
end
.
index_vertical
<
face_heights
[
unsigned
(
end
.
face
)
%
3
];
++
end
.
index_vertical
)
{
//... and all end patches...
for
(
end
.
index_horizontal
=
0
;
end
.
index_horizontal
<
face_widths
[
unsigned
(
end
.
face
)
%
3
];
++
end
.
index_horizontal
)
for
(
end
.
index_vertical
=
0
;
end
.
index_vertical
<
face_heights
[
unsigned
(
end
.
face
)
%
3
];
++
end
.
index_vertical
)
{
//... do a center line check.
glm
::
vec4
center_begin
(
patchCenter
(
begin
),
1
);
glm
::
vec4
center_end
(
patchCenter
(
end
),
1
);
math
::
Ray
ray
;
ray
.
direction
=
glm
::
normalize
(
center_end
-
center_begin
).
xyz
;
ray
.
origin
=
center_begin
.
xyz
;
//... do a center line check.
glm
::
vec4
center_begin
(
patchCenter
(
begin
),
1
);
glm
::
vec4
center_end
(
patchCenter
(
end
),
1
);
line
.
nearest
.
barycentric
=
glm
::
vec2
(
-
1
);
line
.
farthest
.
barycentric
=
glm
::
vec2
(
-
1
);
math
::
Ray
ray
;
ray
.
direction
=
glm
::
normalize
(
center_end
-
center_begin
).
xyz
;
ray
.
origin
=
center_begin
.
xyz
;
line_bvh
.
nearestAndFarthestIntersection
(
ray
,
line
.
nearest
,
line
.
farthest
)
;
Line
&
line
=
m_lines
[
lineIndex
(
begin
,
end
)]
;
//Direct index determination instead of incremental.
m_lines
[
lineIndex
(
begin
,
end
)]
=
line
;
}
line
.
nearest
.
barycentric
=
glm
::
vec2
(
-
1
);
line
.
farthest
.
barycentric
=
glm
::
vec2
(
-
1
);
line_bvh
.
nearestAndFarthestIntersection
(
ray
,
line
.
nearest
,
line
.
farthest
);
}
}
}
m_line_buffer
.
setData
(
m_lines
,
gl
::
BufferUsage
::
eDynamicRead
);
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment