SPIN Framework
Public Member Functions

spin::LightSource Class Reference

A light source, with controllable intensity, color, etc. More...

#include <LightSource.h>

Inheritance diagram for spin::LightSource:
spin::GroupNode spin::ReferencedNode

List of all members.

Public Member Functions

 LightSource (SceneManager *sceneManager, const char *initID)
void setVisible (int visibilityFlag)
void setCutoff (float cutoff)
void setExponent (float exponent)
void setAttenuation (float attenuation)
void setAmbient (float red, float green, float blue, float alpha)
void setDiffuse (float red, float green, float blue, float alpha)
void setSpecular (float red, float green, float blue, float alpha)
int getVisible () const
float getCutoff () const
float getExponent () const
float getAttenuation () const
osg::Vec4 getAmbient () const
osg::Vec4 getDiffuse () const
osg::Vec4 getSpecular () const
virtual std::vector< lo_message > getState () const

Detailed Description

A light source, with controllable intensity, color, etc.

Note that only 8 light sources are available.


Member Function Documentation

osg::Vec4 spin::LightSource::getAmbient ( ) const

Returns the ambient value of the light source in RGBA.

osg::Vec4 spin::LightSource::getDiffuse ( ) const

Returns the diffuse value of the light source in RGBA.

osg::Vec4 spin::LightSource::getSpecular ( ) const

Returns the specular value of the light source in RGBA.

std::vector< lo_message > spin::LightSource::getState ( ) const [virtual]

For each subclass of ReferencedNode, we override the getState() method to fill the vector with the correct set of methods for this particular node

Reimplemented from spin::GroupNode.

int spin::LightSource::getVisible ( ) const

Returns a boolean indicating whether the light source is visible.

void spin::LightSource::setAmbient ( float  red,
float  green,
float  blue,
float  alpha 
)

Sets the ambient value for the light source in RGBA.

void spin::LightSource::setAttenuation ( float  attenuation)

The attenuation parameter controls the amount of attenuation that occurs, as a light moves away from a surface. A value of 0 means no attenuation, so light intensity will be the same for any distance. A value of 1 means full linear attenuation.

void spin::LightSource::setCutoff ( float  cutoff)

Cutoff is an angle (in degrees), measured from the center of the cone to the outer edge. 0 would give us a single laser-point, while 90 degrees will give us a hemisphere of light. Note that 0 is the min, and 90 is the max, but a special value of 180 degrees will turn the spotlight into an omnidirectional light.

void spin::LightSource::setDiffuse ( float  red,
float  green,
float  blue,
float  alpha 
)

Sets the diffuse value for the light source in RGBA.

void spin::LightSource::setExponent ( float  exponent)

This value defines the intensity of the light towards the edges of the cone. As objects move from the center of the spotlight to the edges, we have the option of attenuating the intensity of the light on the surface of the objects

void spin::LightSource::setSpecular ( float  red,
float  green,
float  blue,
float  alpha 
)

Sets the specular value for the light source in RGBA.

void spin::LightSource::setVisible ( int  visibilityFlag)

Set whether the light source is visible.


The documentation for this class was generated from the following files: