Exemplo n.º 1
0
// constructor stores the properties of the light, creates the APILight
// object and initializes the reference time
//
Light::Light(LightType t, Colour d, Colour a, Colour s, float r, bool o, 
  float a0, float a1, float a2, float ph, float th, float f) : on(false), 
  turnOn(o), turnOff(false), type(t) {

    coordinator->add(this);

    apiLight = CreateAPILight(t, d, a, s, r, o, a0, a1, a2, ph, th, f);

    // reference time
    lastToggle  = 0;
}
Exemplo n.º 2
0
// constructor stores the properties of the light, creates the APILight
// object and initializes the reference time
//
Light::Light(LightType t, Colour d, Colour a, Colour s, float r, bool o, 
 float a0, float a1, float a2) : type(t), on(false), diffuse_(d), ambient_(a),
 specular_(s), range_(r), attenuation0(a0), attenuation1(a1), attenuation2(a2),
 turnOn(o), turnOff(false) {

    if (!coordinator)
        error(L"Light::00 Couldn\'t access the Coordinator");
    else if(!coordinator->add(this))
        error(L"Light::01 Couldn\'t add the light to Coordinator");

    apiLight = CreateAPILight();

	// reference time
	lastToggle  = 0;
}