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

Started by
1 comment, last by hplus0603 17 years, 9 months ago
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.
Advertisement
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).
HellRaiZer
You posted exactly this same question on the ODE mailing list, and I answered it there.

Check out the ODE FAQ for a description of how you do it.
enum Bool { True, False, FileNotFound };

This topic is closed to new replies.

Advertisement