29 #ifndef __X3DLIGHTNODE_H__
30 #define __X3DLIGHTNODE_H__
77 RGBA _ambient =
RGBA(0.0f,0.0f,0.0f, 1.0f),
78 RGBA _diffuse =
RGBA(0.0f,0.0f,0.0f,1.0f),
79 RGBA _specular =
RGBA(0.0f,0.0f,0.0f,1.0f),
81 Vec3f _spotDirection= Vec3f(),
86 H3DFloat _quadraticAttenuation= 0.0f ) :
89 specular ( _specular ),
90 position ( _position ),
91 spotDirection ( _spotDirection ),
92 spotExponent( _spotExponent ),
93 spotCutoff ( _spotCutoff ),
94 linearAttenuation ( _linearAttenuation ),
95 constantAttenuation( _constantAttenuation ),
96 quadraticAttenuation ( _quadraticAttenuation ) {}
109 bool isDirectionalLight() {
110 return position.w == 0;
113 bool isPointLight() {
114 return !isDirectionalLight() && spotCutoff == 180;
118 return !isDirectionalLight() && !isPointLight();
125 Inst< SFFloat> _ambientIntensity = 0,
126 Inst< SFColor> _color = 0,
127 Inst< SFBool > _global = 0,
128 Inst< SFFloat> _intensity = 0,
129 Inst< SFBool > _on = 0,
130 Inst< SFBool > _shadows = 0 );
133 virtual void enableGraphicsState();
136 virtual void disableGraphicsState();
139 #ifndef H3D_GENERATE_DOTROUTE_FILES
143 RGBA(0.0f,0.0f,0.0f,1.0f),
Vec4f(0.0f,0.0f,0.0f,0.0f), Vec3f(), 0,
144 180.0f, 0.0f, 0.0f, 0.0f ); }
162 static GLuint getLightIndex(
string name_for_error );
215 H3DUniquePtr< SFBool >
on;
232 static GLint max_lights;
233 static GLint global_light_index;
244 vector< Matrix4f > global_light_transforms;
Header file for H3DDisplayListObject.
Header file for H3DRenderStateObject.
Contains the SFColor field class.
Contains the SFFloat field class.
Header file for X3DChildNode, X3D scene-graph node.
This abstract interface class is the base class for all node types that wants to create an OpenGL dis...
Definition: H3DDisplayListObject.h:54
This abstract class is the base class for node types that want to change the rendering state temporar...
Definition: H3DRenderStateObject.h:45
TraverseInfo is a structure that is passed along when traversing the scene graph.
Definition: TraverseInfo.h:57
This abstract node type indicates that the concrete nodes which are instantiated based on it may be u...
Definition: X3DChildNode.h:42
The X3DLightNode abstract node type is the base type from which all node types that serve as light so...
Definition: X3DLightNode.h:70
H3DInt32 traverse_sg_counter
count how many times this X3DLightNodes traverseSG function is called.
Definition: X3DLightNode.h:240
static H3DNodeDatabase database
The H3DNodeDatabase for this node.
Definition: X3DLightNode.h:227
H3DUniquePtr< SFBool > global
The global field specifies whether the X3DLightNode affects all geometries in the scene or only those...
Definition: X3DLightNode.h:195
static void decreaseLightIndex()
must be called if getLightIndex have been called outside X3DLightNode.
Definition: X3DLightNode.h:166
TraverseInfo * last_ti_ptr
only interested in adress, what it points to will be invalid
Definition: X3DLightNode.h:236
list< bool > had_light_index
true if a light index was created for each call to enableGraphicsState for this X3DLightNode
Definition: X3DLightNode.h:251
GLuint light_index
Light index for this node, used to enable light.
Definition: X3DLightNode.h:231
H3DUniquePtr< SFBool > on
The on field specifies whether the light is enabled or disabled.
Definition: X3DLightNode.h:215
H3DUniquePtr< SFFloat > intensity
The intensity field specifies the brightness of the direct emission from the light.
Definition: X3DLightNode.h:205
H3DInt32 graphics_state_counter
count nr of times enableGraphicsState is called.
Definition: X3DLightNode.h:242
H3DUniquePtr< SFColor > color
The color field specifies the spectral colour properties of both the direct and ambient light emissio...
Definition: X3DLightNode.h:185
H3DUniquePtr< SFBool > shadows
The shadows field will determine if this light will be part of the shadow calculations of the scene.
Definition: X3DLightNode.h:224
H3DUniquePtr< SFFloat > ambientIntensity
Specifies the intensity of the ambient emission from the light.
Definition: X3DLightNode.h:175
bool act_global
used if the light should act as a global light.
Definition: X3DLightNode.h:247
H3D API namespace.
Definition: Anchor.h:38
The H3DNodeDatabase contains a mapping between a name of a Node and the constructor for the Node with...
Definition: H3DNodeDatabase.h:194
A structure representing a the OpenGL representation of the specified light source.
Definition: X3DLightNode.h:75