Browse Source

Add Light::setBrightnessSmooth()

tags/v0.5.0
Andrew Belt 7 years ago
parent
commit
a58ab53707
2 changed files with 4 additions and 3 deletions
  1. +2
    -1
      include/engine.hpp
  2. +2
    -2
      src/engine.cpp

+ 2
- 1
include/engine.hpp View File

@@ -30,8 +30,9 @@ struct Output {
};

struct Light {
/** The square of the brightness value */
float value = 0.0;
void setSmooth(float v);
void setBrightnessSmooth(float brightness);
};




+ 2
- 2
src/engine.cpp View File

@@ -33,8 +33,8 @@ static int smoothParamId;
static float smoothValue;


void Light::setSmooth(float v) {
value += (v - value) / sampleRate * 60.0;
void Light::setBrightnessSmooth(float brightness) {
value += (powf(brightness, 2) - value) / sampleRate * 60.0;
}




Loading…
Cancel
Save