Browse Source

Math: mention planeEquation() in Frustum docs and vice versa.

pull/362/head
Vladimír Vondruš 7 years ago
parent
commit
ad291c2afe
  1. 8
      src/Magnum/Math/Frustum.h
  2. 2
      src/Magnum/Math/Vector4.h

8
src/Magnum/Math/Frustum.h

@ -87,7 +87,13 @@ template<class T> class Frustum {
/** @brief Construct a frustum without initializing the contents */ /** @brief Construct a frustum without initializing the contents */
explicit Frustum(NoInitT) noexcept: _data{Vector4<T>{NoInit}, Vector4<T>{NoInit}, Vector4<T>{NoInit}, Vector4<T>{NoInit}, Vector4<T>{NoInit}, Vector4<T>{NoInit}} {} explicit Frustum(NoInitT) noexcept: _data{Vector4<T>{NoInit}, Vector4<T>{NoInit}, Vector4<T>{NoInit}, Vector4<T>{NoInit}, Vector4<T>{NoInit}, Vector4<T>{NoInit}} {}
/** @brief Construct a frustum from plane equations */ /**
* @brief Construct a frustum from plane equations
*
* The equations are in a form @f$ ax + by + cz + d = 0 @f$. You can
* use @ref planeEquation() to calculate the coefficients from a normal
* and a point.
*/
constexpr /*implicit*/ Frustum(const Vector4<T>& left, const Vector4<T>& right, const Vector4<T>& bottom, const Vector4<T>& top, const Vector4<T>& near, const Vector4<T>& far) noexcept: _data{left, right, bottom, top, near, far} {} constexpr /*implicit*/ Frustum(const Vector4<T>& left, const Vector4<T>& right, const Vector4<T>& bottom, const Vector4<T>& top, const Vector4<T>& near, const Vector4<T>& far) noexcept: _data{left, right, bottom, top, near, far} {}
/** /**

2
src/Magnum/Math/Vector4.h

@ -245,7 +245,7 @@ using a dot product with the normal @f$ \boldsymbol{n} @f$ using the point
d = - \boldsymbol{n} \cdot \boldsymbol{p} d = - \boldsymbol{n} \cdot \boldsymbol{p}
@f] @f]
@see @ref planeEquation(const Vector3<T>&, const Vector3<T>&, const Vector3<T>&), @see @ref planeEquation(const Vector3<T>&, const Vector3<T>&, const Vector3<T>&),
@ref dot() @ref dot(), @ref Frustum
*/ */
template<class T> Vector4<T> planeEquation(const Vector3<T>& normal, const Vector3<T>& point) { template<class T> Vector4<T> planeEquation(const Vector3<T>& normal, const Vector3<T>& point) {
return {normal, -Math::dot(normal, point)}; return {normal, -Math::dot(normal, point)};

Loading…
Cancel
Save