mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-02-26 06:40:22 +00:00
Feat(object.cpp): Make object outline an optional argument when selecting it
This commit is contained in:
parent
f287914f1e
commit
23e75bed8f
@ -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);
|
||||
}
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user