While video tutorials about creating a flight simulator in Unity abound, examples of such things in Godot, even without any source code, are nowhere. After much searching, there was finally a car demo
https://github.com/BastiaanOlij/vehicle-demo
It showed a script called Car.gd which inherits from VehicleBody. The magic bit is this nugget:
void VehicleWheel::_notification(int p_what) {
if (p_what == NOTIFICATION_ENTER_TREE) {
VehicleBody *cb = Object::cast_to<VehicleBody>(get_parent());
if (!cb)
return;
What probably happens is the VehicleBody is instantiated 1st because the user bound it to an object in the scene graph. Then for every object in the scene graph, Godot calls the _notification method in a list of every class that inherits from the Spatial class. If the parent object of a Spatial class is a VehicleBody, the cast_to succeeds so it knows it's a wheel. This won't work if some children are raptors, grid fins, & landing legs.
Despite supporting many languages, game developers seem to prefer Python while Godot's built in classes & its documentation is in C++.
They export the complete model from Blender in a GLTF file. Materials are manely defined in godot & only somewhat imported. Godot does not put imported materials in the scene graph, but links them to the model somewhere else, until overridden by the scene graph.
There are more examples on:
https://github.com/TutorialDoctor/TD-Godot-Games
but nothing about doing the magic VehicleWheel instantiation in python.
Also discovered OpenGL & DirectX are going away & being replaced by yet another programming language: Vulkan.
Otherwise, discovered some interesting usage statistics about XPlane.
https://developer.x-plane.com/2018/06/usage-data-as-of-june-2018/
Only 0.9% of its users are on Linux. Quite a decline from the glory days.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.