Commit 1c7067f5 authored by chili's avatar chili
Browse files

improved box position control / representation

parent 1eff4578
...@@ -86,7 +86,7 @@ bool Box::SpawnControlWindow( int id,Graphics& gfx ) noexcept ...@@ -86,7 +86,7 @@ bool Box::SpawnControlWindow( int id,Graphics& gfx ) noexcept
ImGui::Text( "Position" ); ImGui::Text( "Position" );
ImGui::SliderFloat( "R",&r,0.0f,80.0f,"%.1f" ); ImGui::SliderFloat( "R",&r,0.0f,80.0f,"%.1f" );
ImGui::SliderAngle( "Theta",&theta,-180.0f,180.0f ); ImGui::SliderAngle( "Theta",&theta,-180.0f,180.0f );
ImGui::SliderAngle( "Phi",&phi,-89.0f,89.0f ); ImGui::SliderAngle( "Phi",&phi,-180.0f,180.0f );
ImGui::Text( "Orientation" ); ImGui::Text( "Orientation" );
ImGui::SliderAngle( "Roll",&roll,-180.0f,180.0f ); ImGui::SliderAngle( "Roll",&roll,-180.0f,180.0f );
ImGui::SliderAngle( "Pitch",&pitch,-180.0f,180.0f ); ImGui::SliderAngle( "Pitch",&pitch,-180.0f,180.0f );
......
#pragma once #pragma once
#include "DrawableBase.h" #include "DrawableBase.h"
#include "ChiliMath.h"
template<class T> template<class T>
class TestObject : public DrawableBase<T> class TestObject : public DrawableBase<T>
...@@ -24,12 +25,12 @@ public: ...@@ -24,12 +25,12 @@ public:
{} {}
void Update( float dt ) noexcept void Update( float dt ) noexcept
{ {
roll += droll * dt; roll = wrap_angle( roll + droll * dt );
pitch += dpitch * dt; pitch = wrap_angle( pitch + dpitch * dt );
yaw += dyaw * dt; yaw = wrap_angle( yaw + dyaw * dt );
theta += dtheta * dt; theta = wrap_angle( theta + dtheta * dt );
phi += dphi * dt; phi = wrap_angle( phi + dphi * dt );
chi += dchi * dt; chi = wrap_angle( chi + dchi * dt );
} }
DirectX::XMMATRIX GetTransformXM() const noexcept DirectX::XMMATRIX GetTransformXM() const noexcept
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment