16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-22 10:29:19 +02:00

Merge pull request #35 from carmel4a/switchable-debug-visualization-of-traction

Switchable debug visualization of traction
This commit is contained in:
Milek7
2018-12-04 23:52:31 +01:00
committed by GitHub
3 changed files with 16 additions and 1 deletions

View File

@@ -529,7 +529,8 @@ glm::vec3
TTraction::wire_color() const { TTraction::wire_color() const {
glm::vec3 color; glm::vec3 color;
if( false == DebugModeFlag ) { if( !DebugModeFlag || GfxRenderer.settings.force_normal_traction_render )
{
switch( Material ) { // Ra: kolory podzieliłem przez 2, bo po zmianie ambient za jasne były switch( Material ) { // Ra: kolory podzieliłem przez 2, bo po zmianie ambient za jasne były
// trzeba uwzględnić kierunek świecenia Słońca - tylko ze Słońcem widać kolor // trzeba uwzględnić kierunek świecenia Słońca - tylko ze Słońcem widać kolor
case 1: { case 1: {

View File

@@ -365,6 +365,14 @@ debug_panel::render() {
// toggles // toggles
ImGui::Separator(); ImGui::Separator();
ImGui::Checkbox( "Debug Mode", &DebugModeFlag ); ImGui::Checkbox( "Debug Mode", &DebugModeFlag );
if( DebugModeFlag )
{
ImGui::Indent();
ImGui::Checkbox(
"Draw normal traction",
&GfxRenderer.settings.force_normal_traction_render );
ImGui::Unindent();
}
} }
ImGui::End(); ImGui::End();
} }

View File

@@ -115,6 +115,12 @@ class opengl_renderer {
public: public:
// types // types
/// Renderer runtime settings.
struct Settings
{
/** Force normal render of traction, when user is in debug mode. */
bool force_normal_traction_render { false };
} settings;
// constructors // constructors
opengl_renderer() = default; opengl_renderer() = default;
// destructor // destructor