3#include <glm/gtc/type_ptr.hpp>
11 tdir =
dir = glm::vec3(0, 1, 0);
31 p = glm::vec4(
tdir, 0.0f);
36 p = glm::vec4(
tpos, 1.0f);
40 p = glm::vec4(
tpos, 1.0f);
44 glLightfv(l, GL_POSITION, glm::value_ptr(p));
45 glLightfv(l, GL_DIFFUSE, glm::value_ptr(diffcol));
46 glLightfv(l, GL_AMBIENT, glm::value_ptr(ambcol));
T getValue(ssize_t anim, size_t time)
void init(AnimationBlock &b, GameFile *f, std::vector< uint32 > &gs)
Abstract base class representing a file within the game data archive.
AnimationBlock useAttenuation
AnimationBlock ambientIntensity
AnimationBlock ambientColor
AnimationBlock diffuseIntensity
AnimationBlock diffuseColor
AnimationBlock attenuationStart
AnimationBlock attenuationEnd
Animated< float > diffIntensity
ssize_t parent
Parent bone index (-1 if none).
Animated< float > ambIntensity
Animated< float > AttenStart
void setup(size_t time, GLuint l)
Set up the OpenGL light for rendering.
Animated< int > UseAttenuation
Whether attenuation is enabled.
ssize_t type
Light type: 0 = directional, 1 = point.
void init(GameFile *f, ModelLightDef &mld, std::vector< uint32 > &global)
Initialise from an M2 light definition block.
Animated< glm::vec3 > diffColor
Animated< float > AttenEnd
Intensity and attenuation tracks.
Animated< glm::vec3 > ambColor
Diffuse and ambient colour tracks.
glm::vec3 tdir
Position, transformed position, direction, transformed direction.