mirror of
https://github.com/glfw/glfw.git
synced 2024-11-11 04:53:50 +00:00
Fix implicit double-to-float in linmath.h
This commit is contained in:
parent
33cd8b865d
commit
9416a43404
16
deps/linmath.h
vendored
16
deps/linmath.h
vendored
@ -5,6 +5,10 @@
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
|
||||
/* 2021-03-21 Camilla Löwy <elmindreda@elmindreda.org>
|
||||
* - Replaced double constants with float equivalents
|
||||
*/
|
||||
|
||||
#ifdef LINMATH_NO_INLINE
|
||||
#define LINMATH_H_FUNC static
|
||||
#else
|
||||
@ -575,17 +579,17 @@ LINMATH_H_FUNC void mat4x4_arcball(mat4x4 R, mat4x4 const M, vec2 const _a, vec2
|
||||
vec2 a; memcpy(a, _a, sizeof(a));
|
||||
vec2 b; memcpy(b, _b, sizeof(b));
|
||||
|
||||
float z_a = 0.;
|
||||
float z_b = 0.;
|
||||
float z_a = 0.f;
|
||||
float z_b = 0.f;
|
||||
|
||||
if(vec2_len(a) < 1.) {
|
||||
z_a = sqrtf(1. - vec2_mul_inner(a, a));
|
||||
if(vec2_len(a) < 1.f) {
|
||||
z_a = sqrtf(1.f - vec2_mul_inner(a, a));
|
||||
} else {
|
||||
vec2_norm(a, a);
|
||||
}
|
||||
|
||||
if(vec2_len(b) < 1.) {
|
||||
z_b = sqrtf(1. - vec2_mul_inner(b, b));
|
||||
if(vec2_len(b) < 1.f) {
|
||||
z_b = sqrtf(1.f - vec2_mul_inner(b, b));
|
||||
} else {
|
||||
vec2_norm(b, b);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user