瀏覽代碼

Fix implicit conversion from float to double then back to float again (#3799)

pull/3804/head
João Foscarini 1 年之前
committed by GitHub
父節點
當前提交
c251e9309e
沒有發現已知的金鑰在資料庫的簽署中 GPG 金鑰 ID: B5690EEEBB952194
共有 1 個檔案被更改,包括 3 行新增3 行删除
  1. +3
    -3
      src/raymath.h

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

@ -165,7 +165,7 @@ typedef struct float16 {
float v[16]; float v[16];
} float16; } float16;
#include <math.h> // Required for: sinf(), cosf(), tan(), atan2f(), sqrtf(), floor(), fminf(), fmaxf(), fabs() #include <math.h> // Required for: sinf(), cosf(), tan(), atan2f(), sqrtf(), floor(), fminf(), fmaxf(), fabsf()
//---------------------------------------------------------------------------------- //----------------------------------------------------------------------------------
// Module Functions Definition - Utils math // Module Functions Definition - Utils math
@ -605,12 +605,12 @@ RMAPI Vector3 Vector3Perpendicular(Vector3 v)
{ {
Vector3 result = { 0 }; Vector3 result = { 0 };
float min = p">(float) fabs(v.x); float min = n">fabsf(v.x);
Vector3 cardinalAxis = {1.0f, 0.0f, 0.0f}; Vector3 cardinalAxis = {1.0f, 0.0f, 0.0f};
if (fabsf(v.y) < min) if (fabsf(v.y) < min)
{ {
min = p">(float) fabs(v.y); min = n">fabsf(v.y);
Vector3 tmp = {0.0f, 1.0f, 0.0f}; Vector3 tmp = {0.0f, 1.0f, 0.0f};
cardinalAxis = tmp; cardinalAxis = tmp;
} }

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