mirror of
https://github.com/RandomityGuy/MBHaxe.git
synced 2026-04-27 05:01:38 +00:00
reduce bounces when high speed, still not a perfect fix
This commit is contained in:
parent
91eba138bc
commit
3207a088f8
1 changed files with 29 additions and 29 deletions
|
|
@ -700,7 +700,7 @@ class Marble extends GameObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} while (!done);
|
} while (!done);
|
||||||
if (this.velocity.lengthSq() < 625) {
|
// if (this.velocity.lengthSq() < 625) {
|
||||||
var gotOne = false;
|
var gotOne = false;
|
||||||
var dir = new Vector(0, 0, 0);
|
var dir = new Vector(0, 0, 0);
|
||||||
for (j in 0...contacts.length) {
|
for (j in 0...contacts.length) {
|
||||||
|
|
@ -724,13 +724,13 @@ class Marble extends GameObject {
|
||||||
soFar += (dist - outVel * timeToSeparate) / timeToSeparate / contacts[k].normal.dot(dir);
|
soFar += (dist - outVel * timeToSeparate) / timeToSeparate / contacts[k].normal.dot(dir);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (soFar < -25)
|
// if (soFar < -25)
|
||||||
soFar = -25;
|
// soFar = -25;
|
||||||
if (soFar > 25)
|
// if (soFar > 25)
|
||||||
soFar = 25;
|
// soFar = 25;
|
||||||
this.velocity = this.velocity.add(dir.multiply(soFar));
|
this.velocity = this.velocity.add(dir.multiply(soFar));
|
||||||
}
|
}
|
||||||
}
|
// }
|
||||||
|
|
||||||
return stoppedPaths;
|
return stoppedPaths;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue