I have a capsule that is set with:
setSleepingThresholds(0.0, 0.0);
setAngularFactor(0.0);
And control the player with setLinearVelocity... everything is fine except that when the player is on a slope it keeps going down even if I force the linear velocity to be 0.
What is do is if the user move I set:
m_btRigidBody->setActivationState( ACTIVE_TAG );
m_btRigidBody->activate(true);
and if the player stop pushing the control button I set
m_btRigidBody->setActivationState( WANTS_DEACTIVATION );
m_btRigidBody->activate(false);
How can I make the capsule stop sliding when it is in a slope?
Is there a way to manually set the friction of the contact point, destroy it or?
Cuz if I put a higher friction, yes the character will stick on the slope but when I jump and go forward on a wall it will stick on the wall as well... is there any way to avoid that without using something similar as the characterdemo that comes with the SDK cuz it seems to be too much work to have to implement yourself even the gravity etc...
Character Sliding Problem
-
pico
- Posts: 229
- Joined: Sun Sep 30, 2007 7:58 am
Re: Character Sliding Problem
Hi, some years back i also tested to use a normal rigid body for character movement. In the end it was just a waste of time because so many things you need for proper character control do not work. Some things you will most likely need and you wont get with a rigid body:
- Stepping
- Rest on slopes without friction changes
- Limit upward movement to a certain slope degree
- Tunneling avoidance
- Proper elevators
- Smooth movement (with a rigid body you will hang on certain edges)
I suggest you start with the bullet character controller. Its a good starting point. From there you need to tweak and adjust it to your game needs.
- Stepping
- Rest on slopes without friction changes
- Limit upward movement to a certain slope degree
- Tunneling avoidance
- Proper elevators
- Smooth movement (with a rigid body you will hang on certain edges)
I suggest you start with the bullet character controller. Its a good starting point. From there you need to tweak and adjust it to your game needs.