Skip to content

Commit

Permalink
track: fix only raising tracks on low chaos values
Browse files Browse the repository at this point in the history
Fixes NPT-100
  • Loading branch information
Ryp committed Dec 13, 2023
1 parent ec216e1 commit 26d3835
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/neptune/trackgen/Track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,17 +57,17 @@ namespace
{
glm::fmat4x3 GenerateChunkEndLocalSpace(const GenerationInfo& gen_info, RNG& rng)
{
const glm::vec2 thetaBounds = glm::vec2(0.0f, ThetaMax) * gen_info.chaos;
const glm::vec2 phiBounds = glm::vec2(-PhiMax, PhiMax) * gen_info.chaos;
const glm::vec2 rollBounds = glm::vec2(-RollMax, RollMax) * gen_info.chaos;
glm::vec2 thetaBounds = glm::vec2(0.0f, ThetaMax) * gen_info.chaos;
glm::vec2 phiBounds = glm::vec2(-PhiMax, PhiMax);
glm::vec2 rollBounds = glm::vec2(-RollMax, RollMax) * gen_info.chaos;

std::uniform_real_distribution<float> thetaDistribution(thetaBounds.x, thetaBounds.y);
std::uniform_real_distribution<float> phiDistribution(phiBounds.x, phiBounds.y);
std::uniform_real_distribution<float> rollDistribution(rollBounds.x, rollBounds.y);

const float theta = thetaDistribution(rng);
const float phi = phiDistribution(rng);
const float roll = rollDistribution(rng);
float theta = thetaDistribution(rng);
float phi = phiDistribution(rng);
float roll = rollDistribution(rng);

glm::quat deviation = glm::angleAxis(phi, UnitXAxis) * glm::angleAxis(theta, UnitZAxis);
glm::quat rollFixup = glm::angleAxis(-phi + roll, deviation * UnitXAxis);
Expand Down

0 comments on commit 26d3835

Please sign in to comment.