convexSweepTest returns differently for the same position.

Post Reply
Posts: 1
Joined: Tue Jan 19, 2021 9:58 am

convexSweepTest returns differently for the same position.

Post by wren945 »

I'm using convextSweepTest to simulate my character capsule (imaginary, no real rigid body involved) sliding along a wall.

As in the picture below, in one frame, I sweep from A to B, I get no hit all all. So I assume B is safe and my character could move to B.

But in next frame, if I sweep from B, I always get a hit with the wall with a fraction of 0, no matter which direction I sweep to, and my character got stuck.

Untitled.jpg (26.62 KiB) Viewed 1449 times

For test purpose, I tried sweeping from B away from the wall along wall's normal direction, or sweeping reversely from B to A, always got hit at 0 fraction. It seems B has already penetrated. This isn't consistent with the first sweep, as it's already told me B was safe.

How is that subsequent sweeps are not consistent. What could I have missed?

Some more info:
- Distance from A to B is small, as it's a delta move between frames.
- I could always keep A and B away a litte bit from wall when user moves against the wall, but I couldn't prevent user from coming very close to the wall from side ways.

Thanks a lot
Post Reply