Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members  

WPCG::WP_Light Class Reference

#include <WP_Light.h>

List of all members.

Public Types

enum  WP_Light_Pos_Kind { point, vector }

Public Methods

 WP_Light ()
 WP_Light (unsigned char _number, const WP_Point3D &position, const WP_Color &ambient, const WP_Color &diffuse, const WP_Color &specular, const WP_Color &emissive, bool remote=true)
 WP_Light (const WP_Light &light)
 ~WP_Light ()
WP_Light & operator= (const WP_Light &light)
WP_Light_Pos_Kind getKind () const
WP_Point3DgetPointPosition () const
WP_Vector3DgetVectorPosition () const
void drawOpenGL ()
void setPosition (float x, float y, float z, float h)

Public Attributes

WP_Color ambient_color
WP_Color diffuse_color
WP_Color specular_color
WP_Color emissive_color


Detailed Description

this class represents a light in OpenGL
Author:
Copyright (C) 2001-2002 W.P. van Paassen peter@paassen.tmfweb.nl
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.


Member Enumeration Documentation

enum WPCG::WP_Light::WP_Light_Pos_Kind
 

an enumeration of the kind of position stored in a WP_Light object, being point or vector

Enumeration values:
point 
vector 


Constructor & Destructor Documentation

WPCG::WP_Light::WP_Light   [inline]
 

WPCG::WP_Light::WP_Light unsigned char    _number,
const WP_Point3D   position,
const WP_Color   ambient,
const WP_Color   diffuse,
const WP_Color   specular,
const WP_Color   emissive,
bool    remote = true
[inline]
 

WPCG::WP_Light::WP_Light const WP_Light &    light [inline]
 

WPCG::WP_Light::~WP_Light   [inline]
 


Member Function Documentation

void WPCG::WP_Light::drawOpenGL   [inline]
 

this function is used for drawing the light in OpenGL

WP_Light_Pos_Kind WPCG::WP_Light::getKind   const [inline]
 

this function returns the kind of positional data which is stored in this light, being point or vector (directional lighting)

Returns:
the kind of positional data which is stored in this light, being point or vector (directional lighting)

WP_Point3D* WPCG::WP_Light::getPointPosition   const [inline]
 

this function returns a pointer to a WP_Point3D object representing the position of the light

Returns:
a pointer to a WP_Point3D object representing the position of the light, 0 in case the position is stored as a vector

WP_Vector3D* WPCG::WP_Light::getVectorPosition   const [inline]
 

this function returns a pointer to a WP_Vector3D object representing directional (infinite) light, for example the sun

Returns:
a pointer to a WP_Vector3D object representing the position of the light, 0 in case the position is stored as a point

WP_Light& WPCG::WP_Light::operator= const WP_Light &    light [inline]
 

assignment operator

void WPCG::WP_Light::setPosition float    x,
float    y,
float    z,
float    h
[inline]
 

this function sets the position of the light as a point or a vector

Parameters:
x  the x position of the light in the scene
y  the y position of the light in the scene
z  the z position of the light in the scene
h  the homogenous component of the position of the light. If this is 0, the light is a directional light and the light is not in the scene but remote (like for example the sun) and is represented by a vector, if this is 1 it is represented as a point


Member Data Documentation

WP_Color WPCG::WP_Light::ambient_color
 

the color that this light emmits

WP_Color WPCG::WP_Light::diffuse_color
 

WP_Color WPCG::WP_Light::emissive_color
 

WP_Color WPCG::WP_Light::specular_color
 


The documentation for this class was generated from the following file:
Generated on Tue Jan 28 20:26:39 2003 by doxygen1.2.14 written by Dimitri van Heesch, © 1997-2002