MCPcopy Create free account
hub / github.com/carbonengine/trinity / GetLight

Method GetLight

trinity/Lights/Tr2Light.cpp:152–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150
151
152void Tr2Light::GetLight( Vector3& position, float& radius, Color& color )
153{
154 position = m_lightData.position;
155 radius = m_lightData.radius;
156 float brightness = m_lightData.brightness;
157 if( m_lightData.noiseAmplitude != 0.f )
158 {
159 float noise = float( PerlinNoise1D( TimeAsDouble( BeOS->GetCurrentFrameTime() ) * m_lightData.noiseFrequency, 2.f, 2.f, m_lightData.noiseOctaves ) );
160 brightness *= ( ( noise + 1.0f ) / 2.0f ) * m_lightData.noiseAmplitude;
161 }
162 color = m_lightData.color * brightness;
163}
164
165bool Tr2Light::Initialize()
166{

Callers 2

UpdateSourceDataMethod · 0.80
PopulatePerObjectDataMethod · 0.80

Calls 1

PerlinNoise1DFunction · 0.85

Tested by

no test coverage detected