CLight.h Source File

Chapitre 2

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

CLight.h

00001 
00007 #ifndef __CLIGHT_H__
00008 #define __CLIGHT_H__
00009 
00010 #include "UtilityLib.h"
00011 #include "CMaterial.h"
00012 #include "CNode.h"
00013 #include "CRay.h"
00014 
00015 class CLight : public CNode
00016 {
00017         protected:      
00018                 float           mDiffuseColor;
00019                 float           mSpecularColor;
00020                 CVector3D       mPosition;
00021                 CColor          mColor;
00022                 int                     mLightType;
00023 
00024         public:
00025                 // constructeurs et destructeur
00026                 CLight() {};
00027                 CLight(CVector3D position, float diffuseColor, float specularColor, CColor color, int type) : CNode(LIGHT, "LIGHT")
00028                 { mPosition = position; mDiffuseColor = diffuseColor; mSpecularColor = specularColor; mColor = color; mLightType = type;  }
00029                 virtual ~CLight() {};
00030 
00031                 // get
00032                 __forceinline const CVector3D&  GetPosition() const { return mPosition; }
00033                 __forceinline const CColor&             GetColor() const        { return mColor; }
00034                 __forceinline int                               GetType() const         { return mLightType; }
00035 
00036                 // [hérité de CNode]
00037                 bool IntersectsNode(const CRay& ray, CIntersectInfo *intersectInfo=NULL) { return false; }
00038 
00039                 // La méthode virtuel pure d'éclairage.
00040                 virtual CColor GetLightAt(CVector3D& normal, CVector3D& intersectionPoint, CMaterial* material) = 0;
00041 };
00042 
00043 #endif /* #ifndef __CLIGHT_H__ */

Generated on Fri Apr 19 16:19:34 2002 by doxygen1.2.15