00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef FLTLIGHTSOURCEDEFINITION_H
00016 #define FLTLIGHTSOURCEDEFINITION_H
00017
00018 #include "pandatoolbase.h"
00019
00020 #include "fltRecord.h"
00021
00022 #include "luse.h"
00023
00024
00025
00026
00027
00028
00029
00030
00031 class FltLightSourceDefinition : public FltRecord {
00032 public:
00033 FltLightSourceDefinition(FltHeader *header);
00034
00035 enum LightType {
00036 LT_infinite = 0,
00037 LT_local = 1,
00038 LT_spot = 2
00039 };
00040
00041 int _light_index;
00042 string _light_name;
00043 LColor _ambient;
00044 LColor _diffuse;
00045 LColor _specular;
00046 LightType _light_type;
00047 PN_stdfloat _exponential_dropoff;
00048 PN_stdfloat _cutoff_angle;
00049
00050
00051
00052 PN_stdfloat _yaw;
00053 PN_stdfloat _pitch;
00054
00055 PN_stdfloat _constant_coefficient;
00056 PN_stdfloat _linear_coefficient;
00057 PN_stdfloat _quadratic_coefficient;
00058 bool _modeling_light;
00059
00060 protected:
00061 virtual bool extract_record(FltRecordReader &reader);
00062 virtual bool build_record(FltRecordWriter &writer) const;
00063
00064 public:
00065 virtual TypeHandle get_type() const {
00066 return get_class_type();
00067 }
00068 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00069 static TypeHandle get_class_type() {
00070 return _type_handle;
00071 }
00072 static void init_type() {
00073 FltRecord::init_type();
00074 register_type(_type_handle, "FltLightSourceDefinition",
00075 FltRecord::get_class_type());
00076 }
00077
00078 private:
00079 static TypeHandle _type_handle;
00080
00081 friend class FltHeader;
00082 };
00083
00084 #endif
00085
00086