Light::Light() { /* setType(D3DLIGHT_POINT); setDiffuse(r, g, b, a); setAmbient(0, 0, 0, 0); setRange((float)sqrt(FLT_MAX)); setSpecular(r, g, b, a); setAttenuation(1, 0, 0); */ SetType(LIGHT_POINT); SetDiffuse(1, 1, 1, 1); SetSpecular(1, 1, 1, 1); SetAmbient(0, 0, 0, 0); SetRange((float)sqrt(FLT_MAX)); SetAttenuation(1, 0, 0); SetThetaPhi(1.f, 2.f); SetFalloff(1.f); SetLocation(0, 0, 0); SetDirection(0, 1, 0); }
Sound& Sound::operator =(const Sound& right) { // Here we don't use the copy-and-swap idiom, because it would mess up // the list of sound instances contained in the buffers // Detach the sound instance from the previous buffer (if any) if (myBuffer) { Stop(); myBuffer->DetachSound(this); myBuffer = NULL; } // Copy the sound attributes if (right.myBuffer) SetBuffer(*right.myBuffer); SetLoop(right.GetLoop()); SetPitch(right.GetPitch()); SetVolume(right.GetVolume()); SetPosition(right.GetPosition()); SetRelativeToListener(right.IsRelativeToListener()); SetMinDistance(right.GetMinDistance()); SetAttenuation(right.GetAttenuation()); return *this; }
SoundEmitter::SoundEmitter(const SoundEmitter& emitter) { alGenSources(1, &m_source); SetAttenuation(emitter.GetAttenuation()); SetMinDistance(emitter.GetMinDistance()); SetPitch(emitter.GetPitch()); // No copy for position or velocity SetVolume(emitter.GetVolume()); }
NzSoundEmitter::NzSoundEmitter(const NzSoundEmitter& emitter) { alGenSources(1, &m_source); SetAttenuation(emitter.GetAttenuation()); SetMinDistance(emitter.GetMinDistance()); SetPitch(emitter.GetPitch()); // Pas de copie de position ou de vitesse SetVolume(emitter.GetVolume()); }
// Create. MapilVoid GLDirectionalLight::Create( const ColorARGB < MapilFloat32 >& colorDiffuse, const ColorARGB < MapilFloat32 >& colorAmbient, const ColorARGB < MapilFloat32 >& colorSpecular, const Vector3 < MapilFloat32 >& vDir, MapilFloat32 attenuation0, MapilFloat32 attenuation1, MapilFloat32 attenuation2 ) { SetDiffuseColor( colorDiffuse ); SetAmbientColor( colorAmbient ); SetSpecularColor( colorSpecular ); SetDirection( vDir ); SetAttenuation( attenuation0, attenuation1, attenuation2 ); }
void DeferredLight::UpdateFromParent() { // TODO : Don't do this unless something changed SetAttenuation(mParentLight->getAttenuationConstant(), mParentLight->getAttenuationLinear(), mParentLight->getAttenuationQuadric()); SetSpecularColour(mParentLight->getSpecularColour()); if (getCastChadows()) { ENABLE_BIT(mPermutation, LightMaterialGenerator::MI_SHADOW_CASTER); } else { DISABLE_BIT(mPermutation, LightMaterialGenerator::MI_SHADOW_CASTER); } }
PointLight::PointLight(vec3 pos, Color c, vec3 dir) : Light("point light", pos, c, dir,false) { SetAttenuation(1.0,0.0,0.0);//sets default attenuation to 1,0,0 }
PointLight::PointLight() : Light("point light", vec3(0,0,0) ,Color(0.0,0.0,0.0), vec3(0,0,0),false) { SetAttenuation(1.0, 0.0, 0.0);//sets default attenuation to 1,0,0 }
PointLight::PointLight(vec3 pos, Color c, vec3 dir, double kc, double kl, double kq) : Light("Point light", pos, c, dir, false) { SetAttenuation(kc,kl,kq); }
VART::PointLight::PointLight(Point4D loc, float constantAtt, float linearAtt, float quadraticAtt){ SetLocation(loc); SetAttenuation(constantAtt, linearAtt, quadraticAtt); }
PointLight::PointLight(glm::dvec3 pos, Color c, glm::dvec3 dir) : Light(pos, c, dir) { SetAttenuation(1.0,0.0,0.0);//sets default attenuation to 1,0,0 m_lightType = Light::POINT_LIGHT; }
//////////////////////////////////////////////////////////// /// Set the attenuation factor - the higher the attenuation, the /// more the sound will be attenuated with distance from listener. /// The default attenuation factor 1.0 //////////////////////////////////////////////////////////// void sfMusic_SetAttenuation(sfMusic* Music, float Attenuation) { CSFML_CALL(Music, SetAttenuation(Attenuation)); }