Add transactional RV decor synchronization

This commit is contained in:
Alexander Sellite 2026-08-31 05:48:36 -04:00
parent ee992d9f0c
commit 6578d3e870
7 changed files with 663 additions and 48 deletions

View file

@ -2093,6 +2093,37 @@ func reset_network_movement_state() -> void:
_local_prediction_largest_error = 0.0
func apply_network_space_transition(
target_transform: Transform3D,
align_local_camera: bool,
) -> void:
if not target_transform.origin.is_finite():
return
# A room transition is a discontinuity, not ordinary movement. Preserve the
# host's input acknowledgement while clearing every motion, animation, and
# reconciliation state that could pull the avatar toward the previous space.
var acknowledged_input: int = _last_network_input_sequence
reset_network_movement_state()
_last_network_input_sequence = acknowledged_input
_apply_network_casting(false)
velocity = Vector3.ZERO
global_transform = Transform3D(Basis.IDENTITY, target_transform.origin)
var target_yaw: float = target_transform.basis.get_euler().y
_visuals.rotation.y = target_yaw
_network_camera_yaw = target_yaw
_network_target_position = global_position
_network_target_velocity = Vector3.ZERO
_network_target_visual_yaw = target_yaw
_network_snapshot_age = 0.0
_network_snapshot_ready = true
_authoritative_movement_history.clear()
if align_local_camera:
_set_camera_dragging(false)
if _free_camera_active:
_set_free_camera_active(false)
_camera_yaw.rotation.y = target_yaw
func capture_network_input(sequence: int) -> Dictionary:
if _sitting_intent_pending and _sitting_intent_sequence < 0:
_sitting_intent_sequence = sequence