mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-30 07:21:12 +00:00
Use line width 1 as the only guaranteed to be supported value by glLineWidth
This commit is contained in:
parent
6b7363bd59
commit
66390bd8a4
@ -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<osg::Geometry> geometry(new osg::Geometry);
|
||||
|
@ -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;
|
||||
|
||||
|
@ -12,7 +12,7 @@ namespace SceneUtil
|
||||
{
|
||||
osg::ref_ptr<osg::Group> createNavMeshGroup(const dtNavMesh& navMesh, const DetourNavigator::Settings& settings)
|
||||
{
|
||||
const osg::ref_ptr<osg::Group> group(new osg::Group);
|
||||
osg::ref_ptr<osg::Group> group(new osg::Group);
|
||||
DebugDraw debugDraw(*group, osg::Vec3f(0, 0, 10), 1.0f / settings.mRecastScaleFactor);
|
||||
dtNavMeshQuery navMeshQuery;
|
||||
navMeshQuery.init(&navMesh, settings.mMaxNavMeshQueryNodes);
|
||||
|
Loading…
x
Reference in New Issue
Block a user