00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00017 #ifndef _FCD_LIGHT_H_
00018 #define _FCD_LIGHT_H_
00019
00020 #include "FCDocument/FCDTargetedEntity.h"
00021 #include "FUtils/FUDaeEnum.h"
00022
00023 class FCDocument;
00024 class FCDSceneNode;
00025
00053 class FCOLLADA_EXPORT FCDLight : public FCDTargetedEntity
00054 {
00055 public:
00057 enum LightType
00058 {
00059 POINT,
00060 SPOT,
00061 AMBIENT,
00062 DIRECTIONAL
00063 };
00064
00065 private:
00066 DeclareObjectType;
00067
00068
00069 FMVector3 color;
00070 float intensity;
00071 LightType lightType;
00072
00073
00074 float constantAttenuationFactor;
00075 float linearAttenuationFactor;
00076 float quadracticAttenuationFactor;
00077
00078
00079 float fallOffExponent;
00080 float fallOffAngle;
00081 float outerAngle;
00082 float penumbraAngle;
00083 float aspectRatio;
00084 float dropoff;
00085
00086
00087
00088
00089 bool overshoots;
00090
00091 public:
00094 FCDLight(FCDocument* document);
00095
00098 virtual ~FCDLight();
00099
00102 virtual Type GetType() const { return LIGHT; }
00103
00107 FMVector3& GetColor() { return color; }
00108 const FMVector3& GetColor() const { return color; }
00113 void SetColor(const FMVector3& col) { color = col; }
00114
00118 float& GetIntensity() { return intensity; }
00119 const float& GetIntensity() const { return intensity; }
00124 void SetIntensity(float _intensity) { intensity = _intensity; }
00125
00130 LightType GetLightType() const { return lightType; }
00131
00134 void SetLightType(LightType type) { lightType = type; }
00135
00139 float& GetConstantAttenuationFactor() { return constantAttenuationFactor; }
00140 const float& GetConstantAttenuationFactor() const { return constantAttenuationFactor; }
00145 void SetConstantAttenuationFactor(float factor) { constantAttenuationFactor = factor; }
00146
00150 float& GetLinearAttenuationFactor() { return linearAttenuationFactor; }
00151 const float& GetLinearAttenuationFactor() const { return linearAttenuationFactor; }
00156 void SetLinearAttenuationFactor(float factor) { linearAttenuationFactor = factor; }
00157
00161 float& GetQuadraticAttenuationFactor() { return quadracticAttenuationFactor; }
00162 const float& GetQuadraticAttenuationFactor() const { return quadracticAttenuationFactor; }
00167 void SetQuadraticAttenuationFactor(float factor) { quadracticAttenuationFactor = factor; }
00168
00179 float& GetFallOffExponent() { return fallOffExponent; }
00180 const float& GetFallOffExponent() const { return fallOffExponent; }
00185 void SetFallOffExponent(float exponent) { fallOffExponent = exponent; }
00186
00191 float& GetFallOffAngle() { return fallOffAngle; }
00192 const float& GetFallOffAngle() const { return fallOffAngle; }
00197 void SetFallOffAngle(float angle) { fallOffAngle = angle; }
00198
00207 float& GetOuterAngle() { return outerAngle; }
00208 const float& GetOuterAngle() const { return outerAngle; }
00213 void SetOuterAngle(float angle) { outerAngle = angle; }
00214
00225 float& GetPenumbraAngle() { return penumbraAngle; }
00226 const float& GetPenumbraAngle() const { return penumbraAngle; }
00231 void SetPenumbraAngle(float angle) { penumbraAngle = angle; }
00232
00242 float& GetAspectRatio() { return aspectRatio; }
00243 const float& GetAspectRatio() const { return aspectRatio; }
00248 void SetAspectRatio(float ratio) { aspectRatio = ratio; }
00249
00253 float& GetDropoff() { return dropoff; }
00254 const float& GetDropoff() const { return dropoff; }
00259 void SetDropoff(float factor) { dropoff = factor; }
00260
00268 bool DoesOvershoot() const { return overshoots; }
00269
00273 void SetOvershoot(bool _overshoots) { overshoots = _overshoots; }
00274
00279 FUStatus LoadFromXML(xmlNode* lightNode);
00280
00284 virtual xmlNode* WriteToXML(xmlNode* parentNode) const;
00285 };
00286
00287 #endif // _FCD_LIGHT_H_
00288