open_toontown_panda3d/pandatool/src/flt/fltLightSourceDefinition.h

78 lines
1.9 KiB
C++

// Filename: fltLightSourceDefinition.h
// Created by: drose (26Aug00)
//
////////////////////////////////////////////////////////////////////
#ifndef FLTLIGHTSOURCEDEFINITION_H
#define FLTLIGHTSOURCEDEFINITION_H
#include <pandatoolbase.h>
#include "fltRecord.h"
#include <luse.h>
////////////////////////////////////////////////////////////////////
// Class : FltLightSourceDefinition
// Description : Represents a single entry in the light source
// palette. This completely defines the color, etc. of
// a single light source, which may be referenced later
// by a FltLightSource bead in the hierarchy.
////////////////////////////////////////////////////////////////////
class FltLightSourceDefinition : public FltRecord {
public:
FltLightSourceDefinition(FltHeader *header);
enum LightType {
LT_infinite = 0,
LT_local = 1,
LT_spot = 2
};
int _light_index;
string _light_name;
Colorf _ambient;
Colorf _diffuse;
Colorf _specular;
LightType _light_type;
float _exponential_dropoff;
float _cutoff_angle; // in degrees
// yaw and pitch only for modeling lights, which are positioned at
// the eyepoint.
float _yaw;
float _pitch;
float _constant_coefficient;
float _linear_coefficient;
float _quadratic_coefficient;
bool _modeling_light;
protected:
virtual bool extract_record(FltRecordReader &reader);
virtual bool build_record(FltRecordWriter &writer) const;
public:
virtual TypeHandle get_type() const {
return get_class_type();
}
virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
static TypeHandle get_class_type() {
return _type_handle;
}
static void init_type() {
FltRecord::init_type();
register_type(_type_handle, "FltLightSourceDefinition",
FltRecord::get_class_type());
}
private:
static TypeHandle _type_handle;
friend class FltHeader;
};
#endif