Sign in to follow this  
kornerr_rpg

FPS Player physics ( ODE): how to construct player, how to move up a staircase, etc?

Recommended Posts

I loaded an Q3 level, made TriMesh geom of it, so now it's like "ground". Now I need to make FPS Player. How to make it? I thought I can create it of two spheres connected with a slider joint so the player is able to sneak. And I want to place camera into the upper one. But then there exists a hole in the "middle" of the player, so it will result in strange collision. So what is the best way do it? And how to move up a staircase? I'm at a loss how to do it. Should I measure the height of a stair and then, if it's not high enough, move up to the next stair? Thanks.

Share this post


Link to post
Share on other sites
Quote:

And how to move up a staircase? I'm at a loss how to do it. Should I measure the height of a stair and then, if it's not high enough, move up to the next stair?

I think the best way to climb a staircase and/or make the player slide off walls is by using swept spheres. From what i remember, ODE doesn't support swept spheres, so you'll have to do it yourself. And of course you have to handle it manually after the simulation loop.

I have tried to do it a while back, with some success (character slide off walls at high speeds without penetrating, climbed stairs etc.) but i abandoned the whole project (i don't remember why :)).

The good thing of using swept sphere (you can do it with boxes/ellipses too) is that the player won't intersect walls, even at high speeds or low frame rates.

Of course other ways of handling things, like the one you mentioned, may do the trick, but it is case specific. So if a simpler way suits your needs, then go for it. I was looking at a more general solution back then, that's why i tried swept spheres.

Here is the paper i used to implement sliding and climbing.
Improved Collision Detection and Response by Kasper Fauerby.

HellRaiZer

EDIT : I haven't played with ODE for some time now, so i don't know if swept spheres are supported in the latest release (either as a contribution, or at the core).

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this