Collision response animator sliding
Collision response animator sliding
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?
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.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
When invoking createCollisionResponseAnimator() the last parameter is the sliding value. Ok in the doc it says nothing, but it works! Put a higher value.
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
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm