mirror of
https://github.com/Facepunch/sbox-public.git
synced 2025-12-23 22:48:07 -05:00
fix editor camera sticking in place at very low speeds (#3654)
Co-authored-by: boxrocket <splatterbiker@gmail.com>
This commit is contained in:
@@ -226,8 +226,9 @@ public static class SceneEditorExtensions
|
||||
camera.WorldPosition = Vector3.SmoothDamp( camera.WorldPosition, cameraTarget.Value, ref vel, EditorPreferences.CameraMovementSmoothing.Clamp( 0.0f, 1.0f ), RealTime.Delta );
|
||||
cameraVelocity = vel;
|
||||
|
||||
if ( camera.WorldPosition.AlmostEqual( cameraTarget.Value, 0.1f ) )
|
||||
if ( camera.WorldPosition.AlmostEqual( cameraTarget.Value, 0.01f ) )
|
||||
{
|
||||
camera.WorldPosition = cameraTarget.Value;
|
||||
cameraTarget = default;
|
||||
cameraVelocity = default;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user