mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-01-07 12:54:00 +00:00
b2af81bc18
With this PR we convert remaining instantiations of the deprecated osg::NodeCallback in Open MW to SceneUtil::NodeCallback.
45 lines
1000 B
C++
45 lines
1000 B
C++
#ifndef OPENMW_COMPONENTS_SCENEUTIL_LIGHTCONTROLLER_H
|
|
#define OPENMW_COMPONENTS_SCENEUTIL_LIGHTCONTROLLER_H
|
|
|
|
#include <components/sceneutil/nodecallback.hpp>
|
|
#include <osg/Vec4f>
|
|
|
|
namespace SceneUtil
|
|
{
|
|
|
|
class LightSource;
|
|
|
|
/// @brief Controller class to handle a pulsing and/or flickering light
|
|
class LightController : public SceneUtil::NodeCallback<LightController, SceneUtil::LightSource*>
|
|
{
|
|
public:
|
|
enum LightType {
|
|
LT_Normal,
|
|
LT_Flicker,
|
|
LT_FlickerSlow,
|
|
LT_Pulse,
|
|
LT_PulseSlow
|
|
};
|
|
|
|
LightController();
|
|
|
|
void setType(LightType type);
|
|
|
|
void setDiffuse(const osg::Vec4f& color);
|
|
|
|
void operator()(SceneUtil::LightSource* node, osg::NodeVisitor* nv);
|
|
|
|
private:
|
|
LightType mType;
|
|
osg::Vec4f mDiffuseColor;
|
|
float mPhase;
|
|
float mBrightness;
|
|
double mStartTime;
|
|
double mLastTime;
|
|
float mTicksToAdvance;
|
|
};
|
|
|
|
}
|
|
|
|
#endif
|