BH
In the three.js example for a first person game https://threejs.org/examples/?q=game#games_fps you should notice that at the corners it gets stuck, seemingly because it collides with one side, then pushes it into the other side (when there's less than a 90 degree angle) then that side pushes it back into the first side, and if one keeps trying to move this process keeps getting repeated.
The relevant part of the collision is https://github.com/mrdoob/three.js/blob/dev/examples/games_fps.html (can't figure out how to add text after code here, but basically First just checks if it's on the ground (and if not then makes it fall down along the wall it's colliding it, or at least that's what I think it does) then slides it the opposite direction of whatever it collides with, which seemingly is what's causing the jitter since it's just pushing it into the other wall when it's at an acute angle.
I tried tweaking with it but have no idea what to do or how to start, any ideas?)
function playerCollisions() {
const result = worldOctree.capsuleIntersect( playerCollider );
playerOnFloor = false;
if ( result ) {
playerOnFloor = result.normal.y > 0;
if ( ! playerOnFloor ) {
playerVelocity.addScaledVector( result.normal, - result.normal.dot( playerVelocity ) );
}
playerCollider.translate( result.normal.multiplyScalar( result.depth ) );
}
}