genlight.h

Go to the documentation of this file.
00001 /**********************************************************************
00002  *<
00003     FILE: genlight.h
00004 
00005     DESCRIPTION:  Defines General-Purpose lights
00006 
00007     CREATED BY: Tom Hudson
00008 
00009     HISTORY: created 5 December 1995
00010 
00011  *> Copyright (c) 1995, All Rights Reserved.
00012  **********************************************************************/
00013 #pragma once
00014 #include "object.h"
00015 
00016 
00017 #define OMNI_LIGHT      0   // Omnidirectional
00018 #define TSPOT_LIGHT     1   // Targeted
00019 #define DIR_LIGHT       2   // Directional
00020 #define FSPOT_LIGHT     3   // Free
00021 #define TDIR_LIGHT      4   // Targeted directional
00022 
00023 #define NUM_LIGHT_TYPES 5
00024 
00025 #define DECAY_NONE  0
00026 #define DECAY_INV   1
00027 #define DECAY_INVSQ 2
00028 
00029 // SetAtten types
00030 #define ATTEN1_START    0  // near
00031 #define ATTEN1_END      1  // near
00032 #define ATTEN_START     2  // far
00033 #define ATTEN_END       3  // far
00034 
00035 // Shapes
00036 #define RECT_LIGHT      0
00037 #define CIRCLE_LIGHT    1
00038 
00039 class ShadowType;
00040 
00041 #pragma warning(push)
00042 #pragma warning(disable:4100 4239)
00043 
00049 class GenLight: public LightObject
00050 {
00051 public:
00062     virtual GenLight *NewLight(int type)=0;
00063     virtual RefResult EvalLightState(TimeValue t, Interval& valid, LightState* cs)=0;
00071     virtual int Type()=0;  // OMNI_LIGHT, TSPOT_LIGHT, DIR_LIGHT, FSPOT_LIGHT, TDIR_LIGHT
00072     virtual void SetType(int tp) {} // OMNI_LIGHT, TSPOT_LIGHT, DIR_LIGHT, FSPOT_LIGHT, TDIR_LIGHT      
00074     virtual BOOL IsSpot()=0;
00076     virtual BOOL IsDir()=0;
00081     virtual void SetUseLight(int onOff)=0;
00083     virtual BOOL GetUseLight(void)=0;
00091     virtual void SetSpotShape(int s)=0;
00097     virtual int GetSpotShape(void)=0;
00105     virtual void SetHotspot(TimeValue time, float f)=0;
00113     virtual float GetHotspot(TimeValue t, Interval& valid = Interval(0,0))=0;
00120     virtual void SetFallsize(TimeValue time, float f)=0;
00129     virtual float GetFallsize(TimeValue t, Interval& valid = Interval(0,0))=0;
00147     virtual void SetAtten(TimeValue time, int which, float f)=0;
00166     virtual float GetAtten(TimeValue t, int which, Interval& valid = Interval(0,0))=0;
00173     virtual void SetTDist(TimeValue time, float f)=0;
00181     virtual float GetTDist(TimeValue t, Interval& valid = Interval(0,0))=0;
00191     virtual ObjLightDesc *CreateLightDesc(INode *inode, BOOL forceShadowBuf=FALSE )=0;
00192     //JH 06/03/03 overload with RenderGlobalContext as additional arg
00193     //allows extended light sources to simplify based on global render params
00194     virtual ObjLightDesc *CreateLightDesc(RenderGlobalContext *rgc, INode *inode, BOOL forceShadowBuf=FALSE )
00195     {return CreateLightDesc(inode, forceShadowBuf);}
00202     virtual void SetRGBColor(TimeValue t, Point3& rgb)=0;
00210     virtual Point3 GetRGBColor(TimeValue t, Interval &valid = Interval(0,0))=0;
00227     virtual void SetHSVColor(TimeValue t, Point3& hsv)=0;
00236     virtual Point3 GetHSVColor(TimeValue t, Interval &valid = Interval(0,0))=0;
00244     virtual void SetIntensity(TimeValue time, float f)=0;
00253     virtual float GetIntensity(TimeValue t, Interval& valid = Interval(0,0))=0;
00260     virtual void SetContrast(TimeValue time, float f)=0;
00268     virtual float GetContrast(TimeValue t, Interval& valid = Interval(0,0))=0;
00275     virtual void SetAspect(TimeValue t, float f)=0;
00284     virtual float GetAspect(TimeValue t, Interval& valid = Interval(0,0))=0;
00294     virtual void SetConeDisplay(int s, int notify=TRUE)=0;
00297     virtual BOOL GetConeDisplay(void)=0;
00302     virtual void SetUseAtten(int s)=0;
00304     virtual BOOL GetUseAtten(void)=0;
00310     virtual void SetAttenDisplay(int s)=0;
00313     virtual BOOL GetAttenDisplay(void)=0;
00318     virtual void SetUseAttenNear(int s)=0;
00320     virtual BOOL GetUseAttenNear(void)=0;
00326     virtual void SetAttenNearDisplay(int s)=0;
00329     virtual BOOL GetAttenNearDisplay(void)=0;
00334     virtual void Enable(int enab)=0;
00341     virtual void SetMapBias(TimeValue t, float f)=0;
00349     virtual float GetMapBias(TimeValue t, Interval& valid = Interval(0,0))=0;
00356     virtual void SetMapRange(TimeValue t, float f)=0;
00364     virtual float GetMapRange(TimeValue t, Interval& valid = Interval(0,0))=0;
00371     virtual void SetMapSize(TimeValue t, int f)=0;
00379     virtual int GetMapSize(TimeValue t, Interval& valid = Interval(0,0))=0;
00386     virtual void SetRayBias(TimeValue t, float f)=0;
00394     virtual float GetRayBias(TimeValue t, Interval& valid = Interval(0,0))=0;
00395 
00398     virtual int GetUseGlobal()=0;
00403     virtual void SetUseGlobal(int a)=0;
00408     virtual int GetShadow()=0;
00416     virtual void SetShadow(int a)=0;
00417 
00426     virtual int GetShadowType()=0;
00436     virtual void SetShadowType(int a)=0;
00437 
00438     // Pluggable Shadow generator (11/2/98): 
00445     virtual void SetShadowGenerator(ShadowType *s) {};
00450     virtual ShadowType *GetShadowGenerator() { return NULL; } 
00451 
00452     virtual int GetAbsMapBias()=0;
00453     virtual void SetAbsMapBias(int a)=0;
00454 
00463     virtual void SetAtmosShadows(TimeValue t, int onOff) {}
00469     virtual int GetAtmosShadows(TimeValue t) { return 0; }
00478     virtual void SetAtmosOpacity(TimeValue t, float f) {}
00488     virtual float GetAtmosOpacity(TimeValue t, Interval& valid=FOREVER) { return 0.0f; }
00497     virtual void SetAtmosColAmt(TimeValue t, float f) {}
00507     virtual float GetAtmosColAmt(TimeValue t, Interval& valid=FOREVER) { return 0.0f; }
00508     virtual void SetUseShadowColorMap(TimeValue t, int onOff) { }
00509     virtual int GetUseShadowColorMap(TimeValue t) { return FALSE; }
00510     
00512     virtual int GetOvershoot()=0;
00517     virtual void SetOvershoot(int a)=0;
00518 
00520     virtual ExclList& GetExclusionList()=0;
00525     virtual void SetExclusionList(ExclList &list)=0;
00526 
00532     virtual BOOL SetHotSpotControl(Control *c)=0;
00538     virtual BOOL SetFalloffControl(Control *c)=0;
00544     virtual BOOL SetColorControl(Control *c)=0;
00546     virtual Control* GetHotSpotControl()=0;
00548     virtual Control* GetFalloffControl()=0;
00550     virtual Control* GetColorControl()=0;
00551     
00556     virtual void SetAffectDiffuse(BOOL onOff) {}
00559     virtual BOOL GetAffectDiffuse() {return 0;}
00564     virtual void SetAffectSpecular(BOOL onOff) {}
00567     virtual BOOL GetAffectSpecular() {return 0;}
00568 
00576     virtual void SetDecayType(BOOL onOff) {}
00582     virtual BOOL GetDecayType() {return 0;}
00591     virtual void SetDecayRadius(TimeValue time, float f) {}
00601     virtual float GetDecayRadius(TimeValue t, Interval& valid = Interval(0,0)) { return 0.0f;}
00610     virtual void SetDiffuseSoft(TimeValue time, float f) {}
00620     virtual float GetDiffuseSoft(TimeValue t, Interval& valid = Interval(0,0)) { return 0.0f; }
00621 
00630     virtual void SetShadColor(TimeValue t, Point3& rgb) {}
00640     virtual Point3 GetShadColor(TimeValue t, Interval &valid = Interval(0,0)) { return Point3(0,0,0); }
00645     virtual BOOL GetLightAffectsShadow() { return 0; }
00652     virtual void SetLightAffectsShadow(BOOL b) {  }
00662     virtual void SetShadMult(TimeValue t, float m) {}
00673     virtual float GetShadMult(TimeValue t, Interval &valid = Interval(0,0)) { return 1.0f; }
00674 
00679     virtual Texmap* GetProjMap() { return NULL;  }
00686     virtual void SetProjMap(Texmap* pmap) {}
00691     virtual Texmap* GetShadowProjMap() { return NULL;  }
00698     virtual void SetShadowProjMap(Texmap* pmap) {}
00699 
00706     virtual void SetAmbientOnly(BOOL onOff) {  }
00710     virtual BOOL GetAmbientOnly() { return FALSE; }
00711 
00712     /* [dl | 01apr2003] These methods were used by mental ray to retrieve indirect
00713        illumination properties from MAX standard lights. The standard lights implemented
00714        a rollup to specify these properties. The new mental ray connection no longer
00715        uses these properties, but instead uses a custom attribute. These methods have
00716        therefore become useless, and we decided to remove them to avoid cluttering the SDK
00717        with deprecated functionality.
00718     virtual void SetEmitterEnable(TimeValue t, BOOL onOff) {}
00719     virtual BOOL GetEmitterEnable(TimeValue t, Interval& valid = Interval(0,0)) { return 0; }
00720     virtual void SetEmitterEnergy(TimeValue t, float energy) {}
00721     virtual float GetEmitterEnergy(TimeValue t, Interval& valid = Interval(0,0)) { return 0.0f; }
00722     virtual void SetEmitterDecayType(TimeValue t, int decay) {}
00723     virtual int  GetEmitterDecayType(TimeValue t, Interval& valid = Interval(0,0)) { return 0; }
00724     virtual void SetEmitterCausticPhotons(TimeValue t, int photons) {}
00725     virtual int  GetEmitterCausticPhotons(TimeValue t, Interval& valid = Interval(0,0)) { return 0; }
00726     virtual void SetEmitterGlobalIllumPhotons(TimeValue t, int photons) {}
00727     virtual int  GetEmitterGlobalIllumPhotons(TimeValue t, Interval& valid = Interval(0,0)) { return 0; }
00728     */
00729 };
00730 
00731 #pragma warning(pop)
00732 
00733