diff options
Diffstat (limited to 'sdl/math3d.c')
-rw-r--r-- | sdl/math3d.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sdl/math3d.c b/sdl/math3d.c index b22c530..a808e34 100644 --- a/sdl/math3d.c +++ b/sdl/math3d.c @@ -1,6 +1,7 @@ -/* @2010 Kamil Kaminski +/* math3d.c + * + * Math 3D Library * - * math3d.c * */ @@ -27,7 +28,6 @@ void m3dFindNormalf(M3DVector3f result, const M3DVector3f point1, m3dCrossProductf(result, v1, v2); } - void m3dLoadIdentity33f(M3DMatrix33f m) { /* don't be fooled, this is still column major */ @@ -38,7 +38,6 @@ void m3dLoadIdentity33f(M3DMatrix33f m) memcpy(m, identity, sizeof(M3DMatrix33f)); } - void m3dLoadIdentity44f(M3DMatrix44f m) /* 4x4 float */ { /* don't be fooled, this is still column major */ @@ -271,3 +270,13 @@ int m3dInvertMatrix44f(M3DMatrix44f dst, const M3DMatrix44f m) return 0; } +unsigned int m3dPowerOfTwo(unsigned int n) +{ + unsigned int ret = 1; + + while (ret < n) + ret <<= 1; + + return ret; +} + |