Display numeric values on PFD
This commit is contained in:
parent
740a72bcb6
commit
8e3b2934f3
1 changed files with 12 additions and 4 deletions
|
|
@ -25,10 +25,6 @@ extends Node2D
|
|||
set(value):
|
||||
altitude = value
|
||||
var step = 1
|
||||
if value > 49.5:
|
||||
step = 5
|
||||
if value > 99.5:
|
||||
step = 10
|
||||
altitude_label.text = str(int(step * round(value / step)))
|
||||
|
||||
@export var climbrate: float = 1000:
|
||||
|
|
@ -48,3 +44,15 @@ extends Node2D
|
|||
func update(aircraft: Transform3D, velocity: Vector3):
|
||||
var godot_euler = aircraft.basis.get_euler()
|
||||
euler_attitude_deg = Vector3(godot_euler.z, -godot_euler.x, -godot_euler.y) * rad_to_deg(1)
|
||||
|
||||
const mps_to_kt = 1.94384
|
||||
var v_local = aircraft.basis.inverse() * velocity
|
||||
airspeed = max(0, v_local.z) * mps_to_kt
|
||||
var v_horizontal = Vector3(velocity.x, 0, velocity.z)
|
||||
groundspeed = v_horizontal.length() * mps_to_kt
|
||||
|
||||
const mps_to_fpm = 196.848
|
||||
climbrate = velocity.y * mps_to_fpm
|
||||
|
||||
const m_to_ft = 3.2808
|
||||
altitude = aircraft.origin.y * m_to_ft
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue