Skip to content

CameraExtensions.FollowSmooth(this ICamera, Vector2, float, float) Method

Definition

Namespace: Brine2D.Rendering

Smoothly moves the camera towards a target position using exponential decay.

public static void FollowSmooth(this Brine2D.Rendering.ICamera camera, System.Numerics.Vector2 targetPosition, float smoothing, float deltaTime);

Parameters

camera ICamera

The camera to move.

targetPosition System.Numerics.Vector2

Target world position.

smoothing System.Single

Smoothing factor. Higher = snappier. ≤ 0 = instant snap.

deltaTime System.Single

Time since last frame in seconds.