This commit is contained in:
Chris Bell 2024-12-19 20:25:54 -06:00
parent 2b5935feae
commit fa7c562bb5

View File

@ -75,13 +75,17 @@ func _predict_movement(_delta):
# Simple linear prediction
var predicted_velocity = linear_velocity
predicted_position += predicted_velocity * _delta
# Basic rotation prediction (can be improved)
var predicted_angular_velocity = angular_velocity
var predicted_rotation_delta = Quaternion()
predicted_rotation_delta.set_axis_angle(predicted_angular_velocity, _delta)
if angular_velocity.length() > 0:
var predicted_angular_velocity = angular_velocity.normalized()
var predicted_rotation_delta = Quaternion(predicted_angular_velocity, _delta)
predicted_rotation = predicted_rotation * predicted_rotation_delta
func _apply_local_input(_delta):
if piloting_player == null or not piloting_player.is_network_authority:
return
var turn_speed = base_turn_speed / max(mass, 1)
var lift_speed = base_lift_speed / max(mass, 1)