Collision in complex scenes : the great challenge !!!

It’s kind of hard to judge what’s going on in that video. Yes, I can see your player bouncing off things that aren’t there, but it doesn’t tell much about how your level geometry is laid out.

You can turn on a traverser debugger, and see if that might help you figure out where these collisions are coming from.

base.cTrav.showCollisions (base.render)

Another thing you might try is to distill the problem to its absolute simplest form. Instead of using the full version of your level, why not make a simpler one with a few boxes and a ground plane. Then, if you can re-create the problem there, you can just post that Egg and let someone take a look at it.

FenrirWolf

Thanks a lot !
Is very usefull this code

base.cTrav.showCollisions (base.render)

Is possible see the collisions on regions, but is possible too see the problem of “where” the collision exists, and see the problem (like the feets dissapear on objects with another angulation).

See:


By mcunha98 at 2009-08-16


By mcunha98 at 2009-08-16

Any suggestion ?

Current version of code:

        self.floorRay=self.model.attachCollisionRay("",0,0,-7.5,0,0,-1,BitMask32.bit(1), BitMask32.allOff())
        self.floorHandler = CollisionHandlerGravity()
        self.floorHandler.setGravity(1.5)
        self.floorHandler.addCollider(self.floorRay, self.model)
        base.cTrav.addCollider(self.floorRay, self.floorHandler)
        self.floorRay.show()
        
        self.pusherHandler=CollisionHandlerPusher()
        self.TorsoSphere=self.model.attachCollisionSphere("",0,0,0,7.2,BitMask32.bit(1),BitMask32.allOff())
        self.TorsoSphere.show()
        self.pusherHandler.addCollider(self.TorsoSphere, self.model)
        base.cTrav.addCollider(self.TorsoSphere, self.pusherHandler)

        self.RightFootBone = self.model.controlJoint(None, 'modelRoot', 'pe.r')
        self.RightFootSphere=self.model.attachCollisionSphere("",0,0,0,3,BitMask32.bit(1),BitMask32.allOff())
        self.pusherHandler.addCollider(self.RightFootSphere, self.model)
        self.RightFootSphere.show()
        base.cTrav.addCollider(self.RightFootSphere, self.pusherHandler)
        self.RightFootSphere.reparentTo(self.RightFootBone)

in the beginning of your movie you see yourself colliding with the window. to prevent that you should create a special collision geometry of your level (1 for the visuals, 1 for the collisions with as few as possible details). only add the “polyset descend” tags and leave out the “keep” for the collision model, dont add any tags to the visual model.

later in the video i think you collide with the terrain, which might not be connected or has a edge somewhere. to fix this i’d try to make your collision sphere smaller so it doesnt touch the ground. the collisionhandlerpusher has flaws when it comes to handling edges (for example a edge of a house), it keeps you stuck or pushes you back.

Hypnos,

First, thanks for watch and have patience to try help.
So, I understood your advices, first I’ll change the tag removing keep tag for objects and define the tag to

<Collide>{Polyset descend} 

After, I post the results …

Thanks again

Sorry for late to reply again…

First I remove from all groups the Collide directive, and put it only in a single object, the playerclip mesh has the collision.

<Group> playercilp {
  <Collide>{Polyset descend} 
  <Transform> {
    <Matrix4> {
      34.566746 0.000000 0.000000 0.000000
      0.000000 34.566746 0.000000 0.000000
      0.000000 0.000000 34.566746 0.000000
      -194.318817 32.619751 28.337145 1.000000
    }
  }

Here this mesh in design mode:

But the problem continue…
When the player was created , he collide with mesh of the scene too, not only with the playerclip mesh.

When he collides with the mesh, the mesh push him for the for besides around the mesh.

See this sequence of images to notice the problems


By mcunha98 at 2009-08-30


By mcunha98 at 2009-08-30


By mcunha98 at 2009-08-30


By mcunha98 at 2009-08-30

More ideas ??? :blush:

This imagem shows the change I did waiting better results…but.
In strange, but the object cause collisions in scene so far !?!