character cylinder move

binofet
Posts: 20
Joined: Fri Jun 15, 2007 5:03 pm

character cylinder move

Post by binofet »

I've been trying to impelement a WorldMove method that we will be using for character movement. I was instructed to have it take a desired worldposition and a correction vector as parameters.

So i basically apply the desired position to the cylinder, and then performDiscreteCollision between the cylinder and static and dynamic objects iteratively if they are in AABB collision. Then I return the correction vector and decide wether or not to move it in player code. It seems like others are using impulses to move their characters, but I know that we need the ability to place a character (and possibly any object) anywhere at will and if its colliding correct it.

This is somewhat working but the normal for the correction sometimes comes back wrong when colliding with a BVHTriangleMesh (which I'm using for terrain). It seems that the only reason this could happen is if its testing collision on triangle edges (made sure triangles aren't wound backwards), which i don't think i want on the terrain. Is there a way to disable testing for edge collision on a triangle? Looks like it takes place in GJK and would be hard to do.

Any general pointers for what I'm doing here would be greaty appreciated.

Thanks,

bino
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

Have you tried to use a capsule, instead of cylinder?