addmix / godot_aerodynamic_physics Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Since the beginning, procedural aero surfaces have had many issues with how forces are calculated, how drag and lift could be modified, and the real effect of properties. This is a tracker for those issues.
I'm probably seeing something wrong here, but I am getting this error.
[edit, it only shows when I use visual code...its probably not a real problem.]
Have been using your library for a bit, and had lots of fun with it without any issues. Thank you for your work!
I am a Godot newbie, so I hope my question/problem is not too dumb:
When creating a spawnable scene (be it an airplane, tank, bunker or whatever else) I try to follow the principle of composition. That means I have a bunch of specialized nodes with their own classes and logic, and all of them are "orchestrated" through the root node methods and events. It makes sense to use AeroBody3D
as the root node, since everything in the scene will be moving relative to it. But now, since the root node is an AeroBody3D
, I cannot attach my own script to this node. As a hack I've been using the following structure:
In my understanding, it would be better to have AeroBody3D
as a complete standalone node (which requires cpp). But as a fast workaround you can also make AeroBody3D
extend Node
, but require a VehicleBody3D
through an @export
directive, like so:
This is also hacky and requires a way to register an _intergrate_forces
handler:
extends VehicleBody3D
var my_custom_integrator: Callable
func _integrate_forces(state: PhysicsDirectBodyState3D) -> void:
my_custom_intergrator.callv([state])
# and then in aerobody:
func _ready() -> void:
body.my_custom_integrator = _integrate_forces
And I have to slightly modify the AeroBody3D
script, meaning potential conflicts if you modify this part of the code in the future.
So my question is, am I overthinking this, or is this an actual limitation of sorts that I should work around in other ways? Or of course there might have been a way to use AeroBody3D
as a root node and also have my own script attached to it, and I just don't know how to do it.
Have visualizations for center of lift, thrust, and drag.
I've noticed it's kinda weird to get surfaces to behave nicely.
Problem:
For a real aircraft a flight control will pivot around a line in 3D space offset from its geometric centre, but the surfaces in this library only pivot around the geometric centre of the node. I tried using dummy nodes to parent AeroSurface3Ds, but they were ignored by the AeroBody3D
Possible Solution #1: (probs easier)
Every AeroSurface3D should include a pivot offset (float signifying distance on chord)
Possible Solution #2: (my fave)
Attach every AreoSurface3D to a pivot line (Node3D + offset) and check the entire tree for valid AeroSurface3Ds in a vehicle and add them to the list of things to consider.
I love your work, hope it continues <3
I'm currently running on Godot 4.3 rc4 and for whatever reason, the plugin won't load properly, instead just spewing a bunch of errors. I downloaded it directly from the Asset Library in-engine to my existing project, so I'm not entirely sure what happened.
Godot Engine v4.3.dev4.official (c) 2007-present Juan Linietsky, Ariel Manzur & Godot Contributors.
--- Debug adapter server started ---
--- GDScript language server started on port 6005 ---
Detach Script
Node not found: "" (relative to "/root/@EditorNode@16670/@Panel@13/@VBoxContainer@14/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@25/DockVSplitCenter/@VSplitContainer@46/@VBoxContainer@47/@PanelContainer@92/MainScreen/@CanvasItemEditor@9208/@VSplitContainer@9030/@HSplitContainer@9032/@HSplitContainer@9034/@Control@9035/@SubViewportContainer@9036/@SubViewport@9037/Airplane/AnimationPlayer").
Node not found: "" (relative to "/root/@EditorNode@16670/@Panel@13/@VBoxContainer@14/DockHSplitLeftL/DockHSplitLeftR/DockHSplitMain/@VBoxContainer@25/DockVSplitCenter/@VSplitContainer@46/@VBoxContainer@47/@PanelContainer@92/MainScreen/@CanvasItemEditor@9208/@VSplitContainer@9030/@HSplitContainer@9032/@HSplitContainer@9034/@Control@9035/@SubViewportContainer@9036/@SubViewport@9037/Airplane/AnimationPlayer").
Remove Node(s)
res://godot_aerodynamic_physics/core/aero_body_3d.gd:222 - Parse Error: Identifier "AeroUnits" not declared in the current scope.
res://godot_aerodynamic_physics/core/aero_body_3d.gd:223 - Parse Error: Identifier "AeroUnits" not declared in the current scope.
res://godot_aerodynamic_physics/core/aero_body_3d.gd:224 - Parse Error: Identifier "AeroUnits" not declared in the current scope.
modules/gdscript/gdscript.cpp:2824 - Failed to load script "res://godot_aerodynamic_physics/core/aero_body_3d.gd" with error "Parse error". (User)
res://godot_aerodynamic_physics/core/aero_influencer_3d/aero_rotator_3d/aero_cyclic_propeller_3d.gd:0 - Parse Error: Could not resolve class "AeroVariablePropeller3D".
modules/gdscript/gdscript.cpp:2824 - Failed to load script "res://godot_aerodynamic_physics/core/aero_influencer_3d/aero_rotator_3d/aero_cyclic_propeller_3d.gd" with error "Parse error". (User)
Cannot get class 'AeroVariablePropeller3D'.
editor/create_dialog.cpp:271 - Condition "inherits.is_empty()" is true.
res://godot_aerodynamic_physics/core/aero_influencer_3d/aero_rotator_3d/aero_variable_propeller_3d.gd:0 - Parse Error: Could not resolve class "AeroPropeller3D".
modules/gdscript/gdscript.cpp:2824 - Failed to load script "res://godot_aerodynamic_physics/core/aero_influencer_3d/aero_rotator_3d/aero_variable_propeller_3d.gd" with error "Parse error". (User)
res://godot_aerodynamic_physics/core/aero_influencer_3d/aero_rotator_3d/aero_propeller_3d.gd:0 - Parse Error: Could not resolve class "AeroRotator3D".
modules/gdscript/gdscript.cpp:2824 - Failed to load script "res://godot_aerodynamic_physics/core/aero_influencer_3d/aero_rotator_3d/aero_propeller_3d.gd" with error "Parse error". (User)
res://godot_aerodynamic_physics/core/aero_influencer_3d/aero_rotator_3d/aero_rotator_3d.gd:0 - Parse Error: Could not resolve class "AeroInfluencer3D".
modules/gdscript/gdscript.cpp:2824 - Failed to load script "res://godot_aerodynamic_physics/core/aero_influencer_3d/aero_rotator_3d/aero_rotator_3d.gd" with error "Parse error". (User)
res://godot_aerodynamic_physics/core/aero_influencer_3d/aero_influencer_3d.gd:71 - Parse Error: Identifier "AeroUnits" not declared in the current scope.
res://godot_aerodynamic_physics/core/aero_influencer_3d/aero_influencer_3d.gd:72 - Parse Error: Identifier "AeroUnits" not declared in the current scope.
modules/gdscript/gdscript.cpp:2824 - Failed to load script "res://godot_aerodynamic_physics/core/aero_influencer_3d/aero_influencer_3d.gd" with error "Parse error". (User)
Cannot get class 'AeroRotator3D'.
editor/create_dialog.cpp:271 - Condition "inherits.is_empty()" is true.
res://godot_aerodynamic_physics/core/aero_influencer_3d/aero_surface_3d/aero_surface_3d.gd:32 - Parse Error: Could not find type "Vector3D" in the current scope.
res://godot_aerodynamic_physics/core/aero_influencer_3d/aero_surface_3d/aero_surface_3d.gd:33 - Parse Error: Could not find type "Vector3D" in the current scope.
res://godot_aerodynamic_physics/core/aero_influencer_3d/aero_surface_3d/aero_surface_3d.gd:0 - Parse Error: Could not resolve class "AeroInfluencer3D".
res://godot_aerodynamic_physics/core/aero_influencer_3d/aero_surface_3d/aero_surface_3d.gd:38 - Parse Error: Identifier "Vector3D" not declared in the current scope.
res://godot_aerodynamic_physics/core/aero_influencer_3d/aero_surface_3d/aero_surface_3d.gd:43 - Parse Error: Identifier "Vector3D" not declared in the current scope.
modules/gdscript/gdscript.cpp:2824 - Failed to load script "res://godot_aerodynamic_physics/core/aero_influencer_3d/aero_surface_3d/aero_surface_3d.gd" with error "Parse error". (User)
res://godot_aerodynamic_physics/core/aero_influencer_3d/aero_surface_3d/manual_aero_surface_3d/manual_aero_surface_3d.gd:0 - Parse Error: Could not resolve class "AeroSurface3D".
res://godot_aerodynamic_physics/core/aero_influencer_3d/aero_surface_3d/manual_aero_surface_3d/manual_aero_surface_3d.gd:0 - Parse Error: Could not resolve class "AeroSurface3D".
modules/gdscript/gdscript.cpp:2824 - Failed to load script "res://godot_aerodynamic_physics/core/aero_influencer_3d/aero_surface_3d/manual_aero_surface_3d/manual_aero_surface_3d.gd" with error "Parse error". (User)
Cannot get class ''.
editor/editor_data.cpp:587 - Parameter "p_object" is null.
editor/scene_tree_dock.cpp:2676 - Condition "!c" is true.
Altitudes lower than the minimum and higher than the maximum interpolate incorrectly.
Create GUT (Godot Unit Testing) integration for automated testing.
Helicopter dynamics have proven to be much more difficult to simulate properly than I had anticipated.
Because the blades are on hinges, upward forces are not directly applied to the helicopter body, but are instead applied through the balance of the blade's centrifugal force and the upward "flap" of the blades. The AeroRotorHinge3D node are subsequently not accurate to any degree. As an extension of this issue, the AeroRotorHinge3D class needs damping implemented, so that blade flapping does not become chaotic. AeroRotorHinge3D might also need some form of conservation of angular momentum implemented, as blades flap, they also lead forward, although this may not be a necessary effect to model.
Getting the center of pressure is trivial, as a positioned impulse corresponds to it.
Related #4
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.