MultiTextureControl
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGFX_MULTITEXTURECONTROL
#define OSGFX_MULTITEXTURECONTROL
#include <osg/Group>
#include <osgFX/Export>
namespace osgFX
{
class OSGFX_EXPORT MultiTextureControl: public osg::Group {
public:
MultiTextureControl();
MultiTextureControl(const MultiTextureControl& copy, const osg::CopyOp& copyop = osg::CopyOp::SHALLOW_COPY);
META_Node(osgFX, MultiTextureControl);
typedef osg::FloatArray TextureWeights;
void setTextureWeights(TextureWeights* twl) { _textureWeights = twl; }
TextureWeights* getTextureWeights() { return _textureWeights.get(); }
const TextureWeights* getTextureWeights() const { return _textureWeights.get(); }
void setTextureWeight(unsigned int unit, float weight);
float getTextureWeight(unsigned int unit) const { return (unit<_textureWeights->size()) ? (*_textureWeights)[unit] : 0.0f; }
unsigned int getNumTextureWeights() const { return _textureWeights->size(); }
void setUseTexEnvCombine(bool flag) { _useTexEnvCombine = flag; }
bool getUseTexEnvCombine() const { return _useTexEnvCombine; }
void setUseTextureWeightsUniform(bool flag) { _useTextureWeightsUniform = flag; }
bool getUseTextureWeightsUniform() const { return _useTextureWeightsUniform; }
protected:
virtual ~MultiTextureControl() {}
MultiTextureControl& operator = (const MultiTextureControl&) { return *this; }
void updateStateSet();
osg::ref_ptr<TextureWeights> _textureWeights;
bool _useTexEnvCombine;
bool _useTextureWeightsUniform;
};
}
#endif
Group
osgFX::MultiTextureControl::MultiTextureControl
MultiTextureControl(const MultiTextureControl &copy, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgFX::MultiTextureControl::setUseTextureWeightsUniform
void setUseTextureWeightsUniform(bool flag)
Definition MultiTextureControl:48
osgFX::MultiTextureControl::getNumTextureWeights
unsigned int getNumTextureWeights() const
Definition MultiTextureControl:43
osgFX::MultiTextureControl::~MultiTextureControl
virtual ~MultiTextureControl()
Definition MultiTextureControl:53
osgFX::MultiTextureControl::getUseTextureWeightsUniform
bool getUseTextureWeightsUniform() const
Definition MultiTextureControl:49
osgFX::MultiTextureControl::META_Node
META_Node(osgFX, MultiTextureControl)
osgFX::MultiTextureControl::MultiTextureControl
MultiTextureControl()
osgFX::MultiTextureControl::TextureWeights
osg::FloatArray TextureWeights
Definition MultiTextureControl:35
osgFX::MultiTextureControl::setTextureWeights
void setTextureWeights(TextureWeights *twl)
Definition MultiTextureControl:37
osgFX::MultiTextureControl::_useTextureWeightsUniform
bool _useTextureWeightsUniform
Definition MultiTextureControl:61
osgFX::MultiTextureControl::setTextureWeight
void setTextureWeight(unsigned int unit, float weight)
osgFX::MultiTextureControl::_textureWeights
osg::ref_ptr< TextureWeights > _textureWeights
Definition MultiTextureControl:58
osgFX::MultiTextureControl::getUseTexEnvCombine
bool getUseTexEnvCombine() const
Definition MultiTextureControl:46
osgFX::MultiTextureControl::updateStateSet
void updateStateSet()
osgFX::MultiTextureControl::getTextureWeight
float getTextureWeight(unsigned int unit) const
Definition MultiTextureControl:42
osgFX::MultiTextureControl::getTextureWeights
TextureWeights * getTextureWeights()
Definition MultiTextureControl:38
osgFX::MultiTextureControl::_useTexEnvCombine
bool _useTexEnvCombine
Definition MultiTextureControl:60
osgFX::MultiTextureControl::setUseTexEnvCombine
void setUseTexEnvCombine(bool flag)
Definition MultiTextureControl:45
osgFX::MultiTextureControl::getTextureWeights
const TextureWeights * getTextureWeights() const
Definition MultiTextureControl:39
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::Group
Definition Group:29
osg::ref_ptr
Definition ref_ptr:32
osgFX
Definition AnisotropicLighting:25
osg::FloatArray
TemplateArray< GLfloat, Array::FloatArrayType, 1, GL_FLOAT > FloatArray
Definition Array:421
Export
OSGFX_EXPORT
#define OSGFX_EXPORT
Definition osgFX/Export:27