To CollisionSegment or to CollisionSolid?

I just wanted to ask for your opinions on this.

Do you think CollisionSegments or CollisionSolids would be better to use for checking collisions between the character and the walls?

Because at this point in time, I’m at a conundrum, where I just can’t make my collision system with the walls work right…

No matter which one I use, all I have to do is just turn left and right while moving into the wall constantly, and I can get through.

If I use CollisionSpheres, it gets through alot easier.

However, If I use CollisionSegments, it gets a tad bit jerky when I hit the walls (I have 5 rays sticking out of each side at a different angle…)

So, which do you think I should use?

Thanks!

Well, it sounds like something else is wrong–if you’re using a CollisionHandlerPusher, and a CollisionSphere, it shouldn’t let you through a wall just for turning back and forth against it. Are you sure you’re using the collision system properly?

David

if you use a small collisionsphere and large movements speeds it’s likely that you can get trough the walls. that’s because of the maths involved in the calculation. (the sphere’s radius / (frames per second) must be larger then the movement per frame).

on the other hand, you may have another problem.

that problem can be solved by np.setFluid*()

Ah… Eheheh, I’m actually using a CollisionHandlerEvent, not a CollisionHandlerPusher…

Can someone give me a quick crash course to converting a CollisionHandlerEvent to a CollisionHandlerPusher? 'cuz I gave a try to changing it, and it ain’t working…

This code is for the World

        traverser = CollisionTraverser()
        base.cTrav = traverser
        ## self.collHandEvent = CollisionHandlerEvent()
        self.collHandEvent = CollisionHandlerPusher()
        self.collHandEvent.addInPattern('into-%in')
        self.collHandEvent.addOutPattern('outof-%in')
        
        self.collHandEvent.addCollider(self.character.cnodePath,self.crate.cnodePath)
        self.collHandEvent.addCollider(self.character.cnodePath2,self.crate.cnodePath)
        traverser.addCollider(self.character.cnodePath,self.collHandEvent)
        traverser.addCollider(self.character.cnodePath,self.collHandEvent)
        traverser.addCollider(self.character.cnodePath2,self.collHandEvent)

Umm… Is there anything else I have to add to a working CollHandEvent code in my classes which are affected?

The CollisionHandlerPusher wants to change the position of your node when it detects a collision. You will have to write the rest of your code so that it can handle your node being moved by the collision detection.

This doesn’t mean anything fancy. It just means that you can’t make assumptions that the node will always be in the same place you left it. Chances are good you have already written your code this way. (On the other hand, since you have implemented collisions using just an CollisionHandlerEvent, you probably have a lot of code that is dealing with collisions explicitly. You may need to remove this code.)

Other than that, you seem to have the right idea, I guess. But I’m a little confused by your character.cnodePath and cnodePath2. Are they two different solids that are both supposed to be representing the same object? Perhaps you should add both solids to the same CollisionNode, rather than having them under two different CollisionNodes. The pusher really wants to work on the model of one CollisionNode to push on one object.

David

Ummm… Sorry, but I’m not very sure about how to do it, the changing the code so that it can handle the node being moved by the collision detection bit…

Can you give me an example? Eheheh…

Ah, and about the character.cnodePath and cnodePath2, thats because I need to detect the front and the back, as the method I use now is that:

If cnodePath collides with the wall, hitFront = True
if cnodePath2 collides with wall, hitBack = True

And whenever I move, I do a check if hitFront or hitBack is true, if its not, I won’t be able to move front or back respectively.

Try this :
discourse.panda3d.org/viewtopic.php?t=2924

Thanks for the help, but… I’m sorry, I’m not very sure how the CollisionHandlerPusher works…

Can someone give me a crash course as to how the CollisionHandlerPusher works? In comparison to the CollisionHandler.

Or is there any tutorials about how to make a working CollisionHandlerPusher system?

I’m really sorry for all the inconvenience once again.