SYNOPSIS
#include <Inventor/annex/FXViz/nodes/SoShadowSpotLight.h>
Inherits SoSpotLight.
Public Member Functions
virtual SoType getTypeId (void) const
SoShadowSpotLight (void)
virtual void GLRender (SoGLRenderAction *action)
Static Public Member Functions
static SoType getClassTypeId (void)
static void initClass (void)
Public Attributes
SoSFNode shadowMapScene
SoSFFloat nearDistance
SoSFFloat farDistance
Protected Member Functions
virtual const SoFieldData * getFieldData (void) const
virtual ~SoShadowSpotLight ()
Static Protected Member Functions
static const SoFieldData ** getFieldDataPtr (void)
Detailed Description
The SoShadowSpotLight class is a node for setting up a spot light which casts shadows.
This node can be used instead of a normal SpotLight if you need to improve the performance by supplying a simplified scene graph to be used when rendering the shadow map(s). For instance, the shadow map scene graph doesn't need any textures or materials, and any non-casters can also be excluded from this scene graph. It's more optimal to use this node than to use the SoShadowStyle node to control this, at the cost of some extra application complexity.
It's especially useful if you have a scene with few shadow caster nodes and lots of shadow receiver nodes.
Currently, this node must be placed somewhere in the SoShadowGroup subgraph to cast shadows.
FILE FORMAT/DEFAULTS:
ShadowSpotLight { shadowMapScene NULL nearDistance -1 farDistance -1 }
Here is the the example from SoShadowGroup, modified to use SoShadowSpotLight instead of a normal SoSpotLight. Notice that only the sphere casts shadows.
DirectionalLight { direction 0 0 -1 intensity 0.2 } ShadowGroup { quality 1 # to get per pixel lighting ShadowSpotLight { location -8 -8 8.0 direction 1 1 -1 cutOffAngle 0.35 dropOffRate 0.7 shadowMapScene DEF sphere Separator { Complexity { value 1.0 } Material { diffuseColor 1 1 0 specularColor 1 1 1 shininess 0.9 } Shuttle { translation0 -3 1 0 translation1 3 -5 0 speed 0.25 on TRUE } Translation { translation -5 0 2 } Sphere { radius 2.0 } } } # need to insert the sphere in the regular scene graph as well USE sphere Separator { Material { diffuseColor 1 0 0 specularColor 1 1 1 shininess 0.9 } Shuttle { translation0 0 -5 0 translation1 0 5 0 speed 0.15 on TRUE } Translation { translation 0 0 -3 } Cube { depth 1.8 } } Separator { Material { diffuseColor 0 1 0 specularColor 1 1 1 shininess 0.9 } Shuttle { translation0 -5 0 0 translation1 5 0 0 speed 0.3 on TRUE } Translation { translation 0 0 -3 } Cube { } } Coordinate3 { point [ -10 -10 -3, 10 -10 -3, 10 10 -3, -10 10 -3 ] } Material { specularColor 1 1 1 shininess 0.9 } Complexity { textureQuality 0.1 } Texture2 { image 2 2 3 0xffffff 0x225588 0x225588 0xffffff } Texture2Transform { scaleFactor 4 4 } FaceSet { numVertices 4 } }
Since:
- Coin 3.0
Constructor & Destructor Documentation
SoShadowSpotLight::SoShadowSpotLight (void)
Constructor.SoShadowSpotLight::~SoShadowSpotLight () [protected], [virtual]
Destructor.Member Function Documentation
SoType SoShadowSpotLight::getClassTypeId (void) [static]
This static method returns the SoType object associated with objects of this class.Reimplemented from SoSpotLight.
SoType SoShadowSpotLight::getTypeId (void) const [virtual]
Returns the type identification of an object derived from a class inheriting SoBase. This is used for run-time type checking and 'downward' casting.Usage example:
void foo(SoNode * node) { if (node->getTypeId() == SoFile::getClassTypeId()) { SoFile * filenode = (SoFile *)node; // safe downward cast, knows the type } }
For application programmers wanting to extend the library with new nodes, engines, nodekits, draggers or others: this method needs to be overridden in all 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 Inventor/nodes/SoSubNode.h (SO_NODE_INIT_CLASS and SO_NODE_CONSTRUCTOR for node classes), Inventor/engines/SoSubEngine.h (for engine classes) and so on.
For more information on writing Coin extensions, see the class documentation of the toplevel superclasses for the various class groups.
Reimplemented from SoSpotLight.
const SoFieldData ** SoShadowSpotLight::getFieldDataPtr (void) [static], [protected]
This API member is considered internal to the library, as it is not likely to be of interest to the application programmer.Reimplemented from SoSpotLight.
const SoFieldData * SoShadowSpotLight::getFieldData (void) const [protected], [virtual]
Returns a pointer to the class-wide field data storage object for this instance. If no fields are present, returns NULL.Reimplemented from SoSpotLight.
void SoShadowSpotLight::initClass (void) [static]
Sets up initialization for data common to all instances of this class, like submitting necessary information to the Coin type system.Reimplemented from SoSpotLight.
void SoShadowSpotLight::GLRender (SoGLRenderAction *action) [virtual]
Action method for the SoGLRenderAction.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.
Reimplemented from SoSpotLight.
Author
Generated automatically by Doxygen for Coin from the source code.