transparent-cube

Minimal cross-platform native/wasm graphics example.
Log | Files | Refs | README | LICENSE

commit 1204f3ff1f97aab8090a3bab459e01503989325a
parent c6f2c90006a280ee4fff0f89bf234ba4276d3e9d
Author: Amin Mesbah <dev@aminmesbah.com>
Date:   Fri, 21 Jun 2019 18:38:40 -0700

Get rid of powf

lol

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