diff --git a/include/bx/inline/math.inl b/include/bx/inline/math.inl index 3b39d79..1016c83 100644 --- a/include/bx/inline/math.inl +++ b/include/bx/inline/math.inl @@ -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) diff --git a/include/bx/math.h b/include/bx/math.h index 17d68c0..4d9fce3 100644 --- a/include/bx/math.h +++ b/include/bx/math.h @@ -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);