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
ImGui::Text( "Position" );
ImGui::SliderFloat( "R",&r,0.0f,80.0f,"%.1f" );
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::SliderAngle( "Roll",&roll,-180.0f,180.0f );
ImGui::SliderAngle( "Pitch",&pitch,-180.0f,180.0f );
......
#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
{
......
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