ソースを参照

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)
{
result.x = v.x*1.0f/length;
result.y = v.y*1.0f/length;
float ilength = 1.0f / length;
result.x = v.x * ilength;
result.y = v.y * ilength;
}
return result;

読み込み中…
キャンセル
保存