This commit is contained in:
Бранимир Караџић
2019-01-04 21:24:29 -08:00
parent 7f47a08b3c
commit 4cd54629df
3 changed files with 2 additions and 52 deletions

View File

@@ -975,48 +975,6 @@ namespace bx
_result[15] = _a[15];
}
/// Convert LH to RH projection matrix and vice versa.
inline void mtxProjFlipHandedness(float* _dst, const float* _src)
{
_dst[ 0] = -_src[ 0];
_dst[ 1] = -_src[ 1];
_dst[ 2] = -_src[ 2];
_dst[ 3] = -_src[ 3];
_dst[ 4] = _src[ 4];
_dst[ 5] = _src[ 5];
_dst[ 6] = _src[ 6];
_dst[ 7] = _src[ 7];
_dst[ 8] = -_src[ 8];
_dst[ 9] = -_src[ 9];
_dst[10] = -_src[10];
_dst[11] = -_src[11];
_dst[12] = _src[12];
_dst[13] = _src[13];
_dst[14] = _src[14];
_dst[15] = _src[15];
}
/// Convert LH to RH view matrix and vice versa.
inline void mtxViewFlipHandedness(float* _dst, const float* _src)
{
_dst[ 0] = -_src[ 0];
_dst[ 1] = _src[ 1];
_dst[ 2] = -_src[ 2];
_dst[ 3] = _src[ 3];
_dst[ 4] = -_src[ 4];
_dst[ 5] = _src[ 5];
_dst[ 6] = -_src[ 6];
_dst[ 7] = _src[ 7];
_dst[ 8] = -_src[ 8];
_dst[ 9] = _src[ 9];
_dst[10] = -_src[10];
_dst[11] = _src[11];
_dst[12] = -_src[12];
_dst[13] = _src[13];
_dst[14] = -_src[14];
_dst[15] = _src[15];
}
inline bx::Vec3 calcNormal(const bx::Vec3& _va, const bx::Vec3& _vb, const bx::Vec3& _vc)
{
const bx::Vec3 ba = sub(_vb, _va);

View File

@@ -482,14 +482,6 @@ namespace bx
///
void mtxInverse(float* _result, const float* _a);
/// Convert LH to RH projection matrix and vice versa.
///
void mtxProjFlipHandedness(float* _dst, const float* _src);
/// Convert LH to RH view matrix and vice versa.
///
void mtxViewFlipHandedness(float* _dst, const float* _src);
///
bx::Vec3 calcNormal(const bx::Vec3& _va, const bx::Vec3& _vb, const bx::Vec3& _vc);

View File

@@ -333,7 +333,7 @@ namespace bx
_result[14] = -bb;
}
void mtxProjInfImpl(float* _result, float _ut, float _dt, float _lt, float _rt, float _near, bool _oglNdc, Handness::Enum _handness, NearFar::Enum _nearFar)
void mtxProjInf(float* _result, float _ut, float _dt, float _lt, float _rt, float _near, bool _oglNdc, Handness::Enum _handness, NearFar::Enum _nearFar)
{
const float invDiffRl = 1.0f/(_rt - _lt);
const float invDiffUd = 1.0f/(_ut - _dt);
@@ -346,7 +346,7 @@ namespace bx
void mtxProjInf(float* _result, const float _fov[4], float _near, bool _oglNdc, Handness::Enum _handness, NearFar::Enum _nearFar)
{
mtxProjInfImpl(_result, _fov[0], _fov[1], _fov[2], _fov[3], _near, _oglNdc, _handness, _nearFar);
mtxProjInf(_result, _fov[0], _fov[1], _fov[2], _fov[3], _near, _oglNdc, _handness, _nearFar);
}
void mtxProjInf(float* _result, float _fovy, float _aspect, float _near, bool _oglNdc, Handness::Enum _handness, NearFar::Enum _nearFar)