mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-28 18:45:54 -05:00
Moved matrix functions to math.h
This commit is contained in:
parent
4a2bfcfbeb
commit
fc9dc6a3cd
2 changed files with 17 additions and 18 deletions
|
@ -19,24 +19,6 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
inline void mtxTranslate(float* _result, float x, float y, float z)
|
||||
{
|
||||
memset(_result, 0, sizeof(float) * 16);
|
||||
_result[0] = _result[5] = _result[10] = _result[15] = 1.0f;
|
||||
_result[12] = x;
|
||||
_result[13] = y;
|
||||
_result[14] = z;
|
||||
}
|
||||
|
||||
inline void mtxScale(float* _result, float x, float y, float z)
|
||||
{
|
||||
memset(_result, 0, sizeof(float) * 16);
|
||||
_result[0] = x;
|
||||
_result[5] = y;
|
||||
_result[10] = z;
|
||||
_result[15] = 1.0f;
|
||||
}
|
||||
|
||||
long int fsize(FILE* _file)
|
||||
{
|
||||
long int pos = ftell(_file);
|
||||
|
|
|
@ -81,6 +81,23 @@ inline void mtxIdentity(float* _result)
|
|||
_result[0] = _result[5] = _result[10] = _result[15] = 1.0f;
|
||||
}
|
||||
|
||||
inline void mtxTranslate(float* _result, float _x, float _y, float _z)
|
||||
{
|
||||
mtxIdentity(_result);
|
||||
_result[12] = _x;
|
||||
_result[13] = _y;
|
||||
_result[14] = _z;
|
||||
}
|
||||
|
||||
inline void mtxScale(float* _result, float _x, float _y, float _z)
|
||||
{
|
||||
memset(_result, 0, sizeof(float) * 16);
|
||||
_result[0] = _x;
|
||||
_result[5] = _y;
|
||||
_result[10] = _z;
|
||||
_result[15] = 1.0f;
|
||||
}
|
||||
|
||||
inline void mtxLookAt(float* __restrict _result, const float* __restrict _eye, const float* __restrict _at)
|
||||
{
|
||||
float tmp[4];
|
||||
|
|
Loading…
Reference in a new issue