Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
E
Efficient Realtime Rendering of Complex Closed Form Implicit Surfaces Using Modern RTX Enabled GPUs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
John Hunter
Efficient Realtime Rendering of Complex Closed Form Implicit Surfaces Using Modern RTX Enabled GPUs
Commits
950b4801
Unverified
Commit
950b4801
authored
2 years ago
by
John Hunter
Browse files
Options
Downloads
Patches
Plain Diff
Allow adding and removing of objects
parent
cc679393
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
src/gui.rs
+32
-0
32 additions, 0 deletions
src/gui.rs
with
32 additions
and
0 deletions
src/gui.rs
+
32
−
0
View file @
950b4801
...
...
@@ -67,28 +67,48 @@ pub fn gui_up(gui: &mut Gui, state: &mut GState) {
ui
.add
(
egui
::
Slider
::
new
(
&
mut
state
.cursor_sensitivity
,
0.0
..=
2.0
)
.text
(
"Mouse Sensitivity"
));
ui
.add
(
egui
::
Slider
::
new
(
&
mut
state
.move_speed
,
0.0
..=
2.0
)
.text
(
"Movement Speed"
));
ui
.heading
(
"Meshes"
);
let
mut
meshdel
=
vec!
[];
for
mesh
in
&
mut
state
.meshes
{
ui
.label
(
mesh
.name
.clone
());
meshdel
.push
(
ui
.small_button
(
"remove mesh"
)
.clicked
());
ui
.add
(
egui
::
Slider
::
new
(
&
mut
mesh
.pos.x
,
-
100.0
..=
100.0
)
.text
(
"Position.x"
));
ui
.add
(
egui
::
Slider
::
new
(
&
mut
mesh
.pos.y
,
-
100.0
..=
100.0
)
.text
(
"Position.y"
));
ui
.add
(
egui
::
Slider
::
new
(
&
mut
mesh
.pos.z
,
-
100.0
..=
100.0
)
.text
(
"Position.z"
));
ui
.add
(
egui
::
Slider
::
new
(
&
mut
mesh
.rot.x
.0
,
0.0
..=
360.0
)
.text
(
"Rotation.x"
));
ui
.add
(
egui
::
Slider
::
new
(
&
mut
mesh
.rot.y
.0
,
0.0
..=
360.0
)
.text
(
"Rotation.y"
));
ui
.add
(
egui
::
Slider
::
new
(
&
mut
mesh
.rot.z
.0
,
0.0
..=
360.0
)
.text
(
"Rotation.z"
));
ui
.add
(
egui
::
Slider
::
new
(
&
mut
mesh
.scale.x
,
0.0
..=
2.0
)
.text
(
"Scale.x"
));
ui
.add
(
egui
::
Slider
::
new
(
&
mut
mesh
.scale.y
,
0.0
..=
2.0
)
.text
(
"Scale.y"
));
ui
.add
(
egui
::
Slider
::
new
(
&
mut
mesh
.scale.z
,
0.0
..=
2.0
)
.text
(
"Scale.z"
));
}
for
i
in
meshdel
.into_iter
()
.enumerate
()
.filter_map
(|(
a
,
b
)|
if
b
{
Some
(
a
)}
else
{
None
})
{
state
.meshes
.remove
(
i
);
}
ui
.heading
(
"Implicit Surfaces"
);
let
mut
csgdel
=
vec!
[];
for
csg
in
&
mut
state
.csg
{
ui
.label
(
csg
.name
.clone
());
csgdel
.push
(
ui
.small_button
(
"remove csg"
)
.clicked
());
ui
.add
(
egui
::
Slider
::
new
(
&
mut
csg
.pos.x
,
-
100.0
..=
100.0
)
.text
(
"Position.x"
));
ui
.add
(
egui
::
Slider
::
new
(
&
mut
csg
.pos.y
,
-
100.0
..=
100.0
)
.text
(
"Position.y"
));
ui
.add
(
egui
::
Slider
::
new
(
&
mut
csg
.pos.z
,
-
100.0
..=
100.0
)
.text
(
"Position.z"
));
ui
.add
(
egui
::
Slider
::
new
(
&
mut
csg
.rot.x
.0
,
0.0
..=
360.0
)
.text
(
"Rotation.x"
));
ui
.add
(
egui
::
Slider
::
new
(
&
mut
csg
.rot.y
.0
,
0.0
..=
360.0
)
.text
(
"Rotation.y"
));
ui
.add
(
egui
::
Slider
::
new
(
&
mut
csg
.rot.z
.0
,
0.0
..=
360.0
)
.text
(
"Rotation.z"
));
ui
.add
(
egui
::
Slider
::
new
(
&
mut
csg
.scale.x
,
0.0
..=
2.0
)
.text
(
"Scale.x"
));
ui
.add
(
egui
::
Slider
::
new
(
&
mut
csg
.scale.y
,
0.0
..=
2.0
)
.text
(
"Scale.y"
));
ui
.add
(
egui
::
Slider
::
new
(
&
mut
csg
.scale.z
,
0.0
..=
2.0
)
.text
(
"Scale.z"
));
}
for
i
in
csgdel
.into_iter
()
.enumerate
()
.filter_map
(|(
a
,
b
)|
if
b
{
Some
(
a
)}
else
{
None
})
{
state
.csg
.remove
(
i
);
}
ui
.heading
(
"Lights"
);
let
mut
lightdel
=
vec!
[];
for
light
in
&
mut
state
.lights
{
ui
.label
(
"Light"
);
lightdel
.push
(
ui
.small_button
(
"remove light"
)
.clicked
());
ui
.add
(
egui
::
Slider
::
new
(
&
mut
light
.pos.x
,
-
100.0
..=
100.0
)
.text
(
"Position.x"
));
ui
.add
(
egui
::
Slider
::
new
(
&
mut
light
.pos.y
,
-
100.0
..=
100.0
)
.text
(
"Position.y"
));
ui
.add
(
egui
::
Slider
::
new
(
&
mut
light
.pos.z
,
-
100.0
..=
100.0
)
.text
(
"Position.z"
));
...
...
@@ -96,10 +116,22 @@ pub fn gui_up(gui: &mut Gui, state: &mut GState) {
ui
.add
(
egui
::
Slider
::
new
(
&
mut
light
.colour.y
,
0.0
..=
1.0
)
.text
(
"Colour.g"
));
ui
.add
(
egui
::
Slider
::
new
(
&
mut
light
.colour.z
,
0.0
..=
1.0
)
.text
(
"Colour.b"
));
}
for
i
in
lightdel
.into_iter
()
.enumerate
()
.filter_map
(|(
a
,
b
)|
if
b
{
Some
(
a
)}
else
{
None
})
{
state
.lights
.remove
(
i
);
}
if
(
state
.lights
.len
()
<
32
)
{
if
ui
.small_button
(
"add light"
)
.clicked
()
{
state
.lights
.push
(
Light
::
default
());
}
}
let
fps
:
PlotPoints
=
state
.fps
.iter
()
.enumerate
()
.map
(|(
x
,
y
)|
[
x
as
f64
,
*
y
])
.collect
::
<
Vec
<
_
>>
()
.into
();
let
line
=
Line
::
new
(
fps
);
ui
.heading
(
"FPS"
);
Plot
::
new
(
"fps"
)
.view_aspect
(
2.0
)
.show
(
ui
,
|
plot_ui
|
plot_ui
.line
(
line
));
ui
.heading
(
"Debug"
);
ui
.toggle_value
(
&
mut
state
.debug.bounding_boxes
,
"Render bounding boxes instead"
);
ui
.toggle_value
(
&
mut
state
.debug.disable_meshcull
,
"Disable mesh shader culling"
);
...
...
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