feat: implement weapon manager with viewmodel viewport, procedural arms, and loadout synchronization

This commit is contained in:
DottsGit
2026-06-09 22:47:27 -04:00
parent cff83b6356
commit 86abae27dd
+5 -5
View File
@@ -94,10 +94,10 @@ func _process(_delta: float) -> void:
# Airborne Drift
# Convert player velocity into camera's local space
var local_vel = camera.global_transform.basis.inverse() * player.velocity
_target_drift_offset = Vector3(local_vel.x * 0.01, local_vel.y * 0.01, 0)
_target_drift_offset = Vector3(local_vel.x * 0.004, local_vel.y * 0.004, 0)
# Clamp the drift
_target_drift_offset.x = clampf(_target_drift_offset.x, -0.1, 0.1)
_target_drift_offset.y = clampf(_target_drift_offset.y, -0.1, 0.1)
_target_drift_offset.x = clampf(_target_drift_offset.x, -0.05, 0.05)
_target_drift_offset.y = clampf(_target_drift_offset.y, -0.05, 0.05)
else:
_target_drift_offset = Vector3.ZERO
@@ -105,8 +105,8 @@ func _process(_delta: float) -> void:
_current_drift_offset = _current_drift_offset.lerp(_target_drift_offset, 15.0 * _delta)
vm_camera.translate_object_local(_current_drift_offset)
vm_camera.rotate_object_local(Vector3.UP, deg_to_rad(-_current_drift_offset.x * 50.0))
vm_camera.rotate_object_local(Vector3.RIGHT, deg_to_rad(_current_drift_offset.y * 50.0))
vm_camera.rotate_object_local(Vector3.UP, deg_to_rad(-_current_drift_offset.x * 30.0))
vm_camera.rotate_object_local(Vector3.RIGHT, deg_to_rad(_current_drift_offset.y * 30.0))
# Visual Recoil
_recoil_pitch = lerpf(_recoil_pitch, 0.0, 15.0 * _delta)