瀏覽代碼

Fix inverse length in Vector2Normalize (#2189)

Following the pattern in Vector3Normalize.
pull/2194/head
HarriP 3 年之前
committed by GitHub
父節點
當前提交
3cb4ef2599
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: 4AEE18F83AFDEB23
共有 1 個檔案被更改,包括 3 行新增2 行删除
  1. +3
    -2
      src/raymath.h

+ 3
- 2
src/raymath.h 查看文件

@ -328,8 +328,9 @@ RMAPI Vector2 Vector2Normalize(Vector2 v)
if (length > 0) if (length > 0)
{ {
result.x = v.x*1.0f/length; float ilength = 1.0f / length;
result.y = v.y*1.0f/length; result.x = v.x * ilength;
result.y = v.y * ilength;
} }
return result; return result;

||||||
x
 
000:0
Loading…
取消
儲存