소스 검색

Add wrap (#2522)

* add wrap function

* fixed Wrap function wrapping wrong
pull/2524/head
Pijus 3 년 전
committed by GitHub
부모
커밋
c392f0c16b
No known key found for this signature in database 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(), floor(), 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 = value - (max - min)*floor((value - min)/(max - min));
return result;
}
// Check whether two given floats are almost equal
RMAPI int FloatEquals(float x, float y)
{

불러오는 중...
취소
저장