Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 272 vs 285 for /trunk/Source Code/Rendering/Lighting/Headers/Light.h

Diff revisions: vs.
  @@ -41,16 +41,12 @@
41 41 //LIGHT_MODE_DOMINANT = 3 ///< only shadow caster in scene
42 42 };
43 43
44 - struct LightVisualProperties {
44 + struct LightProperties {
45 45 vec4<F32> _diffuse; //< rgb = diffuse, w = ambientFactor;
46 - vec3<F32> _specular; //< rgb = specular color
47 - };
48 -
49 - struct LightPhysicalProperties {
46 + vec4<F32> _specular; //< rgb = specular color, w = _spotCutoff;
50 47 vec4<F32> _attenuation; //< x = constAtt, y = linearAtt, z = quadraticAtt, w = brightness
51 48 vec4<F32> _position; //< Position is a direction for directional lights. w-light type: 0.0 - directional, 1.0 - point, 2.0 - spot
52 49 vec4<F32> _direction; //< xyz = Used by spot lights, w = spotExponent
53 - F32 _spotCutoff;
54 50 };
55 51
56 52 struct LightShadowProperties {
  @@ -91,22 +87,22 @@
91 87 ///Is the light a shadow caster?
92 88 inline bool castsShadows() const {return _castsShadows;}
93 89 ///Get the entire property block
94 - inline const LightPhysicalProperties& getPhysicalProperties() const { return _physicalProperties; }
95 - inline const LightVisualProperties& getVisualProperties() const { return _visualProperties; }
90 + inline const LightProperties& getProperties() const { return _properties; }
96 91 inline const LightShadowProperties& getShadowProperties() const {return _shadowProperties;}
97 - inline F32 getRange() const {return _physicalProperties._attenuation.w;}
92 +
93 + inline F32 getRange() const {return _properties._attenuation.w;}
98 94 void setRange(F32 range);
99 95 ///Get light diffuse color
100 - inline vec3<F32> getDiffuseColor() const { return _visualProperties._diffuse.rgb(); }
96 + inline vec3<F32> getDiffuseColor() const { return _properties._diffuse.rgb(); }
101 97 void setDiffuseColor(const vec3<F32>& newDiffuseColor);
102 98 ///Get light specular color
103 - inline vec3<F32> getSpecularColor() const { return _visualProperties._specular; }
99 + inline vec3<F32> getSpecularColor() const { return _properties._specular.rgb(); }
104 100 void setSpecularColor(const vec3<F32>& newSpecularColor);
105 101 ///Get light position for omni and spot or direction for a directional light
106 - inline vec3<F32> getPosition() const { return _physicalProperties._position.xyz(); }
102 + inline vec3<F32> getPosition() const { return _properties._position.xyz(); }
107 103 void setPosition(const vec3<F32>& newPosition);
108 104 ///Get direction for spot lights
109 - inline vec3<F32> getDirection() const { return _physicalProperties._direction.xyz(); }
105 + inline vec3<F32> getDirection() const { return _properties._direction.xyz(); }
110 106 void setDirection(const vec3<F32>& newDirection);
111 107 ///Light state (on/off)
112 108 inline bool getEnabled() const {return _enabled;}
  @@ -176,9 +172,7 @@
176 172 inline void setSlot(const U8 slot) { _slot = slot;}
177 173
178 174 protected:
179 -
180 - LightPhysicalProperties _physicalProperties;
181 - LightVisualProperties _visualProperties;
175 + LightProperties _properties;
182 176 LightShadowProperties _shadowProperties;
183 177
184 178 LightType _type;