|
@@ -116,6 +116,12 @@ void Game::tick() {
|
|
|
if(control.keys.test5.getDownTime() == 1) {
|
|
|
renderSettings.ssao = !renderSettings.ssao;
|
|
|
}
|
|
|
+ if(control.keys.test6.getDownTime() == 1) {
|
|
|
+ renderSettings.bump += 0.05f;
|
|
|
+ if(renderSettings.bump > 1.0f) {
|
|
|
+ renderSettings.bump = 0.0f;
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void Game::renderWorld(float lag, Renderer& renderer) const {
|
|
@@ -174,9 +180,9 @@ Vector3 Game::splineTangent(const Vector3& prev, const Vector3& current, const V
|
|
|
Vector3 Game::interpolate(const Vector3& a, const Vector3& b, const Vector3& tanA, const Vector3& tanB, float t) const {
|
|
|
float t2 = t * t;
|
|
|
float t3 = t2 * t;
|
|
|
- return a * (2.0f * t3 - 3.0f * t2 + 1.0f) +
|
|
|
- b * (-2.0f * t3 + 3.0f * t2) +
|
|
|
- tanA * (t3 - 2.0f * t2 + t) +
|
|
|
+ return a * (2.0f * t3 - 3.0f * t2 + 1.0f) +
|
|
|
+ b * (-2.0f * t3 + 3.0f * t2) +
|
|
|
+ tanA * (t3 - 2.0f * t2 + t) +
|
|
|
tanB * (t3 - t2);
|
|
|
}
|
|
|
|
|
@@ -195,7 +201,7 @@ float Game::distance(uint index, uint splits) const {
|
|
|
currentPos = currentNext;
|
|
|
float t = (i + 1.0f) / (splits + 1.0f);
|
|
|
currentNext = interpolate(a, b, tanA, tanB, t);
|
|
|
- float l = static_cast<Vector3>(currentPos - currentNext).length();
|
|
|
+ float l = static_cast<Vector3> (currentPos - currentNext).length();
|
|
|
sum += l;
|
|
|
}
|
|
|
return sum;
|
|
@@ -217,7 +223,7 @@ Vector3 Game::pointUntilDistance(float leftDistance, uint index, uint splits) co
|
|
|
currentPos = currentNext;
|
|
|
float t = (i + 1.0f) / (splits + 1.0f);
|
|
|
currentNext = interpolate(a, b, tanA, tanB, t);
|
|
|
- float l = static_cast<Vector3>(currentPos - currentNext).length();
|
|
|
+ float l = static_cast<Vector3> (currentPos - currentNext).length();
|
|
|
sum += l;
|
|
|
i++;
|
|
|
}
|