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
21be98a3
Commit
21be98a3
authored
Jan 30, 2021
by
TheNumbat
Browse files
update simulate gui
parent
e7e0bdde
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/gui/simulate.cpp
View file @
21be98a3
...
@@ -143,13 +143,7 @@ Mode Simulate::UIsidebar(Manager& manager, Scene& scene, Undo& undo, Widgets& wi
...
@@ -143,13 +143,7 @@ Mode Simulate::UIsidebar(Manager& manager, Scene& scene, Undo& undo, Widgets& wi
update_bvh
(
scene
,
undo
);
update_bvh
(
scene
,
undo
);
ImGui
::
Text
(
"Simulation Settings"
);
if
(
ImGui
::
CollapsingHeader
(
"Add New Emitter"
))
{
if
(
ImGui
::
Button
(
"Generate BVH"
))
{
clear_particles
(
scene
);
build_scene
(
scene
);
}
if
(
ImGui
::
CollapsingHeader
(
"New Emitter"
))
{
ImGui
::
PushID
(
0
);
ImGui
::
PushID
(
0
);
static
Scene_Particles
::
Options
gui_opt
;
static
Scene_Particles
::
Options
gui_opt
;
...
@@ -163,6 +157,7 @@ Mode Simulate::UIsidebar(Manager& manager, Scene& scene, Undo& undo, Widgets& wi
...
@@ -163,6 +157,7 @@ Mode Simulate::UIsidebar(Manager& manager, Scene& scene, Undo& undo, Widgets& wi
std
::
numeric_limits
<
float
>::
max
(),
"%.2f"
);
std
::
numeric_limits
<
float
>::
max
(),
"%.2f"
);
ImGui
::
DragFloat
(
"Particles/Sec"
,
&
gui_opt
.
pps
,
1.0
f
,
1.0
f
,
ImGui
::
DragFloat
(
"Particles/Sec"
,
&
gui_opt
.
pps
,
1.0
f
,
1.0
f
,
std
::
numeric_limits
<
float
>::
max
(),
"%.2f"
);
std
::
numeric_limits
<
float
>::
max
(),
"%.2f"
);
ImGui
::
Checkbox
(
"Enabled"
,
&
gui_opt
.
enabled
);
int
n_types
=
(
int
)
Solid_Type
::
count
;
int
n_types
=
(
int
)
Solid_Type
::
count
;
if
(
!
scene
.
has_obj
())
{
if
(
!
scene
.
has_obj
())
{
...
@@ -212,11 +207,18 @@ Mode Simulate::UIsidebar(Manager& manager, Scene& scene, Undo& undo, Widgets& wi
...
@@ -212,11 +207,18 @@ Mode Simulate::UIsidebar(Manager& manager, Scene& scene, Undo& undo, Widgets& wi
particles
.
opt
.
scale
=
gui_opt
.
scale
;
particles
.
opt
.
scale
=
gui_opt
.
scale
;
particles
.
opt
.
lifetime
=
gui_opt
.
lifetime
;
particles
.
opt
.
lifetime
=
gui_opt
.
lifetime
;
particles
.
opt
.
pps
=
gui_opt
.
pps
;
particles
.
opt
.
pps
=
gui_opt
.
pps
;
particles
.
opt
.
enabled
=
gui_opt
.
enabled
;
undo
.
add_particles
(
std
::
move
(
particles
));
undo
.
add_particles
(
std
::
move
(
particles
));
}
}
ImGui
::
PopID
();
ImGui
::
PopID
();
}
}
if
(
ImGui
::
Button
(
"Generate BVH"
))
{
clear_particles
(
scene
);
build_scene
(
scene
);
}
return
mode
;
return
mode
;
}
}
...
...
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