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
Clark Lin
hw3d
Commits
1eff4578
Commit
1eff4578
authored
May 05, 2019
by
chili
Browse files
control box position / orientation
parent
724fe1fa
Changes
2
Show whitespace changes
Inline
Side-by-side
hw3d/Box.cpp
View file @
1eff4578
...
...
@@ -77,10 +77,20 @@ bool Box::SpawnControlWindow( int id,Graphics& gfx ) noexcept
bool
open
=
true
;
if
(
ImGui
::
Begin
(
(
"Box "
s
+
std
::
to_string
(
id
)).
c_str
(),
&
open
)
)
{
ImGui
::
Text
(
"Material Properties"
);
const
auto
cd
=
ImGui
::
ColorEdit3
(
"Material Color"
,
&
materialConstants
.
color
.
x
);
const
auto
sid
=
ImGui
::
SliderFloat
(
"Specular Intensity"
,
&
materialConstants
.
specularIntensity
,
0.05
f
,
4.0
f
,
"%.2f"
,
2
);
const
auto
spd
=
ImGui
::
SliderFloat
(
"Specular Power"
,
&
materialConstants
.
specularPower
,
1.0
f
,
200.0
f
,
"%.2f"
,
2
);
dirty
=
cd
||
sid
||
spd
;
ImGui
::
Text
(
"Position"
);
ImGui
::
SliderFloat
(
"R"
,
&
r
,
0.0
f
,
80.0
f
,
"%.1f"
);
ImGui
::
SliderAngle
(
"Theta"
,
&
theta
,
-
180.0
f
,
180.0
f
);
ImGui
::
SliderAngle
(
"Phi"
,
&
phi
,
-
89.0
f
,
89.0
f
);
ImGui
::
Text
(
"Orientation"
);
ImGui
::
SliderAngle
(
"Roll"
,
&
roll
,
-
180.0
f
,
180.0
f
);
ImGui
::
SliderAngle
(
"Pitch"
,
&
pitch
,
-
180.0
f
,
180.0
f
);
ImGui
::
SliderAngle
(
"Yaw"
,
&
yaw
,
-
180.0
f
,
180.0
f
);
}
ImGui
::
End
();
...
...
@@ -88,6 +98,7 @@ bool Box::SpawnControlWindow( int id,Graphics& gfx ) noexcept
{
SyncMaterial
(
gfx
);
}
return
open
;
}
...
...
hw3d/TestObject.h
View file @
1eff4578
...
...
@@ -38,7 +38,7 @@ public:
dx
::
XMMatrixTranslation
(
r
,
0.0
f
,
0.0
f
)
*
dx
::
XMMatrixRotationRollPitchYaw
(
theta
,
phi
,
chi
);
}
pr
ivate
:
pr
otected
:
// positional
float
r
;
float
roll
=
0.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