From 0b8dcc8fbce393a49d485575985ce4bee3ef8eae Mon Sep 17 00:00:00 2001
From: Peter Kaiser <peter.kaiser@kit.edu>
Date: Mon, 18 Jul 2016 17:40:14 +0200
Subject: [PATCH] DebugDrawer: Enabled two-sided lighting for polygons

---
 .../components/DebugDrawer/DebugDrawerComponent.cpp    | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp b/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp
index 9690608e4..e75b9614d 100644
--- a/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp
+++ b/source/RobotAPI/components/DebugDrawer/DebugDrawerComponent.cpp
@@ -49,6 +49,7 @@
 #include <Inventor/SbVec3f.h>
 #include <Inventor/fields/SoMFVec3f.h>
 #include <Inventor/fields/SoMFColor.h>
+#include <Inventor/nodes/SoShapeHints.h>
 
 #include <ArmarXCore/core/system/ArmarXDataPath.h>
 #include <ArmarXCore/core/system/cmake/CMakePackageFinder.h>
@@ -822,7 +823,14 @@ namespace armarx
             return;
         }
 
-        SoSeparator* sep = VirtualRobot::CoinVisualizationFactory::CreatePolygonVisualization(d.points, d.colorInner, d.colorBorder, d.lineWidth);
+        SoSeparator* sep = new SoSeparator;
+
+        SoShapeHints* hints = new SoShapeHints;
+        hints->vertexOrdering = SoShapeHints::COUNTERCLOCKWISE;
+        hints->shapeType = SoShapeHints::UNKNOWN_SHAPE_TYPE;
+        sep->addChild(hints);
+
+        sep->addChild(VirtualRobot::CoinVisualizationFactory::CreatePolygonVisualization(d.points, d.colorInner, d.colorBorder, d.lineWidth));
         sep->setName(SELECTION_NAME(d.layerName, d.name));
         layer.addedPolygonVisualizations[d.name] = sep;
         layer.mainNode->addChild(sep);
-- 
GitLab