1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
/*
* Modification History
*
* 2001-January-17 Jason Rohrer
* Created.
*/
#ifndef AMBIENT_LIGHTING_GL_INCLUDED
#define AMBIENT_LIGHTING_GL_INCLUDED
#include "LightingGL.h"
/**
* LightingGL implementation that uses constant, specifiable
* light values everywhere. Most useful when combined with
* directional or point lightings using MultiLighting.
*
* Setting color to full white makes this lighting equivalent
* to a NoLightingGL.
*
* @author Jason Rohrer
*/
class AmbientLightingGL : public LightingGL{
public:
/**
* Constructs an AmbientLighting.
*
* @param inColor color and intensity of lighting.
* Is not copied, so cannot be accessed again by caller.
*/
AmbientLightingGL( Color *inColor );
~AmbientLightingGL();
// implements LightingGL interface
void getLighting( Vector3D *inPoint, Vector3D *inNormal,
Color *outColor );
private:
Color *mColor;
};
inline AmbientLightingGL::AmbientLightingGL( Color *inColor )
: mColor( inColor ) {
}
inline AmbientLightingGL::~AmbientLightingGL() {
delete mColor;
}
inline void AmbientLightingGL::getLighting( Vector3D *inPoint,
Vector3D *inNormal, Color *outColor ) {
outColor->r = mColor->r;
outColor->g = mColor->g;
outColor->b = mColor->b;
}
#endif
|