godotengine / godot-proposals

Godot Improvement Proposals (GIPs)
MIT License
1.13k stars 88 forks source link

Implement multi-ray casting for VehicleWheel3D #3985

Open danger-dan opened 2 years ago

danger-dan commented 2 years ago

Describe the project you are working on

3D Vehicle based game.

Describe the problem or limitation you are having in your project

The VehicleWheel3d Class/Node is implemented with a single ray cast which gets the job done. however this will cause the wheel to clip objects in certain situations. Mostly this is acceptable however it wouldn't hurt to use a multi ray system which would fix this issue.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

We implement multiple rays along the wheel diameter. - This is the easiest approach (I have already got this working on a private repo). I would however consider maybe adding a second line of rays - which would essentially create a simplified cylinder volume cast where we only cast on the edges.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

N/A it is behind the scenes - engine related.

If this enhancement will not be used often, can it be worked around with a few lines of script?

Not possible without massive overhead.

Is there a reason why this should be core and not an add-on in the asset library?

Physics engine related.

Calinou commented 2 years ago

Feel free to open a pull request for this :slightly_smiling_face:

danger-dan commented 2 years ago

I am going to play with using a second "array" of rays for a bit. Ill send through the PR soonish.

MarcusElg commented 2 years ago

Isn't it a better idea to shapecast a cylinder? If something like #2896 is implemented