cherish
|
An interface class that deals with entity::Stroke shader's state. More...
#include <ProgramStroke.h>
Public Member Functions | |
ProgramStroke () | |
void | initialize (osg::StateSet *state, osg::Camera *camera, osg::MatrixTransform *t, bool isFogged) |
void | updateIsFogged (bool f) |
bool | getIsFogged () const |
![]() | |
virtual void | initialize (osg::StateSet *state, osg::Camera *camera, osg::MatrixTransform *t) |
void | updateTransform (osg::MatrixTransform *t) |
osg::MatrixTransform * | getTransform () const |
osg::Camera * | getCamera () const |
Protected Member Functions | |
virtual bool | addPresetShaders () |
virtual bool | addPresetUniforms () |
![]() | |
template<typename T > | |
bool | addUniform (const std::string &name, osg::Uniform::Type type, T *updateCallback=0) |
bool | addUniformCanvasMatrix () |
template<typename T > | |
bool | addUniform (const std::string &name, osg::Uniform::Type type, T value) |
Additional Inherited Members | |
![]() | |
osg::observer_ptr< osg::StateSet > | m_state |
osg::observer_ptr< osg::Camera > | m_camera |
osg::observer_ptr< osg::MatrixTransform > | m_transform |
An interface class that deals with entity::Stroke shader's state.
It is a part of entity::Canvas private members and is applyied to the stroke group, entity::Canvas::m_geodeStrokes. The main goal of the class is to provide an easy to use interface to program's modification, e.g., when isFogged parameter is changed from MainWindow::onStrokeFogFactor().
ProgramStroke::ProgramStroke | ( | ) |
Constructor that also loads the shaders from files and set preset uniforms.
void ProgramStroke::initialize | ( | osg::StateSet * | state, |
osg::Camera * | camera, | ||
osg::MatrixTransform * | t, | ||
bool | isFogged | ||
) |
A method to initialize the internal variables for the future use, must be run right after the constructor.
void ProgramStroke::updateIsFogged | ( | bool | f | ) |
A method to update one of the uniforms of the state set - fog factor.