diff --git a/components/sceneutil/detourdebugdraw.cpp b/components/sceneutil/detourdebugdraw.cpp index 7ef329fc16..0b374846d1 100644 --- a/components/sceneutil/detourdebugdraw.cpp +++ b/components/sceneutil/detourdebugdraw.cpp @@ -56,7 +56,7 @@ namespace SceneUtil mMode = mode; mVertices = new osg::Vec3Array; mColors = new osg::Vec4Array; - mSize = size * mRecastInvertedScaleFactor; + mSize = size; } void DebugDraw::begin(duDebugDrawPrimitives prim, float size) @@ -93,7 +93,8 @@ namespace SceneUtil stateSet->setMode(GL_LIGHTING, osg::StateAttribute::OFF); stateSet->setMode(GL_DEPTH, (mDepthMask ? osg::StateAttribute::ON : osg::StateAttribute::OFF)); stateSet->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); - stateSet->setAttributeAndModes(new osg::LineWidth(mSize)); + // TODO: mSize has to be used for the line width, but not for glLineWidth because of the spec limitations + stateSet->setAttributeAndModes(new osg::LineWidth()); stateSet->setAttributeAndModes(new osg::BlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA)); osg::ref_ptr geometry(new osg::Geometry); diff --git a/components/sceneutil/detourdebugdraw.hpp b/components/sceneutil/detourdebugdraw.hpp index 9b6a28acea..79975cacbc 100644 --- a/components/sceneutil/detourdebugdraw.hpp +++ b/components/sceneutil/detourdebugdraw.hpp @@ -15,7 +15,7 @@ namespace SceneUtil class DebugDraw : public duDebugDraw { public: - DebugDraw(osg::Group& group, const osg::Vec3f& shift, float recastInvertedScaleFactor); + explicit DebugDraw(osg::Group& group, const osg::Vec3f& shift, float recastInvertedScaleFactor); void depthMask(bool state) override; diff --git a/components/sceneutil/navmesh.cpp b/components/sceneutil/navmesh.cpp index b0f356f089..b0ce3499e7 100644 --- a/components/sceneutil/navmesh.cpp +++ b/components/sceneutil/navmesh.cpp @@ -12,7 +12,7 @@ namespace SceneUtil { osg::ref_ptr createNavMeshGroup(const dtNavMesh& navMesh, const DetourNavigator::Settings& settings) { - const osg::ref_ptr group(new osg::Group); + osg::ref_ptr group(new osg::Group); DebugDraw debugDraw(*group, osg::Vec3f(0, 0, 10), 1.0f / settings.mRecastScaleFactor); dtNavMeshQuery navMeshQuery; navMeshQuery.init(&navMesh, settings.mMaxNavMeshQueryNodes);