added more thoughts/notes
This commit is contained in:
@@ -34,12 +34,10 @@ func assign_jet_target(jet: Jet) -> void:
|
||||
func process_jet_plan(jet: Jet) -> void:
|
||||
if not is_instance_valid(jet.target): return
|
||||
|
||||
|
||||
var target_local_position: Vector3 = jet.to_local(jet.target.global_position)
|
||||
var target_direction: Vector3 = target_local_position.normalized()
|
||||
jet.target_ray.target_position = target_direction * 8
|
||||
|
||||
|
||||
if maxf(target_direction.z, 0.0) == 0.0:
|
||||
get_node("../../base_ui/target_position_fb").text = "infront"
|
||||
jet.controller.cpu.no_action()
|
||||
@@ -50,12 +48,13 @@ func process_jet_plan(jet: Jet) -> void:
|
||||
jet.controller.cpu.yaw_left()
|
||||
|
||||
elif maxf(target_direction.y, 0.5) == 0.5:
|
||||
get_node("../../base_ui/target_position_ab").text = "above"
|
||||
jet.controller.cpu.no_action()
|
||||
|
||||
if target_direction.y > 0.2:
|
||||
get_node("../../base_ui/target_position_ab").text = "above"
|
||||
jet.controller.cpu.pitch_up()
|
||||
elif target_direction.y < -0.2:
|
||||
get_node("../../base_ui/target_position_ab").text = "below"
|
||||
jet.controller.cpu.pitch_down()
|
||||
|
||||
elif maxf(target_direction.y, -0.5) == -0.5:
|
||||
@@ -87,7 +86,7 @@ func process_jet_plan(jet: Jet) -> void:
|
||||
|
||||
|
||||
# NOTE: (From GPT) Mostly works but with precession nor do I really understand it...
|
||||
#var forward_dot: float = target_direction.dot(Vector3.UP)
|
||||
#var forward_dot: float = target_direction.dot(Vector3.UP)
|
||||
#if forward_dot >= cos(deg_to_rad(37.5)):
|
||||
#get_node("../../base_ui/target_position_fb").text = "infront"
|
||||
#jet.controller.cpu.no_action()
|
||||
|
||||
Reference in New Issue
Block a user