• Advertisement
Sign in to follow this  

Question about character controller

This topic is 2504 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement

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?


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

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?


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

Umm you got any good reference to read? I think Im a little bit confused =.=a


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
Well here's what I do

void ChangeVel(vec3 targetvel)
{
m_vVel+=(targetvel-m_vVel)*m_fRate;
}
//where does the strength value come into play??

I think I got it I'll test it later...

Share this post


Link to post
Share on other sites

Well here's what I do

void ChangeVel(vec3 targetvel)
{
m_vVel+=(targetvel-m_vVel)*m_fRate;
}
//where does the strength value come into play??

I think I got it I'll test it later...


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
Sign in to follow this  

  • Advertisement