How to replicate the behavior of the vehicle wrapper (KX_VehicleWrapper)?
It’s just for the sake of research and learning, I know the vehicle wrapper was created to simplify the task of creating vehicle physics, and creating it from scratch again is (somewhat) useless. I would like to understand how it works ‘behind the scenes’.
What I probably know is just the wheels are ‘aesthetical’, the ‘real’ wheels are rays that check the distance from the chassis to the ground. From this point, what happens? We use chassis.applyImpulse in the position of the corresponding wheel? If not, what must be done to keep the chassis ‘floating’ on the ground?
Well, now THAT’S complicated. I don’t really know what is happening “behind the scenes”, but a good idea might be to turn on Physics Visualization. That might help some. For example it shows the wheel centre, and probably casts some sort of ray as you say, in the direction that you specified (normally [0, 0, -1]).
But anyway, good luck learning it! It is always nice to learn more…