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
1c7067f5
Commit
1c7067f5
authored
May 05, 2019
by
chili
Browse files
improved box position control / representation
parent
1eff4578
Changes
2
Hide whitespace changes
Inline
Side-by-side
hw3d/Box.cpp
View file @
1c7067f5
...
...
@@ -86,7 +86,7 @@ bool Box::SpawnControlWindow( int id,Graphics& gfx ) noexcept
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
::
SliderAngle
(
"Phi"
,
&
phi
,
-
180
.0
f
,
180
.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
);
...
...
hw3d/TestObject.h
View file @
1c7067f5
#pragma once
#include "DrawableBase.h"
#include "ChiliMath.h"
template
<
class
T
>
class
TestObject
:
public
DrawableBase
<
T
>
...
...
@@ -24,12 +25,12 @@ public:
{}
void
Update
(
float
dt
)
noexcept
{
roll
+
=
droll
*
dt
;
pitch
+
=
dpitch
*
dt
;
yaw
+
=
dyaw
*
dt
;
theta
+
=
dtheta
*
dt
;
phi
+
=
dphi
*
dt
;
chi
+
=
dchi
*
dt
;
roll
=
wrap_angle
(
roll
+
droll
*
dt
)
;
pitch
=
wrap_angle
(
pitch
+
dpitch
*
dt
)
;
yaw
=
wrap_angle
(
yaw
+
dyaw
*
dt
)
;
theta
=
wrap_angle
(
theta
+
dtheta
*
dt
)
;
phi
=
wrap_angle
(
phi
+
dphi
*
dt
)
;
chi
=
wrap_angle
(
chi
+
dchi
*
dt
)
;
}
DirectX
::
XMMATRIX
GetTransformXM
()
const
noexcept
{
...
...
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