OpenSceneGraph 3.6.5
LightModel
Go to the documentation of this file.
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
14#ifndef OSG_LIGHTMODEL
15#define OSG_LIGHTMODEL 1
16
17#include <osg/StateAttribute>
18#include <osg/Vec4>
19
20namespace osg {
21
23{
24 public :
25
27
35
36
38
40 virtual int compare(const StateAttribute& sa) const
41 {
42 // check the types are equal and then create the rhs variable
43 // used by the COMPARE_StateAttribute_Parameter macros below.
45
46 // compare each parameter in turn against the rhs.
51
52 return 0; // passed all the above comparison macros, must be equal.
53 }
54
55
56 void setAmbientIntensity(const osg::Vec4& ambient) { _ambient = ambient; }
57 const osg::Vec4& getAmbientIntensity() const { return _ambient; }
58
59
65
67 inline ColorControl getColorControl() const { return _colorControl; }
68
69
70 void setLocalViewer(bool localViewer) { _localViewer=localViewer; }
71 inline bool getLocalViewer() const { return _localViewer; }
72
73
74 void setTwoSided(bool twoSided) { _twoSided = twoSided; }
75 inline bool getTwoSided() const { return _twoSided; }
76
77
78
79 virtual void apply(State& state) const;
80
81
82 protected :
83
84 virtual ~LightModel();
85
90
91};
92
93}
94
95#endif
#define COMPARE_StateAttribute_Parameter(parameter)
COMPARE_StateAttribute_Parameter macro is a helper for implementing the StatateAtribute::compare(....
Definition StateAttribute:69
#define COMPARE_StateAttribute_Types(TYPE, rhs_attribute)
COMPARE_StateAttribute_Types macro is a helper for implementing the StateAtribute::compare(....
Definition StateAttribute:57
The core osg library provides the basic scene graph classes such as Nodes, State and Drawables,...
Definition AlphaFunc:19
Vec4f Vec4
Definition Vec4:21
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
void setTwoSided(bool twoSided)
Definition LightModel:74
void setColorControl(ColorControl cc)
Definition LightModel:66
bool _twoSided
Definition LightModel:89
virtual void apply(State &state) const
apply the OpenGL state attributes.
void setAmbientIntensity(const osg::Vec4 &ambient)
Definition LightModel:56
void setLocalViewer(bool localViewer)
Definition LightModel:70
virtual int compare(const StateAttribute &sa) const
Return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.
Definition LightModel:40
bool _localViewer
Definition LightModel:88
META_StateAttribute(osg, LightModel, LIGHTMODEL)
LightModel(const LightModel &lw, const CopyOp &copyop=CopyOp::SHALLOW_COPY)
Copy constructor using CopyOp to manage deep vs shallow copy.
Definition LightModel:29
virtual ~LightModel()
ColorControl _colorControl
Definition LightModel:87
ColorControl
Definition LightModel:61
@ SEPARATE_SPECULAR_COLOR
Definition LightModel:62
@ SINGLE_COLOR
Definition LightModel:63
bool getTwoSided() const
Definition LightModel:75
bool getLocalViewer() const
Definition LightModel:71
const osg::Vec4 & getAmbientIntensity() const
Definition LightModel:57
osg::Vec4 _ambient
Definition LightModel:86
ColorControl getColorControl() const
Definition LightModel:67
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
@ LIGHTMODEL
Definition StateAttribute:148
#define OSG_EXPORT
Definition Export:39

osg logo
Generated at Sun Jul 20 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.