Go to the
documentation of this file.
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #pragma once
00014
00015 #include "ifnpub.h"
00016 #include "GetCOREInterface.h"
00017 #include "Animatable.h"
00018 #include "plugapi.h"
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057 #define NATURAL_LIGHT_CLASS_INTERFACE_ID Interface_ID(0x75985ea5, 0x115c2791)
00058
00059
00085 class INaturalLightClass : public FPStaticInterface {
00086 public:
00087
00088 enum {
00089 natLightIsSun = 0,
00090 natLightIsSky = 1
00091 };
00092
00093 DECLARE_DESCRIPTOR(INaturalLightClass)
00094 #pragma warning(push)
00095 #pragma warning(disable:4100)
00096 BEGIN_FUNCTION_MAP
00097 FN_0(natLightIsSun, TYPE_BOOL, IsSun)
00098 FN_0(natLightIsSky, TYPE_BOOL, IsSky)
00099 END_FUNCTION_MAP
00100 #pragma warning(pop)
00101
00102
00105 virtual BOOL IsSun() const = 0;
00106
00107
00109 virtual BOOL IsSky() const = 0;
00110 };
00111
00112 inline INaturalLightClass* GetNaturalLightClass(SClass_ID s, const Class_ID& id)
00113 {
00114 return static_cast<INaturalLightClass*>( GetInterface(s, id, NATURAL_LIGHT_CLASS_INTERFACE_ID) );
00115 }
00116
00117 inline INaturalLightClass* GetNaturalLightClass(Animatable* a)
00118 {
00119 return a == NULL ? NULL
00120 : GetNaturalLightClass(a->SuperClassID(), a->ClassID());
00121 }
00122
00123
00124 class NaturalLightClassBaseImp : public INaturalLightClass {
00125 public:
00126 NaturalLightClassBaseImp(ClassDesc* cd, int classStrID, int isSunStrID, int isSkyStrID)
00127 : INaturalLightClass(
00128 NATURAL_LIGHT_CLASS_INTERFACE_ID, _M("NaturalLightClass"),
00129 classStrID, cd, FP_STATIC_METHODS,
00130 natLightIsSun, _M("isSun"), isSunStrID, TYPE_BOOL, 0, 0,
00131 natLightIsSky, _M("isSky"), isSkyStrID, TYPE_BOOL, 0, 0,
00132 end) {}
00133 };
00134
00135 inline INaturalLightClass* GetNaturalLightClassInterface(ClassDesc* c)
00136 {
00137 return static_cast<INaturalLightClass*>(c->GetInterface(NATURAL_LIGHT_CLASS_INTERFACE_ID));
00138 }
00139
00140 #define SUNLIGHT_INTERFACE_ID Interface_ID(0x43b76ff2, 0x60ae0d61)
00141
00142
00154 class ISunLight : public BaseInterface {
00155 public:
00156
00157
00160 virtual bool IsIntensityInMAXUnits() const = 0;
00161 };
00162
00163 inline ISunLight* GetSunLightInterface(Animatable* o)
00164 {
00165 return static_cast<ISunLight*>(o->GetInterface(SUNLIGHT_INTERFACE_ID));
00166 }
00167
00168
00176 class SkyLightEval : public BaseInterface {
00177 public:
00178
00180 virtual void DeleteThis() = 0;
00181
00182
00183
00184
00189 virtual bool Gather(
00190 const Point3& origin,
00191 const Point3& direction,
00192 Point3& radiance
00193 ) = 0;
00194
00195
00199 virtual Class_ID ClassID() const = 0;
00200
00201
00202
00209 virtual bool IsSameSky( const SkyLightEval* sky ) const = 0;
00210 };
00211
00212 #define SKYLIGHT_INTERFACE_ID Interface_ID(0x47056297, 0x7f8b06e3)
00213
00214
00241 class ISkyLight : public BaseInterface {
00242 public:
00243
00244
00245
00259 virtual SkyLightEval* CreateSkyEval(
00260 TimeValue t,
00261 INode* node,
00262 const Matrix3& tm
00263 ) = 0;
00264
00265
00266
00268 virtual bool IsIntensityInMAXUnits() const = 0;
00269 };
00270
00271 inline ISkyLight* GetSkyLightInterface(Animatable* o)
00272 {
00273 return static_cast<ISkyLight*>(o->GetInterface(SKYLIGHT_INTERFACE_ID));
00274 }
00275
00276
00277 #define SUNLIGHT_POSITION_INTERFACE_ID Interface_ID(0x6fa56707, 0x4ebe3d73)
00278
00279 class ISunLightPosition : public BaseInterface {
00280 public:
00281 };
00282
00283 inline ISunLightPosition* GetSunLightPositionInterface(Animatable* o)
00284 {
00285 return static_cast<ISunLightPosition*>(o->GetInterface(SUNLIGHT_POSITION_INTERFACE_ID));
00286 }
00287