Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PxVehicle suspension sweeps distance #548

Open
zemlifr opened this issue Mar 17, 2022 · 1 comment
Open

PxVehicle suspension sweeps distance #548

zemlifr opened this issue Mar 17, 2022 · 1 comment

Comments

@zemlifr
Copy link

zemlifr commented Mar 17, 2022

Hello, I am using non-blocking suspension sweeps for my vehicle simulation.

Rejection angles are both set to 75°

Recently I have encountered following problem:

Frame 1

Frame 2

I don't understand why front wheel suspension selects contact with second vehicle instead of ground.
From picture it seems, that actual sweep hit was on surface of vehicle but wheel position was clamped by mMaxCompression value.

I looked into sweep code, and I have noticed that sweep start is computed as

suspStartPose.p -= suspLineDir*(radius + maxBounce);

I don't understand why wheel radius is added there. I understand why you want add radius when doing raycast, but it seems to me unnecessary there when I have actual cylinder geoetery.

Do I miss something?

@gyeomannvidia
Copy link

The extra radius is deliberate.

If the sweep starts inside geometry it is difficult to determine the position and normal of the sweep hit. If the vehicle is placed such that the wheel is at maximum compression, the sweep will fail because the sweep will start inside geometry. The extra radius is just to add a small buffer to the sweep length so that we can successfully perform a sweep across the whole range of legal wheel positions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants