transparent-cube

Minimal cross-platform native/wasm graphics example.
git clone git://git.amin.space/transparent-cube.git
Log | Files | Refs | README | LICENSE

commit f9ef678d8a6d660b42c5b863c4c070b5b737ae97
parent 1b0b3c87b211bf9c1f5f7262f8bb280feb18be5f
Author: amin <dev@aminmesbah.com>
Date:   Sat, 22 Jun 2019 01:38:39 +0000

Get rid of powf

lol

FossilOrigin-Name: f2b95a5a6ee11e0e6a32e29ef4bc4a35e19bcf7d4b362875f5f43ea96666090b
Diffstat:
Msrc/game.c | 1-
Msrc/glmth.c | 6+++---
Msrc/glmth.h | 3++-
3 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/game.c b/src/game.c @@ -1,7 +1,6 @@ #include "game.h" #include <assert.h> -#include <math.h> // TODO: remove references to emscripten #ifdef __EMSCRIPTEN__ diff --git a/src/glmth.c b/src/glmth.c @@ -275,17 +275,17 @@ m4 glmth_rotate(m4 m, f32 rad, v3 axis) m4 r = glmth_m4_init_id(); - r.E[0][0] = c + (powf(axis.x, 2.0f) * (1 - c)); + r.E[0][0] = c + ((axis.x * axis.x) * (1 - c)); r.E[0][1] = (axis.x * axis.y * (1 - c)) - (axis.z * s); r.E[0][2] = (axis.x * axis.z * (1 - c)) + (axis.y * s); r.E[1][0] = (axis.y * axis.x * (1 - c)) + (axis.z * s); - r.E[1][1] = c + (powf(axis.y, 2.0f) * (1 - c)); + r.E[1][1] = c + ((axis.y * axis.y) * (1 - c)); r.E[1][2] = (axis.y * axis.z * (1 - c)) - (axis.x * s); r.E[2][0] = (axis.z * axis.x * (1 - c)) - (axis.y * s); r.E[2][1] = (axis.z * axis.y * (1 - c)) + (axis.x * s); - r.E[2][2] = c + (powf(axis.z, 2.0f) * (1 - c)); + r.E[2][2] = c + ((axis.z * axis.z) * (1 - c)); return glmth_m4m4_m(m, r); } diff --git a/src/glmth.h b/src/glmth.h @@ -2,10 +2,11 @@ #define GLMTH_H #include <assert.h> -#include <math.h> #include <stdbool.h> #include <stdint.h> +#include <math.h> + #ifndef M_PI #define M_PI 3.14159265359f #endif