.TH "SoShadowDirectionalLight" 3 "Thu May 29 2014" "Version 4.0.0a" "Coin" \" -*- nroff -*- .ad l .nh .SH NAME SoShadowDirectionalLight \- .PP The \fBSoShadowDirectionalLight\fP class is a node for setting up a directional light which casts shadows\&. .SH SYNOPSIS .br .PP .PP \fC#include \fP .PP Inherits \fBSoDirectionalLight\fP\&. .SS "Public Member Functions" .in +1c .ti -1c .RI "virtual \fBSoType\fP \fBgetTypeId\fP (void) const " .br .RI "\fIReturns the type identification of an object derived from a class inheriting \fBSoBase\fP\&. This is used for run-time type checking and 'downward' casting\&. \fP" .ti -1c .RI "\fBSoShadowDirectionalLight\fP (void)" .br .ti -1c .RI "virtual void \fBGLRender\fP (\fBSoGLRenderAction\fP *action)" .br .in -1c .SS "Static Public Member Functions" .in +1c .ti -1c .RI "static \fBSoType\fP \fBgetClassTypeId\fP (void)" .br .ti -1c .RI "static void \fBinitClass\fP (void)" .br .in -1c .SS "Public Attributes" .in +1c .ti -1c .RI "\fBSoSFNode\fP \fBshadowMapScene\fP" .br .ti -1c .RI "\fBSoSFFloat\fP \fBmaxShadowDistance\fP" .br .ti -1c .RI "\fBSoSFVec3f\fP \fBbboxCenter\fP" .br .ti -1c .RI "\fBSoSFVec3f\fP \fBbboxSize\fP" .br .in -1c .SS "Protected Member Functions" .in +1c .ti -1c .RI "virtual const \fBSoFieldData\fP * \fBgetFieldData\fP (void) const " .br .ti -1c .RI "virtual \fB~SoShadowDirectionalLight\fP ()" .br .in -1c .SS "Static Protected Member Functions" .in +1c .ti -1c .RI "static const \fBSoFieldData\fP ** \fBgetFieldDataPtr\fP (void)" .br .in -1c .SS "Additional Inherited Members" .SH "Detailed Description" .PP The \fBSoShadowDirectionalLight\fP class is a node for setting up a directional light which casts shadows\&. Directional lights usually affect everything, but since it's not always feasible to use one shadow map for the entire scene graph\&. This node has some extra features to work around this\&. .PP It calculates the intersection between the current view volume and either the scene bounding box, or the bounding box provided in this node\&. The shadows are only calculated for this volume\&. This means that you'll get more detailed shadows as you zoom in on items in the scene graph\&. .PP In addition, you can set the maximum distance from the camera which will be shaded with shadows\&. Think of this a new far plane for the camera which only affects shadows\&. .PP As with \fBSoShadowSpotLight\fP, it's possible to optimize further by setting your own shadow caster scene graph in the shadowMapScene field\&. .PP The example scene graph below demonstrates how you can use this node to create shadows on a large number of objects, and still get decent precision when zooming in\&. To further reduce the volume covered by the shadowmap, you can set \fImaxShadowDistance\fP to some number > 0\&. This is the distance from the camera where shadows will be visible\&. .PP .PP .nf DirectionalLight { direction 0 0 -1 intensity 0\&.2 } ShadowGroup { quality 1 # to get per pixel lighting precision 1 ShadowDirectionalLight { direction 1 1 -1 intensity 0\&.8 # enable this to reduce the shadow view distance # maxShadowDistance 200 } # 900 cubes spaced out over a fairly large area Array { origin CENTER numElements1 30 numElements2 30 numElements3 1 separation1 20 0 0 separation2 0 20 0 separation3 0 0 0 Material { diffuseColor 1 0 0 specularColor 1 1 1 } Cube { width 4 height 4 depth 4 } } # a chess board Coordinate3 { point [ -400 -400 -3, 400 -400 -3, 400 400 -3, -400 400 -3 ] } Material { specularColor 1 1 1 shininess 0\&.9 } Complexity { textureQuality 0\&.1 } Texture2 { image 2 2 3 0xffffff 0x225588 0x225588 0xffffff } Texture2Transform { scaleFactor 20 20 } FaceSet { numVertices 4 } } .fi .PP .PP \fBSince:\fP .RS 4 Coin 3\&.0 .RE .PP .SH "Constructor & Destructor Documentation" .PP .SS "SoShadowDirectionalLight::SoShadowDirectionalLight (void)" Constructor\&. .SS "SoShadowDirectionalLight::~SoShadowDirectionalLight ()\fC [protected]\fP, \fC [virtual]\fP" Destructor\&. .SH "Member Function Documentation" .PP .SS "\fBSoType\fP SoShadowDirectionalLight::getTypeId (void) const\fC [virtual]\fP" .PP Returns the type identification of an object derived from a class inheriting \fBSoBase\fP\&. This is used for run-time type checking and 'downward' casting\&. Usage example: .PP .PP .nf void foo(SoNode * node) { if (node->getTypeId() == SoFile::getClassTypeId()) { SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type } } .fi .PP .PP For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in \fIall\fP subclasses\&. This is typically done as part of setting up the full type system for extension classes, which is usually accomplished by using the pre-defined macros available through for instance \fBInventor/nodes/SoSubNode\&.h\fP (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine\&.h (for engine classes) and so on\&. .PP For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups\&. .PP Reimplemented from \fBSoDirectionalLight\fP\&. .SS "const \fBSoFieldData\fP * SoShadowDirectionalLight::getFieldData (void) const\fC [protected]\fP, \fC [virtual]\fP" Returns a pointer to the class-wide field data storage object for this instance\&. If no fields are present, returns \fCNULL\fP\&. .PP Reimplemented from \fBSoDirectionalLight\fP\&. .SS "void SoShadowDirectionalLight::GLRender (\fBSoGLRenderAction\fP *action)\fC [virtual]\fP" Action method for the \fBSoGLRenderAction\fP\&. .PP This is called during rendering traversals\&. Nodes influencing the rendering state in any way or who wants to throw geometry primitives at OpenGL overrides this method\&. .PP Reimplemented from \fBSoDirectionalLight\fP\&. .SH "Author" .PP Generated automatically by Doxygen for Coin from the source code\&.