Sign in to follow this  
Bow_vernon

Question about character controller

Recommended Posts

Im implementing a character controller for my physics engine. It worked well on a flat platform. Now I wonder how to avoid the sliding on a slope when the character is standing still? I tried to modify the friction value when itsnot moving, but it takes a while before it comes to a full stop. Help?

Share this post


Link to post
Share on other sites
[quote name='Bow_vernon' timestamp='1302542627' post='4797193']
Im implementing a character controller for my physics engine. It worked well on a flat platform. Now I wonder how to avoid the sliding on a slope when the character is standing still? I tried to modify the friction value when itsnot moving, but it takes a while before it comes to a full stop. Help?
[/quote]

If you use the character constraint I described in your other thread, this just happens automatically :)

Cheers, Paul.

Share this post


Link to post
Share on other sites
Ok, but I think that'll make my character 'sticky'. What if another object bumps into it? it should get some impact, right?
TBH I dont fully understand the inner working of your character controller(hehe). It modifies speed to match desired target velocity right?

Share this post


Link to post
Share on other sites
[quote name='Bow_vernon' timestamp='1302567750' post='4797320']
Ok, but I think that'll make my character 'sticky'. What if another object bumps into it? it should get some impact, right?
TBH I dont fully understand the inner working of your character controller(hehe). It modifies speed to match desired target velocity right?
[/quote]

Thats what the strength parameter is for - you don't want it to be infinitely strong. :)

Cheers, Paul.

Share this post


Link to post
Share on other sites
[quote name='Bow_vernon' timestamp='1302628744' post='4797568']
Umm you got any good reference to read? I think Im a little bit confused =.=a
[/quote]

Sorry, no reference I know of - you'd have to design the constraint from the ground up, but its not that hard to do :)

Share this post


Link to post
Share on other sites
[quote name='Bow_vernon' timestamp='1302699570' post='4797928']
Well here's what I do
[code]
void ChangeVel(vec3 targetvel)
{
m_vVel+=(targetvel-m_vVel)*m_fRate;
}
//where does the strength value come into play??
[/code]
I think I got it I'll test it later...
[/quote]

No, I'm afraid that's not going to do it :)

Firstly, you can't just arbitrarily start modifying velocity like that - you need to compute an impulse which involves two bodies; the character and the thing he's standing on. Remember Newton - equal and opposite reaction :)

Cheers, Paul.

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