Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Courses
Scotty3D
Commits
32c0c330
Commit
32c0c330
authored
Mar 14, 2021
by
TheNumbat
Browse files
fix halfedge edge normals
parent
6c09f13a
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/geometry/util.cpp
View file @
32c0c330
...
...
@@ -28,6 +28,11 @@ GL::Mesh cone_mesh(float bradius, float tradius, float height, int sides, bool c
return
Gen
::
dedup
({
std
::
move
(
cone
.
verts
),
std
::
move
(
cone
.
elems
)});
}
GL
::
Mesh
cyl_mesh_disjoint
(
float
radius
,
float
height
,
int
sides
)
{
Gen
::
Data
cone
=
Gen
::
cone
(
radius
,
radius
,
height
,
sides
,
false
);
return
GL
::
Mesh
(
std
::
move
(
cone
.
verts
),
std
::
move
(
cone
.
elems
));
}
GL
::
Mesh
torus_mesh
(
float
iradius
,
float
oradius
,
int
segments
,
int
sides
)
{
Gen
::
Data
torus
=
Gen
::
torus
(
iradius
,
oradius
,
segments
,
sides
);
return
Gen
::
dedup
({
std
::
move
(
torus
.
verts
),
std
::
move
(
torus
.
elems
)});
...
...
src/geometry/util.h
View file @
32c0c330
...
...
@@ -11,6 +11,7 @@ GL::Mesh cube_mesh(float radius);
GL
::
Mesh
square_mesh
(
float
radius
);
GL
::
Mesh
quad_mesh
(
float
x
,
float
y
);
GL
::
Mesh
cyl_mesh
(
float
radius
,
float
height
,
int
sides
=
12
,
bool
cap
=
true
);
GL
::
Mesh
cyl_mesh_disjoint
(
float
radius
,
float
height
,
int
sides
=
12
);
GL
::
Mesh
torus_mesh
(
float
iradius
,
float
oradius
,
int
segments
=
48
,
int
sides
=
24
);
GL
::
Mesh
sphere_mesh
(
float
r
,
int
subdivsions
);
GL
::
Mesh
hemi_mesh
(
float
r
);
...
...
src/gui/model.cpp
View file @
32c0c330
...
...
@@ -13,7 +13,7 @@
namespace
Gui
{
Model
::
Model
()
:
spheres
(
Util
::
sphere_mesh
(
0.05
f
,
1
)),
cylinders
(
Util
::
cyl_mesh
(
0.05
f
,
1.0
f
)),
:
spheres
(
Util
::
sphere_mesh
(
0.05
f
,
1
)),
cylinders
(
Util
::
cyl_mesh
_disjoint
(
0.05
f
,
1.0
f
)),
arrows
(
Util
::
arrow_mesh
(
0.05
f
,
0.1
f
,
1.0
f
))
{
}
...
...
Write
Preview
Markdown
is supported
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