Skip to content

Commit

Permalink
ensure distance is greater than 0 in CameraMoveToTarget (#3031)
Browse files Browse the repository at this point in the history
  • Loading branch information
kolunmi authored Apr 27, 2023
1 parent e2996f1 commit 98cb7a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/rcamera.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ void CameraMoveToTarget(Camera *camera, float delta)
distance += delta;

// Distance must be greater than 0
if (distance < 0) distance = 0.001f;
if (distance <= 0) distance = 0.001f;

// Set new distance by moving the position along the forward vector
Vector3 forward = GetCameraForward(camera);
Expand Down

0 comments on commit 98cb7a1

Please sign in to comment.