openscenegraph
LightSource
Go to the documentation of this file.
1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2004 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
14#ifndef OSG_LIGHTSOURCE
15#define OSG_LIGHTSOURCE 1
16
17#include <osg/NodeVisitor>
18#include <osg/Light>
19#include <osg/Group>
20
21namespace osg {
22
25{
26 public:
27
29
32 const CopyOp& copyop=CopyOp::SHALLOW_COPY):
33 Group(ls,copyop),
34 _value(ls._value),
35 _light(dynamic_cast<osg::Light*>(copyop(ls._light.get()))),
36 _referenceFrame(ls._referenceFrame) {}
37
39
41 {
43 ABSOLUTE_RF
44 };
45
58
59 ReferenceFrame getReferenceFrame() const { return _referenceFrame; }
60
62 void setLight(Light* light);
63
65 inline Light* getLight() { return _light.get(); }
66
68 inline const Light* getLight() const { return _light.get(); }
69
72
74 void setLocalStateSetModes(StateAttribute::GLModeValue value = StateAttribute::ON);
75
77 virtual void setThreadSafeRefUnref(bool threadSafe);
78
80
81 protected:
82
83 virtual ~LightSource();
84
87
89};
90
91}
92
93#endif
Definition BoundingSphere:35
Definition CopyOp:41
Definition Group:29
Definition LightSource:25
META_Node(osg, LightSource)
virtual BoundingSphere computeBound() const
void setReferenceFrame(ReferenceFrame rf)
void setLocalStateSetModes(StateAttribute::GLModeValue value=StateAttribute::ON)
LightSource(const LightSource &ls, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Definition LightSource:31
ref_ptr< Light > _light
Definition LightSource:86
void setStateSetModes(StateSet &, StateAttribute::GLModeValue) const
virtual void setThreadSafeRefUnref(bool threadSafe)
void setLight(Light *light)
ReferenceFrame getReferenceFrame() const
Definition LightSource:59
ReferenceFrame
Definition LightSource:41
@ RELATIVE_RF
Definition LightSource:42
const Light * getLight() const
Definition LightSource:68
virtual ~LightSource()
StateAttribute::GLModeValue _value
Definition LightSource:85
ReferenceFrame _referenceFrame
Definition LightSource:88
Light * getLight()
Definition LightSource:65
Definition Light:40
unsigned int GLModeValue
Definition StateAttribute:85
Definition StateSet:46
Definition ref_ptr:32
author: Julien Valentin 2017 (mp3butcher@hotmail.com)
Definition AlphaFunc:19
T * get(unsigned int contextID)
Definition ContextData:152
#define OSG_EXPORT
Definition osg/Export:39