I'm trying to setup a character controller for my player (in an fps)
I'm going to use a sort of capsule/ray hybrid.
The ray intersects with the landscape and sets the position of the capsule
above the terrain at that point. I'm hoping this makes moving easier,
because I can then add velocity and not worry about all the issues with the
capsule colliding with the terrain, and it should make walk up stairs
smoother.
Anyway, here is the video of the problem:
http://www.youtube.com/watch?v=mYp9RQbuirM youtube
And my code looks like this:
(every frame)
define ray as originating from capsuleBody, in the Y axis direction
if(collision between ray and terrain)
{
wake capsuleBody
set capsuleBody position at the contact position + (0, capsuleHeight/2, 0)
// to set it above ground
set linear velocity of capsule body to 0 // to get it to stay still
}
Set capsuleBody orientation to previous orientation, but y axis straight up
// to keep character from falling over
set capsuleBody angular velocity to 0 // to keep it still
Update physics and synchronize
What could cause this shaky jittery situation? It looks up close like it's
rendering the correct frame every other frame and in the odd frames,
floating up.
Thanks
--
View this message in context:
http://old.nabble.com/What-is-happening-here--%28video%29-tp26421457p26421457.html
Sent from the ODE mailing list archive at Nabble.com.