This commit is contained in:
Бранимир Караџић
2021-10-14 21:03:47 -07:00
parent 6c189a717a
commit ce8f0ec49b
2 changed files with 12 additions and 2 deletions

View File

@@ -1272,11 +1272,18 @@ namespace bx
_outPlane.dist = -dot(_normal, _pos);
}
inline float distance(const Plane& _plane, const Vec3& _pos)
inline BX_CONSTEXPR_FUNC float distance(const Plane& _plane, const Vec3& _pos)
{
return dot(_plane.normal, _pos) + _plane.dist;
}
inline BX_CONSTEXPR_FUNC bool isEqual(const Plane& _a, const Plane& _b, float _epsilon)
{
return isEqual(_a.normal, _b.normal, _epsilon)
&& isEqual(_a.dist, _b.dist, _epsilon)
;
}
inline BX_CONST_FUNC float toLinear(float _a)
{
const float lo = _a / 12.92f;

View File

@@ -723,7 +723,10 @@ namespace bx
void calcPlane(Plane& _outPlane, const Vec3& _normal, const Vec3& _pos);
///
float distance(const Plane& _plane, const Vec3& _pos);
BX_CONSTEXPR_FUNC float distance(const Plane& _plane, const Vec3& _pos);
///
BX_CONSTEXPR_FUNC bool isEqual(const Plane& _a, const Plane& _b, float _epsilon);
///
void calcLinearFit2D(float _result[2], const void* _points, uint32_t _stride, uint32_t _numPoints);