Skip to content

Commit

Permalink
Refactor Helicopter controls (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
TitanNano authored Jan 22, 2025
1 parent 747cab9 commit a259151
Show file tree
Hide file tree
Showing 4 changed files with 119 additions and 42 deletions.
2 changes: 1 addition & 1 deletion native/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ edition = "2021"
crate-type = ["cdylib"]

[dependencies]
godot = { version = "0.2.2", features = ["experimental-threads"] }
godot = { version = "0.2.2", features = ["experimental-threads", "api-4-2"] }
godot-rust-script = { git = "https://github.com/titannano/godot-rust-script", rev = "46b151f558370c260fa1e79502637f128ea7bb7f" }
lerp = "0.4.0"
backtrace = "0.3.64"
Expand Down
10 changes: 10 additions & 0 deletions project.godot
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,16 @@ fire_secondary={
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":0,"window_id":0,"alt_pressed":false,"shift_pressed":true,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":0,"key_label":4194309,"unicode":0,"echo":false,"script":null)
]
}
strafe_left={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":true,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":65,"key_label":0,"unicode":65,"echo":false,"script":null)
]
}
strafe_right={
"deadzone": 0.5,
"events": [Object(InputEventKey,"resource_local_to_scene":false,"resource_name":"","device":-1,"window_id":0,"alt_pressed":false,"shift_pressed":true,"ctrl_pressed":false,"meta_pressed":false,"pressed":false,"keycode":0,"physical_keycode":68,"key_label":0,"unicode":68,"echo":false,"script":null)
]
}

[network]

