summaryrefslogtreecommitdiff
path: root/common/light.h
diff options
context:
space:
mode:
authorleo2000-11-12 20:03:48 +0000
committerleo2000-11-12 20:03:48 +0000
commit94ae70d4d252cde37bdc605a328e1fed811f2d96 (patch)
tree963b125283f8a256fcb737c9b66c13f6e855cd63 /common/light.h
parent677a64d9d764ed6e37c3f7b1b9ec29239de37a6b (diff)
Moved all keyframer functions to the Object class
git-svn-id: http://svn.leocad.org/trunk@160 c7d43263-9d01-0410-8a33-9dba5d9f93d6
Diffstat (limited to 'common/light.h')
-rw-r--r--common/light.h35
1 files changed, 17 insertions, 18 deletions
diff --git a/common/light.h b/common/light.h
index f40118d..f0619c9 100644
--- a/common/light.h
+++ b/common/light.h
@@ -14,15 +14,14 @@
class Light;
class LightTarget;
-typedef enum { LK_POSITION, LK_TARGET, LK_COLOR } LK_TYPES;
-
-typedef struct LC_LIGHT_KEY
+typedef enum
{
- unsigned short time;
- float param[3];
- unsigned char type;
- LC_LIGHT_KEY* next;
-} LC_LIGHT_KEY;
+ LC_LK_POSITION, LC_LK_TARGET, // position
+ LC_LK_AMBIENT, LC_LK_DIFFUSE, LC_LK_SPECULAR, // color
+ LC_LK_CONSTANT, LC_LK_LINEAR, LC_LK_QUADRATIC, // attenuation
+ LC_LK_CUTOFF, LC_LK_EXPONENT, // spot
+ LC_LK_COUNT
+} LC_LK_TYPES;
class LightTarget : public Object
{
@@ -83,22 +82,15 @@ class Light : public Object
void Render (float fLineWidth);
void MinIntersectDist (LC_CLICKLINE* Line);
void UpdatePosition (unsigned short nTime, bool bAnimation);
- void CalculatePosition (unsigned short nTime, bool bAnimation, float pos[3], float target[3], float color[3]);
void Move (unsigned short nTime, bool bAnimation, bool bAddKey, float dx, float dy, float dz);
- void ChangeKey (unsigned short nTime, bool bAnimation, bool bAddKey, float param[3], unsigned char nKeyType);
void Setup (int index);
protected:
- void RemoveKeys ();
void Initialize ();
// Camera target
LightTarget* m_pTarget;
- // Position
- LC_LIGHT_KEY* m_pAnimationKeys;
- LC_LIGHT_KEY* m_pInstructionKeys;
-
// Attributes
float m_fCone;
unsigned char m_nState;
@@ -109,10 +101,17 @@ protected:
static GLuint m_nSphereList;
static GLuint m_nTargetList;
- // Temporary position
+ // Temporary parameters
float m_fPos[4];
- float m_fTarget[4];
- float m_fColor[4];
+ float m_fTarget[3];
+ float m_fAmbient[4];
+ float m_fDiffuse[4];
+ float m_fSpecular[4];
+ float m_fConstant;
+ float m_fLinear;
+ float m_fQuadratic;
+ float m_fCutoff;
+ float m_fExponent;
};
#endif // _LIGHT_H_