added more thoughts/notes
This commit is contained in:
+23
-24
@@ -23,7 +23,7 @@ var direction = (jet.target.global_position - jet.global_position).normalized()
|
|||||||
Can we normalize rotation and from that treat slices of the circle as specific command zones?
|
Can we normalize rotation and from that treat slices of the circle as specific command zones?
|
||||||
I.E if target a jet in front and and to the right by 45 degrees we yaw instead of roll?
|
I.E if target a jet in front and and to the right by 45 degrees we yaw instead of roll?
|
||||||
|
|
||||||
Imagine the current situation is us observing our CPU controlled jet from
|
Imagining the current situation is us observing our CPU controlled jet from
|
||||||
the 3rd person view from behind. The jet is level to the horizon of our world.
|
the 3rd person view from behind. The jet is level to the horizon of our world.
|
||||||
The target jet position is behind and slightly to the right corner of the screen.
|
The target jet position is behind and slightly to the right corner of the screen.
|
||||||
____________________________________________
|
____________________________________________
|
||||||
@@ -37,6 +37,28 @@ ____________________________________________
|
|||||||
| X |
|
| X |
|
||||||
____________________________________________
|
____________________________________________
|
||||||
|
|
||||||
|
-- SOHCAHTOA
|
||||||
|
|
||||||
|
-- sin = Opposite/Hypotenuse
|
||||||
|
-- cos = Adjacent/Hypotenuse
|
||||||
|
-- tan = Opposite/Adjacent
|
||||||
|
|
||||||
|
Maybe aha moment, if I create a right angled triangles per plane then we can figure out radians from the aquired angles.
|
||||||
|
=O ^
|
||||||
|
|
||||||
|
We already have a hypotenuse value based on the 'distance'.
|
||||||
|
We have the target position and our position.
|
||||||
|
Thus, if certain target values are above or below we use one or the other to gague the 90 degree angle point
|
||||||
|
|
||||||
|
let x1 = 5;
|
||||||
|
let y1 = 5;
|
||||||
|
let rotation = 8; // in degrees
|
||||||
|
let magnitude = 7; // our distance
|
||||||
|
// got bellow from AI during 500 lines challenge; not sure what this is doing just yet
|
||||||
|
let radians = (rotation + 180) % 360;
|
||||||
|
const x2 = x1 + magnitude * Math.cos(radians);
|
||||||
|
const y2 = y1 + magnitude * Math.sin(radians);
|
||||||
|
|
||||||
We must roll the jet to +90 degrees left or -90 right and then pitch up
|
We must roll the jet to +90 degrees left or -90 right and then pitch up
|
||||||
in order to turn towards target. OR yaw left or right to turn.
|
in order to turn towards target. OR yaw left or right to turn.
|
||||||
What conditions should we use to determin which to use? Distance from and to?
|
What conditions should we use to determin which to use? Distance from and to?
|
||||||
@@ -47,29 +69,6 @@ how do we confirm what set of actions to do/maintain? A queue and check over tim
|
|||||||
Can we able to get the 'delta' in cpu_controller utside of '_process'/'_physics_process'?
|
Can we able to get the 'delta' in cpu_controller utside of '_process'/'_physics_process'?
|
||||||
|
|
||||||
If queue do we push "rotate towards using xyz pattern" as a command/state to check until met?
|
If queue do we push "rotate towards using xyz pattern" as a command/state to check until met?
|
||||||
|
|
||||||
|
|
||||||
If in rotate towards
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 80 KiB |
@@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://fde2fvqtfias"
|
||||||
|
path="res://.godot/imported/scrshot_2026-10-31 22:01:23.png-ea38935c18fe54a50229a4759efcb462.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://Notes/scrshot_2026-10-31 22:01:23.png"
|
||||||
|
dest_files=["res://.godot/imported/scrshot_2026-10-31 22:01:23.png-ea38935c18fe54a50229a4759efcb462.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 51 KiB |
@@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://cvebpk7j4sxn3"
|
||||||
|
path="res://.godot/imported/scrshot_2026-11-01 15:59:01.png-b49b72cbc21cd7f23ef317b486d9800f.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://Notes/scrshot_2026-11-01 15:59:01.png"
|
||||||
|
dest_files=["res://.godot/imported/scrshot_2026-11-01 15:59:01.png-b49b72cbc21cd7f23ef317b486d9800f.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
@@ -0,0 +1,40 @@
|
|||||||
|
[remap]
|
||||||
|
|
||||||
|
importer="texture"
|
||||||
|
type="CompressedTexture2D"
|
||||||
|
uid="uid://k31f0oydc2bl"
|
||||||
|
path="res://.godot/imported/scrshot_2026-11-01 16:08:02.png-1731f74adb3e861c17e68b31c0ea9978.ctex"
|
||||||
|
metadata={
|
||||||
|
"vram_texture": false
|
||||||
|
}
|
||||||
|
|
||||||
|
[deps]
|
||||||
|
|
||||||
|
source_file="res://Notes/scrshot_2026-11-01 16:08:02.png"
|
||||||
|
dest_files=["res://.godot/imported/scrshot_2026-11-01 16:08:02.png-1731f74adb3e861c17e68b31c0ea9978.ctex"]
|
||||||
|
|
||||||
|
[params]
|
||||||
|
|
||||||
|
compress/mode=0
|
||||||
|
compress/high_quality=false
|
||||||
|
compress/lossy_quality=0.7
|
||||||
|
compress/uastc_level=0
|
||||||
|
compress/rdo_quality_loss=0.0
|
||||||
|
compress/hdr_compression=1
|
||||||
|
compress/normal_map=0
|
||||||
|
compress/channel_pack=0
|
||||||
|
mipmaps/generate=false
|
||||||
|
mipmaps/limit=-1
|
||||||
|
roughness/mode=0
|
||||||
|
roughness/src_normal=""
|
||||||
|
process/channel_remap/red=0
|
||||||
|
process/channel_remap/green=1
|
||||||
|
process/channel_remap/blue=2
|
||||||
|
process/channel_remap/alpha=3
|
||||||
|
process/fix_alpha_border=true
|
||||||
|
process/premult_alpha=false
|
||||||
|
process/normal_map_invert_y=false
|
||||||
|
process/hdr_as_srgb=false
|
||||||
|
process/hdr_clamp_exposure=false
|
||||||
|
process/size_limit=0
|
||||||
|
detect_3d/compress_to=1
|
||||||
@@ -34,12 +34,10 @@ func assign_jet_target(jet: Jet) -> void:
|
|||||||
func process_jet_plan(jet: Jet) -> void:
|
func process_jet_plan(jet: Jet) -> void:
|
||||||
if not is_instance_valid(jet.target): return
|
if not is_instance_valid(jet.target): return
|
||||||
|
|
||||||
|
|
||||||
var target_local_position: Vector3 = jet.to_local(jet.target.global_position)
|
var target_local_position: Vector3 = jet.to_local(jet.target.global_position)
|
||||||
var target_direction: Vector3 = target_local_position.normalized()
|
var target_direction: Vector3 = target_local_position.normalized()
|
||||||
jet.target_ray.target_position = target_direction * 8
|
jet.target_ray.target_position = target_direction * 8
|
||||||
|
|
||||||
|
|
||||||
if maxf(target_direction.z, 0.0) == 0.0:
|
if maxf(target_direction.z, 0.0) == 0.0:
|
||||||
get_node("../../base_ui/target_position_fb").text = "infront"
|
get_node("../../base_ui/target_position_fb").text = "infront"
|
||||||
jet.controller.cpu.no_action()
|
jet.controller.cpu.no_action()
|
||||||
@@ -50,12 +48,13 @@ func process_jet_plan(jet: Jet) -> void:
|
|||||||
jet.controller.cpu.yaw_left()
|
jet.controller.cpu.yaw_left()
|
||||||
|
|
||||||
elif maxf(target_direction.y, 0.5) == 0.5:
|
elif maxf(target_direction.y, 0.5) == 0.5:
|
||||||
get_node("../../base_ui/target_position_ab").text = "above"
|
|
||||||
jet.controller.cpu.no_action()
|
jet.controller.cpu.no_action()
|
||||||
|
|
||||||
if target_direction.y > 0.2:
|
if target_direction.y > 0.2:
|
||||||
|
get_node("../../base_ui/target_position_ab").text = "above"
|
||||||
jet.controller.cpu.pitch_up()
|
jet.controller.cpu.pitch_up()
|
||||||
elif target_direction.y < -0.2:
|
elif target_direction.y < -0.2:
|
||||||
|
get_node("../../base_ui/target_position_ab").text = "below"
|
||||||
jet.controller.cpu.pitch_down()
|
jet.controller.cpu.pitch_down()
|
||||||
|
|
||||||
elif maxf(target_direction.y, -0.5) == -0.5:
|
elif maxf(target_direction.y, -0.5) == -0.5:
|
||||||
|
|||||||
Reference in New Issue
Block a user