[ode-users] What is happening here? (video)

5 views
Skip to first unread message

Creynboro

unread,
Nov 19, 2009, 2:47:58 PM11/19/09
to ode-...@googlegroups.com

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.

Bruce Veazie

unread,
Nov 20, 2009, 6:01:24 PM11/20/09
to ode-...@googlegroups.com
Depends on when you render the scene. Do you render it before or after you
reset the capsule position?

If you set the capsule, then do the physics, then render - you're probably
seeing the result of the world calcs (gravity?).

For my capsule "player," I reset capsule parameters in a movedBodyCallback.
> --
>
> You received this message because you are subscribed to the Google Groups
> "ode-users" group.
> To post to this group, send email to ode-...@googlegroups.com.
> To unsubscribe from this group, send email to
> ode-users+...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/ode-users?hl=.
>
>
>


Creynboro

unread,
Nov 20, 2009, 7:21:21 PM11/20/09
to ode-...@googlegroups.com

bingo! that was it. Thanks
View this message in context: http://old.nabble.com/What-is-happening-here--%28video%29-tp26421457p26452385.html
Reply all
Reply to author
Forward
0 new messages