Collision response animator sliding

You are an experienced programmer and have a problem with the engine, shaders, or advanced effects? Here you'll get answers.
No questions about C++ programming or topics which are answered in the tutorials!
Post Reply
Saumane
Posts: 27
Joined: Wed Jul 09, 2008 6:14 pm
Location: Finland

Collision response animator sliding

Post by Saumane »

I'm using the collision response animator, and i have a small problem with it. When player stops moving while on a slope ( "/" ), the player will just slide down. Is it possible to make the animator more "sticky"? Or do i have to edit the engine for that?
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

As far as I can see it the engine does not seem to differentiate between slopes for floor and any other slopes. In my own collision code I do usually check the normal of the collision triangle for that and modify the sliding accordingly. Maybe that is also somehow possible with newer Irrlicht. Current svn allows setting a callback for collision in ISceneNodeAnimatorCollisionResponse which can be used to receive the collision triangle. But I'm not sure about the best way to react here. Maybe check that normal and when it's upright enough to count as floor, then manually prevent the sliding if you know that your user has not set any input. Something like that.

It's definitely a common situation for which some engine support would probably be useful. So maybe add it to the Feature Requests tracker.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Katsankat
Posts: 178
Joined: Sun Mar 12, 2006 4:15 am
Contact:

Post by Katsankat »

When invoking createCollisionResponseAnimator() the last parameter is the sliding value. Ok in the doc it says nothing, but it works! Put a higher value.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Post by CuteAlien »

Hehe, we recently discussed about that value and wondered what it does :-) I suppose that means that this value lowers/increases all sliding? It might still be interesting to have different values here for walls/floors (and another value to differentiate walls/floors).
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
Post Reply