X-Git-Url: https://notaz.gp2x.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=source%2Fgles2n64%2Fsrc%2F3DMath.h;fp=source%2Fgles2n64%2Fsrc%2F3DMath.h;h=d639a97037f8763d0460c48374749391548621df;hb=34cf40586ac07c54d9bfc5be30f28743232b6d67;hp=0000000000000000000000000000000000000000;hpb=22726e4d55be26faa48b57b22689cbedde27ae44;p=mupen64plus-pandora.git diff --git a/source/gles2n64/src/3DMath.h b/source/gles2n64/src/3DMath.h new file mode 100644 index 0000000..d639a97 --- /dev/null +++ b/source/gles2n64/src/3DMath.h @@ -0,0 +1,45 @@ +#ifndef _3DMATH_H +#define _3DMATH_H + +#include + +extern void (*MultMatrix)(float m0[4][4], float m1[4][4], float dest[4][4]); +extern void (*TransformVectorNormalize)(float vec[3], float mtx[4][4]); +extern void (*Normalize)(float v[3]); +extern float (*DotProduct)(float v0[3], float v1[3]); + +inline void CopyMatrix( float m0[4][4], float m1[4][4] ) +{ + memcpy( m0, m1, 16 * sizeof( float ) ); +} + +inline void MultMatrix2( float m0[4][4], float m1[4][4] ) +{ + float dst[4][4]; + MultMatrix(m0, m1, dst); + memcpy( m0, dst, sizeof(float) * 16 ); +} + +inline void Transpose3x3Matrix( float mtx[4][4] ) +{ + float tmp; + + tmp = mtx[0][1]; + mtx[0][1] = mtx[1][0]; + mtx[1][0] = tmp; + + tmp = mtx[0][2]; + mtx[0][2] = mtx[2][0]; + mtx[2][0] = tmp; + + tmp = mtx[1][2]; + mtx[1][2] = mtx[2][1]; + mtx[2][1] = tmp; +} + +#ifdef __NEON_OPT +void MathInitNeon(); +#endif + +#endif +