LightSource
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 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 OSG_LIGHTSOURCE
#define OSG_LIGHTSOURCE 1
#include <osg/NodeVisitor>
#include <osg/Light>
#include <osg/Group>
namespace osg {
class OSG_EXPORT LightSource : public Group
{
public:
LightSource();
LightSource(const LightSource& ls,
const CopyOp& copyop=CopyOp::SHALLOW_COPY):
Group(ls,copyop),
_value(ls._value),
_light(dynamic_cast<osg::Light*>(copyop(ls._light.get()))),
_referenceFrame(ls._referenceFrame) {}
META_Node(osg, LightSource);
enum ReferenceFrame
{
RELATIVE_RF,
ABSOLUTE_RF
};
void setReferenceFrame(ReferenceFrame rf);
ReferenceFrame getReferenceFrame() const { return _referenceFrame; }
void setLight(Light* light);
inline Light* getLight() { return _light.get(); }
inline const Light* getLight() const { return _light.get(); }
void setStateSetModes(StateSet&,StateAttribute::GLModeValue) const;
void setLocalStateSetModes(StateAttribute::GLModeValue value = StateAttribute::ON);
virtual void setThreadSafeRefUnref(bool threadSafe);
virtual BoundingSphere computeBound() const;
protected:
virtual ~LightSource();
StateAttribute::GLModeValue _value;
ref_ptr<Light> _light;
ReferenceFrame _referenceFrame;
};
}
#endif
Group
Light
NodeVisitor
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::Group::Group
Group()
osg::LightSource::LightSource
LightSource()
osg::LightSource::META_Node
META_Node(osg, LightSource)
osg::LightSource::computeBound
virtual BoundingSphere computeBound() const
osg::LightSource::setReferenceFrame
void setReferenceFrame(ReferenceFrame rf)
osg::LightSource::setLocalStateSetModes
void setLocalStateSetModes(StateAttribute::GLModeValue value=StateAttribute::ON)
osg::LightSource::LightSource
LightSource(const LightSource &ls, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Definition LightSource:31
osg::LightSource::_light
ref_ptr< Light > _light
Definition LightSource:86
osg::LightSource::setStateSetModes
void setStateSetModes(StateSet &, StateAttribute::GLModeValue) const
osg::LightSource::setThreadSafeRefUnref
virtual void setThreadSafeRefUnref(bool threadSafe)
osg::LightSource::setLight
void setLight(Light *light)
osg::LightSource::getReferenceFrame
ReferenceFrame getReferenceFrame() const
Definition LightSource:59
osg::LightSource::ReferenceFrame
ReferenceFrame
Definition LightSource:41
osg::LightSource::ABSOLUTE_RF
@ ABSOLUTE_RF
Definition LightSource:43
osg::LightSource::RELATIVE_RF
@ RELATIVE_RF
Definition LightSource:42
osg::LightSource::getLight
const Light * getLight() const
Definition LightSource:68
osg::LightSource::~LightSource
virtual ~LightSource()
osg::LightSource::_value
StateAttribute::GLModeValue _value
Definition LightSource:85
osg::LightSource::_referenceFrame
ReferenceFrame _referenceFrame
Definition LightSource:88
osg::LightSource::getLight
Light * getLight()
Definition LightSource:65
osg::Light
Definition Light:40
osg::StateAttribute::ON
@ ON
Definition StateAttribute:103
osg::StateAttribute::GLModeValue
unsigned int GLModeValue
Definition StateAttribute:85
osg::StateSet
Definition StateSet:46
osg::ref_ptr
Definition ref_ptr:32
osg
Definition AlphaFunc:19
osg::get
T * get(unsigned int contextID)
Definition ContextData:152
osg::BoundingSphere
BoundingSphered BoundingSphere
Definition BoundingSphere:314
OSG_EXPORT
#define OSG_EXPORT
Definition osg/Export:39