Just curious if there is another way to get the pushers to work selectively outside of assigning different collision masks or a different pusher/ray combo.
In my case, I have objects that need to not only stay out of walls, but also walk along them in some cases. The pusher does a good job of keeping my object out of walls, but they slide along these walls when they become temporary floors.
I would like to selectively turn on and off this behavior, depending on what kind of wall object it collides with. Ideas welcome!
Update: How I have things arranged:
- Wall sphere + CollisionPusher = Keeps object out of walls on glancing collisions.
- Wall ray + CollisionQueue = Used to push the object up out of the wall in case it is over it.
Hmmm… I wish I had my source from SteamRoller on hand. I know for that game I spun a setup that would let you drive all the way around the inside of a pipe without much glitching… Either I rolled my own collision physics manually based on the collision normals or I used the pusher setup and added an extra velocity-dampening check to come to a stop on slopes shallow enough that I didn’t want to slide.
Either way, the player was a sphere and it was going into low-res polygon mesh, iirc with a collision callback.
Yeah, I was thinking a bit more last night and I think roll-my-own might be my only choice. I’m already using that event queue that detects walls as it is, in order to discover when I am “over” a wall, so I might as well modify that code so that when it detects a glancing touch along the horizontal, it pushes back. I can combine the sphere and ray, too.
I don’t want to involve the Panda3d physics system, as I need these objects to be fairly lightweight. Otherwise I am sure I could tweak with surface coefficients, damping and so on. (Assuming that’s supported! Haven’t looked too deeply into Panda3d physics aside from the basics yet.)
I also don’t want to split up my geometry, defining explicit Floor and Wall surfaces. And I don’t want to assign yet another collision solid to my object, for as I said, I am trying to keep passes through the collision system to a minimum.
There’s not a whole lot of real physics going on with these things; They’re setting their height directly based on the terrain/wall object that they encounter underneath, with a little bit of damping to simulate gravity in case they need to fall.
I think you can run one object collision region into more than one environment collision region, as long as you differentiate the collision events by name or other analysis. If you’re strictly doing walls/floors, it might be safe to have a floor handler that only acts on Z and a wall handler that only acts on X/Y, and have surfaces for both on anything sloped…