Raycast/sweep test doesn't collide with 0 collision margin

Post Reply
Enhex
Posts: 7
Joined: Mon Mar 24, 2014 3:57 pm

Raycast/sweep test doesn't collide with 0 collision margin

Post by Enhex »

Hi,

I noticed that raycast doesn't hit convex hulls that have 0 collision margin the vast majority of the time.
And sweep test also seems to have a similar problem.

My problem with collision margin is that it creates rounded corners.
I have a character controller that has an auto stepping algorithm similar to the way Quake does it - trying to sweep cast from +STEPSIZE height, and then down to "land".
Because of the rounded corners, I suspect that when landing close to a ledge the down sweep hits the rounded part and lands a bit below the top of the stair, landing on a steep slope that is considered unstepable in the next step attempt by the algorithm (so you can't walk on steep slopes).

The elegant solution to this problem is to use 0 margins, which solves the stepping problem, but then the sweep test breaks when colliding with things.
Is there a way to make sweep test work properly with 0 collision margin?
A possible workaround is to somehow ignore the collision margin for the down sweep test, is that possible?

btw I'm using a cylinder collision shape.
Bullet version 2.82
Enhex
Posts: 7
Joined: Mon Mar 24, 2014 3:57 pm

Re: Raycast/sweep test doesn't collide with 0 collision marg

Post by Enhex »

I guess I'll revert to a dynamic capsule controller for now, but is the 0 margin cast failure a known bug?
Is there a plan to fix it?
Post Reply