mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:24:07 +02:00
Merge pull request #7357 from hyperlogic/tony/fix-for-set-swing-limits
SwingTwistConstriant: fix for bad index.
This commit is contained in:
commit
98eef26e69
1 changed files with 1 additions and 1 deletions
|
@ -249,7 +249,7 @@ void SwingTwistConstraint::setSwingLimits(const std::vector<glm::vec3>& swungDir
|
|||
int rightIndex = 0;
|
||||
for (int i = 0; i < numLimits; ++i) {
|
||||
float theta = (float)i * deltaTheta;
|
||||
int leftIndex = (rightIndex - 1) % numLimits;
|
||||
int leftIndex = (rightIndex - 1 + numLimits) % numLimits;
|
||||
while (rightIndex < numLimits && theta > limits[rightIndex]._theta) {
|
||||
leftIndex = rightIndex++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue