root/OpenSceneGraph/trunk/src/osg/TexGenNode.cpp @ 13041

Revision 13041, 1.7 kB (checked in by robert, 2 years ago)

Ran script to remove trailing spaces and tabs

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
2 *
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.
7 *
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.
12*/
13#include <osg/TexGenNode>
14
15using namespace osg;
16
17TexGenNode::TexGenNode():
18    _referenceFrame(RELATIVE_RF)
19{
20    // switch off culling of tex gen nodes by default.
21    setCullingActive(false);
22
23    _textureUnit = 0;
24    setStateSet(new StateSet);
25    _texgen = new TexGen;
26}
27
28TexGenNode::TexGenNode(const TexGenNode& cn, const CopyOp& copyop):
29    Group(cn,copyop),
30    _textureUnit(cn._textureUnit),
31    _texgen(static_cast<TexGen*>(copyop(cn._texgen.get()))),
32    _referenceFrame(cn._referenceFrame)
33{
34    setStateSet(new StateSet);
35}
36
37TexGenNode::TexGenNode(TexGen *texgen):
38    _referenceFrame(RELATIVE_RF)
39{
40    // switch off culling of tex gen nodes by default.
41    setCullingActive(false);
42
43    _textureUnit = 0;
44    setStateSet(new StateSet);
45    _texgen = texgen;
46}
47
48TexGenNode::~TexGenNode()
49{
50}
51
52void TexGenNode::setReferenceFrame(ReferenceFrame rf)
53{
54    _referenceFrame = rf;
55}
56
57void TexGenNode::setTexGen(TexGen* texgen)
58{
59    _texgen = texgen;
60}
61
62
63void TexGenNode::setThreadSafeRefUnref(bool threadSafe)
64{
65    Group::setThreadSafeRefUnref(threadSafe);
66
67    if (_texgen.valid()) _texgen->setThreadSafeRefUnref(threadSafe);
68}
Note: See TracBrowser for help on using the browser.