#include <sglSpotLight.hpp>
Inheritance diagram for sglSpotLight::
Public Methods | |
sglSpotLight () | |
virtual | ~sglSpotLight () |
void | setDirection (const sglVec3f &dir) |
const sglVec3f& | getDirection () const |
void | setCutoff (float cutoff) |
float | getCutoff () const |
void | setExponent (float exponent) |
float | getExponent () const |
virtual void | setup (GLenum gl_light_number) const |
virtual sglNode* | clone (unsigned int mode) const |
virtual void | printInfo (ostream &ostrm, const char *indent_string) const |
Protected Methods | |
void | copyTo (sglSpotLight *dst, unsigned int mode) const |
Protected Attributes | |
sglVec3f | m_direction |
float | m_exponent |
float | m_cutoff |
The following example, configures a spotlight to be positioned along the +Z axis and shine back along the -Z axis. The width of the cone is 45 degrees (actually 90 degrees total), and the exponent (intensity) is set to 3.0:
Example:
sglSpotLight *spot = new sglSpotLight; spot->setDiffuse(0.f, 0.f, 1.f, 1.f); // blue light spot->setPosition(sglVec3f(0., 0., 7.0f)); // move out along +Z axis spot->setDirection(sglVec3f(0., 0., -1.0f)); // point along -Z axis spot->setCutoff(M_PI*0.25f); // 45 degrees spot->setExponent(3.0f);
Definition at line 60 of file sglSpotLight.hpp.
|
default constructor.
|
|
virtual destuctor.
|
|
Set the direction of the spot light. The default is (0, 0, -1).
|
|
Query the current direction of the spot light.
Definition at line 77 of file sglSpotLight.hpp. |
|
Set the half-width of the spot light
|
|
Query the current cutoff angle.
Definition at line 88 of file sglSpotLight.hpp. |
|
Control the concentration of the spot light.
|
|
Query the current exponent value.
Definition at line 99 of file sglSpotLight.hpp. |
|
This function is called during sglCull::draw() function to issue the OpenGL light commands needed to activate this light before rendering.
Reimplemented from sglPositionalLight. |
|
Make a copy of the scenegraph rooted at this node.
Reimplemented from sglPositionalLight. |
|
Output the state of this node to the specified ostream.
Reimplemented from sglPositionalLight. |