Question about character controller

Started by
8 comments, last by wildbunny 13 years ago
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?
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.
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?

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.
Umm you got any good reference to read? I think Im a little bit confused =.=a

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 :)
Ok. I think I'll have to figure it out later, I'm coding the primitive vs static mesh at the moment...will be back later...
Post the exact codes.
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...

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.

This topic is closed to new replies.

Advertisement