Added calcPlane from normal and position.:

This commit is contained in:
Branimir Karadžić
2018-11-06 20:06:12 -08:00
parent aa22b32927
commit 72de73f025
2 changed files with 11 additions and 4 deletions

View File

@@ -936,11 +936,15 @@ namespace bx
{
float normal[3];
calcNormal(normal, _va, _vb, _vc);
calcPlane(_result, normal, _va);
}
_result[0] = normal[0];
_result[1] = normal[1];
_result[2] = normal[2];
_result[3] = -vec3Dot(normal, _va);
inline void calcPlane(float _result[4], const float _normal[3], const float _pos[3])
{
_result[0] = _normal[0];
_result[1] = _normal[1];
_result[2] = _normal[2];
_result[3] = -vec3Dot(_normal, _pos);
}
inline BX_CONST_FUNC float toLinear(float _a)

View File

@@ -555,6 +555,9 @@ namespace bx
///
void calcPlane(float _result[4], const float _va[3], const float _vb[3], const float _vc[3]);
///
void calcPlane(float _result[4], const float _normal[3], const float _pos[3]);
///
void calcLinearFit2D(float _result[2], const void* _points, uint32_t _stride, uint32_t _numPoints);