1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-02-26 15:39:51 +00:00

Feat(object.cpp): Make object outline an optional argument when selecting it

This commit is contained in:
Dave Corley 2023-12-22 17:22:56 -06:00
parent f287914f1e
commit 23e75bed8f
2 changed files with 4 additions and 4 deletions

View File

@ -33,7 +33,6 @@
#include <osg/StateAttribute>
#include <osg/StateSet>
#include <osg/Vec3>
#include <osg/Vec4f>
#include <osgFX/Scribe>
@ -485,7 +484,7 @@ CSVRender::Object::~Object()
mParentNode->removeChild(mRootNode);
}
void CSVRender::Object::setSelected(bool selected)
void CSVRender::Object::setSelected(bool selected, osg::Vec4f color)
{
mSelected = selected;
@ -499,7 +498,7 @@ void CSVRender::Object::setSelected(bool selected)
mRootNode->removeChild(mBaseNode);
if (selected)
{
mOutline->setWireframeColor(osg::Vec4f(1, 1, 1, 1));
mOutline->setWireframeColor(color);
mOutline->addChild(mBaseNode);
mRootNode->addChild(mOutline);
}

View File

@ -5,6 +5,7 @@
#include <string>
#include <osg/Vec3f>
#include <osg/Vec4f>
#include <osg/ref_ptr>
#include <components/esm/defs.hpp>
@ -138,7 +139,7 @@ namespace CSVRender
~Object();
/// Mark the object as selected, selected objects show an outline effect
void setSelected(bool selected);
void setSelected(bool selected, osg::Vec4f color = osg::Vec4f(1, 1, 1, 1));
bool getSelected() const;