Character on steep hills

Barratator
Posts: 6
Joined: Thu Jun 09, 2011 3:39 pm

Character on steep hills

Post by Barratator »

Hello,
I implemented a small charactercontroller with a capsule as collisionshape (can only rotate on one axis).
The ground consists of a bvhTriangleMesh.

How can I implement now, that the character can't walk up to steeply hills? When I'm increase the friction of ground and character, the character is upstairs slower, but when it walks zigzag, it's still possible to walk up.

Any idea? :?


Thanks! :)

(Sorry for my bad english.)
User avatar
Dr.Shepherd
Posts: 168
Joined: Tue Jan 04, 2011 11:47 pm

Re: Character on steep hills

Post by Dr.Shepherd »

I would say this is not the question for Bullet, it is the problem of your character controller.

The easiest way is to make this character as a kinematic character, in this way, you directly control the position of the character.

If you want to apply force/torque to the body parts to move the character, that's more complex, there are a lot of research going on in the academic areas.

Any other ideas from others?
GameOn
Posts: 35
Joined: Mon Dec 27, 2010 10:46 pm

Re: Character on steep hills

Post by GameOn »

There's always the simple trick that consist of telling your character controller that it cannot move the player uphill if the normal's angle with the player vertical axis is to high...

...of course the character controller than move the character on the horizontal axis of the hill's plane.
MaxDZ8
Posts: 149
Joined: Fri Jun 24, 2011 8:53 am

Re: Character on steep hills

Post by MaxDZ8 »

Barratator wrote:How can I implement now, that the character can't walk up to steeply hills? When I'm increase the friction of ground and character, the character is upstairs slower, but when it walks zigzag, it's still possible to walk up.

Any idea? :?
My best bet is that you're summing "movement intentions" and your code evaluates steepness over this vector. Diagonal movement has a longer vector so it wrongly detects less slope than it should, or perhaps it allows more vertical displacement as a function of movement vector length.
Just guessing.
Barratator wrote:The ground consists of a bvhTriangleMesh.
What's the deal with triangle soups? No love for the simple shapes?
zarlox
Posts: 31
Joined: Tue Apr 26, 2011 5:52 pm

Re: Character on steep hills

Post by zarlox »

Maybe i am totally off, but maybe you are propulsing your character via impulse/force which vector do not take account of the Y (UP) element?

So moving the character in zigzag would have less slope so the straight force vector (forward,side without up element) would have less resistance (dot product between slope vector and force vector is lower) then directly up the hill (dot product between slope vector and force vector is higher).

If not this then probably what MaxDZ8 suggested.