Godot: VehicleWheel does not apply force to ground

Created on 19 Mar 2020  Â·  8Comments  Â·  Source: godotengine/godot

Godot version:
3.2.1

OS/device including version:
Win10

Issue description:
When using a VehicleBody as well as a VehicleWheel, one would expect that the wheels would influence the ground with as much force as the ground is influencing the wheel, as following the Newton's laws of motion.

archived discussion physics

All 8 comments

Well, the basic idea of arcade vehicle physics simulation is that a wheel is just a raycast (or shapecast) into the ground and forces are applied to RigidBody (vehicle itself), This is what stock physics engines do and what is implemented in Godot.
I think you have concluded something on your own without considering previous experience in game making, but still if you explain detailed enough what you actually want to achieve we can come with proper advice what can be done to have proper simulation of what you need.

Anyway nothing stops you from making detailed vehicle physics. You can use "motors" with Godot so you can set up 4 rigid bodies for wheels and main rigid body for vehicle body and connect them via constraints and roll the motors (or apply torque), this way you will get what you want (but the resource consumption might be much higher). Also static bodies will not accumulate momentum if that is what you want and you will need to have proper rigid bodies for such purposes, even if they will not move.

I guess, I was just expecting similar behavior as what you get with Unity (PhysX) out of the box. WheelCollider in Unity also uses a raycast. I don't understand why an arcade game couldn't use this feature as well. I don't see how it would be difficult to implement either.

I don't think Unity's wheel colliders exert any force on the ground.
Anyway, Godot's vehicle physics is pretty much a port of Bullet physics vehicle...

I'm sorry but saying that Unity's wheel colliders doesn't exert any force on the ground is just plain wrong. I choose Unity for my project as it did in fact exert force on the ground.

Below is a link to the the line where I propose the same force but in opposite direction is being applied to the ground rigidbody (if the ground has one) https://github.com/godotengine/godot/blob/2f237d181b6fd769b52bded49cafc9bc5eb9f087/scene/3d/vehicle_body.cpp#L887

You can wrap-up a small demo in gdscript which applies forces to the
ground if wheels touch it.
Should be trivial to implement to see if any performance issues occur
and if you gain what you want.
If the physics model ends up working, the feature would be trivial to implement.

On Sat, Mar 21, 2020 at 11:10 PM McGittyHub notifications@github.com wrote:
>

I'm sorry but saying that Unity's wheel colliders doesn't exert any force on the ground is just plain wrong. I choose Unity for my project as it did in fact exert force on the ground.

This is the line where I propose the same force but in opposite direction is being applied to the ground rigidbody (if the ground has one) https://github.com/godotengine/godot/blob/2f237d181b6fd769b52bded49cafc9bc5eb9f087/scene/3d/vehicle_body.cpp#L887

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.

I’ll just use Unity.. doesn’t seem like godot/gdscript is advanced enough to provide enough information to make this feasible.

Farewell.

Does Bullet physics do what you expect @McGittyHub? If it does, and we don't, then it's a bug to be fixed...

Default RaycastVehicle does not and not intended to. You can apply
force manually to see the required behavior, but I guess the
motivation for that was low enough. Would be nice feature to add
though as it looks actually legit and will free from gdscript
slowdowns. From other hand one might just modify it locally. Anyway
would be nice to have a formulae somewhere so to do either of this as
my brain segfauted twice when trying to remember the math intended.
Anyway, should be trivial to implement.

On Sun, Mar 22, 2020 at 6:17 PM Zireael07 notifications@github.com wrote:
>

Does Bullet physics do what you expect @McGittyHub? If it does, and we don't, then it's a bug to be fixed...

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or unsubscribe.

Was this page helpful?
0 / 5 - 0 ratings