Expand Down
3 changes: 2 additions & 1 deletion resources/Objects/Helis/schweizer_300.tscn
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ _surfaces = [{
"vertex_data": PackedByteArray(0, 0, 0, 0, 0, 0, 0, 0, 80, 122, 185, 192, 92, 189, 144, 191, 0, 0, 0, 0, 244, 233, 181, 192, 100, 245, 13, 192, 0, 0, 0, 0, 239, 91, 171, 192, 133, 23, 78, 192, 0, 0, 0, 0, 25, 56, 154, 192, 17, 39, 131, 192, 0, 0, 0, 0, 17, 39, 131, 192, 25, 56, 154, 192, 0, 0, 0, 0, 133, 23, 78, 192, 239, 91, 171, 192, 0, 0, 0, 0, 99, 245, 13, 192, 244, 233, 181, 192, 0, 0, 0, 0, 93, 189, 144, 191, 80, 122, 185, 192, 0, 0, 0, 0, 105, 5, 136, 52, 244, 233, 181, 192, 0, 0, 0, 0, 92, 189, 144, 63, 240, 91, 171, 192, 0, 0, 0, 0, 99, 245, 13, 64, 240, 91, 171, 192, 0, 0, 0, 0, 99, 245, 13, 64, 26, 56, 154, 192, 0, 0, 0, 0, 132, 23, 78, 64, 26, 56, 154, 192, 0, 0, 0, 0, 132, 23, 78, 64, 17, 39, 131, 192, 0, 0, 0, 0, 17, 39, 131, 64, 132, 23, 78, 192, 0, 0, 0, 0, 26, 56, 154, 64, 101, 245, 13, 192, 0, 0, 0, 0, 239, 91, 171, 64, 91, 189, 144, 191, 0, 0, 0, 0, 244, 233, 181, 64, 105, 5, 8, 53, 0, 0, 0, 0, 80, 122, 185, 64, 88, 189, 144, 63, 0, 0, 0, 0, 244, 233, 181, 64, 99, 245, 13, 64, 0, 0, 0, 0, 239, 91, 171, 64, 99, 245, 13, 64, 0, 0, 0, 0, 239, 91, 171, 64, 135, 23, 78, 64, 0, 0, 0, 0, 25, 56, 154, 64, 135, 23, 78, 64, 0, 0, 0, 0, 25, 56, 154, 64, 16, 39, 131, 64, 0, 0, 0, 0, 17, 39, 131, 64, 24, 56, 154, 64, 0, 0, 0, 0, 137, 23, 78, 64, 239, 91, 171, 64, 0, 0, 0, 0, 103, 245, 13, 64, 244, 233, 181, 64, 0, 0, 0, 0, 95, 189, 144, 63, 80, 122, 185, 64, 0, 0, 0, 0, 113, 110, 148, 179, 244, 233, 181, 64, 0, 0, 0, 0, 96, 189, 144, 191, 239, 91, 171, 64, 0, 0, 0, 0, 104, 245, 13, 192, 239, 91, 171, 64, 0, 0, 0, 0, 104, 245, 13, 192, 27, 56, 154, 64, 0, 0, 0, 0, 129, 23, 78, 192, 27, 56, 154, 64, 0, 0, 0, 0, 129, 23, 78, 192, 18, 39, 131, 64, 0, 0, 0, 0, 15, 39, 131, 192, 18, 39, 131, 64, 0, 0, 0, 0, 15, 39, 131, 192, 135, 23, 78, 64, 0, 0, 0, 0, 25, 56, 154, 192, 99, 245, 13, 64, 0, 0, 0, 0, 240, 91, 171, 192, 88, 189, 144, 63, 0, 0, 0, 0, 244, 233, 181, 192, 128, 93, 42, 176, 0, 0, 0, 0, 1, 232, 182, 192, 164, 187, 142, 191, 0, 0, 0, 0, 75, 100, 179, 192, 139, 253, 11, 192, 0, 0, 0, 0, 189, 251, 168, 192, 12, 60, 75, 192, 0, 0, 0, 0, 188, 20, 152, 192, 147, 85, 129, 192, 0, 0, 0, 0, 147, 85, 129, 192, 188, 20, 152, 192, 0, 0, 0, 0, 12, 60, 75, 192, 189, 251, 168, 192, 0, 0, 0, 0, 138, 253, 11, 192, 75, 100, 179, 192, 0, 0, 0, 0, 165, 187, 142, 191, 1, 232, 182, 192, 0, 0, 0, 0, 163, 34, 134, 52, 75, 100, 179, 192, 0, 0, 0, 0, 164, 187, 142, 63, 189, 251, 168, 192, 0, 0, 0, 0, 138, 253, 11, 64, 189, 251, 168, 192, 0, 0, 0, 0, 138, 253, 11, 64, 189, 20, 152, 192, 0, 0, 0, 0, 11, 60, 75, 64, 189, 20, 152, 192, 0, 0, 0, 0, 11, 60, 75, 64, 147, 85, 129, 192, 0, 0, 0, 0, 147, 85, 129, 64, 11, 60, 75, 192, 0, 0, 0, 0, 189, 20, 152, 64, 140, 253, 11, 192, 0, 0, 0, 0, 189, 251, 168, 64, 163, 187, 142, 191, 0, 0, 0, 0, 75, 100, 179, 64, 12, 248, 5, 53, 0, 0, 0, 0, 1, 232, 182, 64, 160, 187, 142, 63, 0, 0, 0, 0, 75, 100, 179, 64, 138, 253, 11, 64, 0, 0, 0, 0, 189, 251, 168, 64, 14, 60, 75, 64, 0, 0, 0, 0, 188, 20, 152, 64, 146, 85, 129, 64, 0, 0, 0, 0, 147, 85, 129, 64, 187, 20, 152, 64, 0, 0, 0, 0, 16, 60, 75, 64, 189, 251, 168, 64, 0, 0, 0, 0, 142, 253, 11, 64, 75, 100, 179, 64, 0, 0, 0, 0, 167, 187, 142, 63, 1, 232, 182, 64, 0, 0, 0, 0, 159, 95, 146, 179, 75, 100, 179, 64, 0, 0, 0, 0, 168, 187, 142, 191, 189, 251, 168, 64, 0, 0, 0, 0, 143, 253, 11, 192, 189, 251, 168, 64, 0, 0, 0, 0, 143, 253, 11, 192, 190, 20, 152, 64, 0, 0, 0, 0, 8, 60, 75, 192, 148, 85, 129, 64, 0, 0, 0, 0, 145, 85, 129, 192, 148, 85, 129, 64, 0, 0, 0, 0, 145, 85, 129, 192, 14, 60, 75, 64, 0, 0, 0, 0, 188, 20, 152, 192, 138, 253, 11, 64, 0, 0, 0, 0, 189, 251, 168, 192, 160, 187, 142, 63, 0, 0, 0, 0, 75, 100, 179, 192, 128, 235, 6, 48, 0, 0, 0, 0, 168, 131, 187, 192, 50, 84, 146, 191, 0, 0, 0, 0, 72, 233, 183, 192, 105, 132, 15, 192, 0, 0, 0, 0, 152, 61, 173, 192, 207, 90, 80, 192, 0, 0, 0, 0, 149, 233, 155, 192, 183, 151, 132, 192, 0, 0, 0, 0, 183, 151, 132, 192, 149, 233, 155, 192, 0, 0, 0, 0, 207, 90, 80, 192, 152, 61, 173, 192, 0, 0, 0, 0, 104, 132, 15, 192, 72, 233, 183, 192, 0, 0, 0, 0, 51, 84, 146, 191, 168, 131, 187, 192, 0, 0, 0, 0, 190, 131, 137, 52, 72, 233, 183, 192, 0, 0, 0, 0, 50, 84, 146, 63, 153, 61, 173, 192, 0, 0, 0, 0, 104, 132, 15, 64, 150, 233, 155, 192, 0, 0, 0, 0, 206, 90, 80, 64, 183, 151, 132, 192, 0, 0, 0, 0, 183, 151, 132, 64, 206, 90, 80, 192, 0, 0, 0, 0, 150, 233, 155, 64, 106, 132, 15, 192, 0, 0, 0, 0, 152, 61, 173, 64, 49, 84, 146, 191, 0, 0, 0, 0, 72, 233, 183, 64, 121, 165, 9, 53, 0, 0, 0, 0, 168, 131, 187, 64, 46, 84, 146, 63, 0, 0, 0, 0, 72, 233, 183, 64, 104, 132, 15, 64, 0, 0, 0, 0, 152, 61, 173, 64, 104, 132, 15, 64, 0, 0, 0, 0, 152, 61, 173, 64, 209, 90, 80, 64, 0, 0, 0, 0, 149, 233, 155, 64, 209, 90, 80, 64, 0, 0, 0, 0, 149, 233, 155, 64, 182, 151, 132, 64, 0, 0, 0, 0, 183, 151, 132, 64, 147, 233, 155, 64, 0, 0, 0, 0, 211, 90, 80, 64, 152, 61, 173, 64, 0, 0, 0, 0, 108, 132, 15, 64, 72, 233, 183, 64, 0, 0, 0, 0, 53, 84, 146, 63, 168, 131, 187, 64, 0, 0, 0, 0, 168, 15, 150, 179, 72, 233, 183, 64, 0, 0, 0, 0, 54, 84, 146, 191, 152, 61, 173, 64, 0, 0, 0, 0, 109, 132, 15, 192, 151, 233, 155, 64, 0, 0, 0, 0, 203, 90, 80, 192, 184, 151, 132, 64, 0, 0, 0, 0, 180, 151, 132, 192, 209, 90, 80, 64, 0, 0, 0, 0, 149, 233, 155, 192, 104, 132, 15, 64, 0, 0, 0, 0, 153, 61, 173, 192, 46, 84, 146, 63, 0, 0, 0, 0, 72, 233, 183, 192, 255, 255, 255, 191, 127, 0, 0, 127, 255, 255, 255, 191, 0, 127, 0, 0, 255, 255, 255, 191, 239, 91, 171, 192, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 17, 39, 131, 192, 255, 255, 255, 191, 0, 0, 0, 60, 255, 255, 255, 191, 127, 0, 0, 127, 255, 255, 255, 191, 0, 127, 0, 0, 255, 255, 255, 191, 93, 189, 144, 191, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 244, 233, 181, 192, 255, 255, 255, 191, 0, 0, 0, 60, 255, 255, 255, 191, 127, 0, 0, 127, 255, 255, 255, 191, 0, 127, 0, 0, 255, 255, 255, 191, 132, 23, 78, 64, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 17, 39, 131, 192, 255, 255, 255, 191, 0, 0, 0, 60, 255, 255, 255, 191, 127, 0, 0, 127, 255, 255, 255, 191, 0, 127, 0, 0, 255, 255, 255, 191, 244, 233, 181, 64, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 88, 189, 144, 63, 255, 255, 255, 191, 0, 0, 0, 60, 255, 255, 255, 191, 127, 0, 0, 127, 255, 255, 255, 191, 0, 127, 0, 0, 255, 255, 255, 191, 25, 56, 154, 64, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 16, 39, 131, 64, 255, 255, 255, 191, 0, 0, 0, 60, 255, 255, 255, 191, 127, 0, 0, 127, 255, 255, 255, 191, 0, 127, 0, 0, 255, 255, 255, 191, 95, 189, 144, 63, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 244, 233, 181, 64, 255, 255, 255, 191, 0, 0, 0, 60, 255, 255, 255, 191, 127, 0, 0, 127, 255, 255, 255, 191, 0, 127, 0, 0, 255, 255, 255, 191, 129, 23, 78, 192, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 18, 39, 131, 64, 255, 255, 255, 191, 0, 0, 0, 60, 255, 255, 255, 191, 127, 0, 0, 127, 255, 255, 255, 191, 0, 127, 0, 0, 255, 255, 255, 191, 240, 91, 171, 192, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 128, 93, 42, 176, 255, 255, 255, 191, 0, 0, 0, 60, 255, 255, 255, 191, 127, 0, 0, 127, 255, 255, 255, 191, 0, 127, 0, 0, 255, 255, 255, 191, 188, 20, 152, 192, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 188, 20, 152, 192, 255, 255, 255, 191, 0, 0, 0, 60, 255, 255, 255, 191, 127, 0, 0, 127, 255, 255, 255, 191, 0, 127, 0, 0, 255, 255, 255, 191, 163, 34, 134, 52, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 189, 251, 168, 192, 255, 255, 255, 191, 0, 0, 0, 60, 255, 255, 255, 191, 127, 0, 0, 127, 255, 255, 255, 191, 0, 126, 0, 0, 255, 255, 255, 191, 11, 60, 75, 64, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 11, 60, 75, 192, 255, 255, 255, 191, 0, 0, 0, 60, 255, 255, 255, 191, 127, 0, 0, 127, 255, 255, 255, 191, 0, 127, 0, 0, 255, 255, 255, 191, 1, 232, 182, 64, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 138, 253, 11, 64, 255, 255, 255, 191, 0, 0, 0, 60, 255, 255, 255, 191, 127, 0, 0, 127, 255, 255, 255, 191, 0, 127, 0, 0, 255, 255, 255, 191, 16, 60, 75, 64, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 75, 100, 179, 64, 255, 255, 255, 191, 0, 0, 0, 60, 255, 255, 255, 191, 127, 0, 0, 127, 255, 255, 255, 191, 0, 127, 0, 0, 255, 255, 255, 191, 143, 253, 11, 192, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 190, 20, 152, 64, 255, 255, 255, 191, 0, 0, 0, 60, 255, 255, 255, 191, 127, 0, 0, 127, 255, 255, 255, 191, 0, 127, 0, 0, 255, 255, 255, 191, 188, 20, 152, 192, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 160, 187, 142, 63, 255, 255, 255, 191, 0, 0, 0, 60, 255, 255, 255, 191, 127, 0, 0, 127, 255, 255, 255, 191, 0, 127, 0, 0, 255, 255, 255, 191, 152, 61, 173, 192, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 183, 151, 132, 192, 255, 255, 255, 191, 0, 0, 0, 60, 255, 255, 255, 191, 127, 0, 0, 127, 255, 255, 255, 191, 0, 127, 0, 0, 255, 255, 255, 191, 51, 84, 146, 191, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 72, 233, 183, 192, 255, 255, 255, 191, 0, 0, 0, 60, 255, 255, 255, 191, 127, 0, 0, 127, 255, 255, 255, 191, 0, 127, 0, 0, 255, 255, 255, 191, 183, 151, 132, 64, 255, 255, 255, 191, 0, 0, 0, 0, 255, 255, 255, 191, 106, 132, 15, 192, 255, 255, 255, 191, 0, 0, 0, 60, 255, 255, 255, 191, 127, 0, 0, 127)
}]

[node name="Helicopter" node_paths=PackedStringArray("child_rotor") instance=ExtResource("1")]
[node name="Helicopter" node_paths=PackedStringArray("child_body_mesh", "child_rotor") instance=ExtResource("1")]
child_body_mesh = NodePath("main/Maxis-3d2-mesh-106")
child_rotor = NodePath("rotor")

[node name="Dust" parent="." index="1"]
Expand Down
Loading

0 comments on commit a259151

Please sign in to comment.