1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
3 * This library is open source and may be redistributed and/or modified under
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
15#define OSG_TexGenNode 1
22/** Node for defining the position of TexGen in the scene. */
23class OSG_EXPORT TexGenNode : public Group
29 TexGenNode(TexGen* texgen);
31 TexGenNode(const TexGenNode& tgb, const CopyOp& copyop=CopyOp::SHALLOW_COPY);
33 META_Node(osg, TexGenNode);
42 /** Set the TexGenNode's ReferenceFrame, either to be relative to its
43 * parent reference frame. */
44 void setReferenceFrame(ReferenceFrame rf);
46 /** Get the TexGenNode's ReferenceFrame.*/
47 ReferenceFrame getReferenceFrame() const { return _referenceFrame; }
49 /** Set the texture unit that this TexGenNode is associated with.*/
50 void setTextureUnit(unsigned int textureUnit) { _textureUnit = textureUnit; }
52 unsigned int getTextureUnit() const { return _textureUnit; }
54 /** Set the TexGen. */
55 void setTexGen(TexGen* texgen);
57 /** Get the TexGen. */
58 inline TexGen* getTexGen() { return _texgen.get(); }
60 /** Get the const TexGen. */
61 inline const TexGen* getTexGen() const { return _texgen.get(); }
63 /** Set whether to use a mutex to ensure ref() and unref() are thread safe.*/
64 virtual void setThreadSafeRefUnref(bool threadSafe);
68 virtual ~TexGenNode();
70 unsigned int _textureUnit;
71 osg::ref_ptr<TexGen> _texgen;
73 ReferenceFrame _referenceFrame;