#include <sglLight.hpp>
Inheritance diagram for sglLight::
Public Methods | |
sglLight () | |
virtual | ~sglLight () |
void | setOn (bool on) |
bool | getOn () const |
void | setAmbient (const sglVec4f &color) |
void | setAmbient (float r, float g, float b, float a) |
const sglVec4f& | getAmbient () const |
void | setDiffuse (const sglVec4f &color) |
void | setDiffuse (float r, float g, float b, float a) |
const sglVec4f& | getDiffuse () const |
void | setSpecular (const sglVec4f &color) |
void | setSpecular (float r, float g, float b, float a) |
const sglVec4f& | getSpecular () const |
virtual void | setup (GLenum gl_light_number) const |
virtual void | printInfo (ostream &ostrm, const char *indent_string) const |
Protected Methods | |
virtual void | cull (sglCull< float > &trav_state, unsigned int cull_flags) const |
virtual void | cull (sglCull< double > &trav_state, unsigned int cull_flags) const |
void | copyTo (sglLight *dst, unsigned int mode) const |
Protected Attributes | |
bool | m_on_flag |
sglVec4f | m_ambient |
sglVec4f | m_diffuse |
sglVec4f | m_specular |
When constructed the light will be enabled by default, and will have no ambient component (black), and white diffuse and specular components. The user can disable the light by calling the member function, sglLight::setOn(false). The various components of light can be set with calls to setAmbient, setDiffuse, and setSpecular member functions.
Some global OpenGL lighting concepts such as global ambient, local light model, and two-sided lighting have not been implmented in SGL yet (the user must currently call these OpenGL commands directly). They might be implemented as static functions in this class.
Implement toggle for local light model.
Implement toggle for two sided lighting.
Definition at line 65 of file sglLight.hpp.
|
default constructor.
|
|
virtual destructor.
|
|
Enable/disable the light.
|
|
Get the current state (on or off) of this light.
Definition at line 81 of file sglLight.hpp. |
|
Set the ambient color component of the light.
Definition at line 86 of file sglLight.hpp. |
|
Set the ambient color component of the light. Default is (0, 0, 0, 1)
Definition at line 94 of file sglLight.hpp. |
|
Get the current ambient component.
Definition at line 100 of file sglLight.hpp. |
|
Set the diffuse color component of the light.
Definition at line 105 of file sglLight.hpp. |
|
Set the diffuse color component of the light. Default is (1, 1, 1, 1)
Definition at line 113 of file sglLight.hpp. |
|
Get the current diffuse component.
Definition at line 119 of file sglLight.hpp. |
|
Set the specular color component of the light.
Definition at line 124 of file sglLight.hpp. |
|
Set the specular color component of the light. Default is (1, 1, 1, 1)
Definition at line 132 of file sglLight.hpp. |
|
Get the current specular component.
Definition at line 138 of file sglLight.hpp. |
|
This function is called during sglCull::draw() function to issue the OpenGL light commands needed to activate this light before rendering.
Reimplemented in sglDirectionalLight, sglPositionalLight, and sglSpotLight. |
|
Output the state of this node to the specified ostream.
Reimplemented from sglNode. Reimplemented in sglDirectionalLight, sglPositionalLight, and sglSpotLight. |
|
The single precision cull traversal function that culls out subgraphs that do not lie in the view frustum (stored in the sglCull parameter). Subclasses must implement this function. The entry point for user-friendly culling is in the sglScene class.
Reimplemented from sglNode. |
|
The double precision cull traversal function that culls out subgraphs that do not lie in the view frustum (stored in the sglCull parameter). Subclasses must implement this function. The entry point for user-friendly culling is in the sglScene class.
Reimplemented from sglNode. |