ソースを参照

add wrap function (#2521)

pull/2524/head
Pijus 3年前
committed by GitHub
コミット
81157e4e72
この署名に対応する既知のキーがデータベースに存在しません GPGキーID: 4AEE18F83AFDEB23
1個のファイルの変更9行の追加1行の削除
  1. +9
    -1
      src/raymath.h

+ 9
- 1
src/raymath.h ファイルの表示

@ -158,7 +158,7 @@ typedef struct float16 {
float v[16];
} float16;
#include <math.h> // Required for: sinf(), cosf(), tan(), atan2f(), sqrtf(), fminf(), fmaxf(), fabs()
#include <math.h> // Required for: sinf(), cosf(), tan(), atan2f(), sqrtf(), fmodf(), fminf(), fmaxf(), fabs()
//----------------------------------------------------------------------------------
// Module Functions Definition - Utils math
@ -198,6 +198,14 @@ RMAPI float Remap(float value, float inputStart, float inputEnd, float outputSta
return result;
}
// Wrap input value from min to max
RMAPI float Wrap(float value, float min, float max)
{
float result = min + fmodf(value - min, max - min);
return result;
}
// Check whether two given floats are almost equal
RMAPI int FloatEquals(float x, float y)
{

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