Prechádzať zdrojové kódy

:wrench: Add command monitors

DricomDragon 4 dní pred
rodič
commit
61657acf68

+ 18 - 0
godot/component/entity/vehicles/biplan/biplan.gd

@@ -15,9 +15,27 @@ var target_pitch: float = 0.0
 var target_rotation := Vector3.ZERO
 var target_thrust := Vector3.ZERO
 
+# Physics logs
+var last_forward_velocity: float = 0.0
+var last_slide_velocity: float = 0.0
+var last_lift: float = 0.0
+var last_wing_resistance: float = 0.0
+var last_foil_resistance: float = 0.0
+
 @onready var VerticalFoil : Node3D = $VerticalFoil
 
 
+func _register_custom_monitors() -> void:
+	Performance.add_custom_monitor("plane/torque", func(): return abs(target_torque))
+	Performance.add_custom_monitor("plane/pitch", func(): return abs(target_pitch))
+	Performance.add_custom_monitor("plane/rotation", func(): return target_rotation.length())
+	Performance.add_custom_monitor("plane/thrust", func(): return target_thrust.length())
+
+
+func _ready() -> void:
+	_register_custom_monitors()
+
+
 func trigger_thrust(activate: bool) -> void:
 	if activate:
 		target_thrust = PLANE_FORWARD * thrust_power