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

control box position / orientation

parent 724fe1fa
...@@ -77,10 +77,20 @@ bool Box::SpawnControlWindow( int id,Graphics& gfx ) noexcept ...@@ -77,10 +77,20 @@ bool Box::SpawnControlWindow( int id,Graphics& gfx ) noexcept
bool open = true; bool open = true;
if( ImGui::Begin( ("Box "s + std::to_string( id )).c_str(),&open ) ) 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 cd = ImGui::ColorEdit3( "Material Color",&materialConstants.color.x );
const auto sid = ImGui::SliderFloat( "Specular Intensity",&materialConstants.specularIntensity,0.05f,4.0f,"%.2f",2 ); const auto sid = ImGui::SliderFloat( "Specular Intensity",&materialConstants.specularIntensity,0.05f,4.0f,"%.2f",2 );
const auto spd = ImGui::SliderFloat( "Specular Power",&materialConstants.specularPower,1.0f,200.0f,"%.2f",2 ); const auto spd = ImGui::SliderFloat( "Specular Power",&materialConstants.specularPower,1.0f,200.0f,"%.2f",2 );
dirty = cd || sid || spd; dirty = cd || sid || spd;
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::Text( "Orientation" );
ImGui::SliderAngle( "Roll",&roll,-180.0f,180.0f );
ImGui::SliderAngle( "Pitch",&pitch,-180.0f,180.0f );
ImGui::SliderAngle( "Yaw",&yaw,-180.0f,180.0f );
} }
ImGui::End(); ImGui::End();
...@@ -88,6 +98,7 @@ bool Box::SpawnControlWindow( int id,Graphics& gfx ) noexcept ...@@ -88,6 +98,7 @@ bool Box::SpawnControlWindow( int id,Graphics& gfx ) noexcept
{ {
SyncMaterial( gfx ); SyncMaterial( gfx );
} }
return open; return open;
} }
......
...@@ -38,7 +38,7 @@ public: ...@@ -38,7 +38,7 @@ public:
dx::XMMatrixTranslation( r,0.0f,0.0f ) * dx::XMMatrixTranslation( r,0.0f,0.0f ) *
dx::XMMatrixRotationRollPitchYaw( theta,phi,chi ); dx::XMMatrixRotationRollPitchYaw( theta,phi,chi );
} }
private: protected:
// positional // positional
float r; float r;
float roll = 0.0f; float roll = 0.0f;
......
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