Template Struct Normal

Inheritance Relationships

Base Type

Struct Documentation

template<typename CoordType>
struct Normal : public lvr2::BaseVector<CoordType>

A vector guaranteed to be normalized (length = 1).

If you have an object of type Normal, you can be sure that it always has the length 1. The easiest way to create a Normal is to use the method Vector::normalized().

Public Functions

inline Normal()
explicit Normal(BaseVector<CoordType> base)

Creates a normal vector from the underlying vector representation.

Parameters:

base – This vector must not be the null-vector, else the behavior is undefined.

Normal(CoordType x, CoordType y, CoordType z)

Initializes the normal with the given coordinates.

Note that the given coordinates must not form the null-vector, else the behavior is undefined.

inline CoordType getX() const
inline CoordType getY() const
inline CoordType getZ() const
template<typename T>
Normal<CoordType> &operator=(const T &other)

Allows to assign Vectors to normals. Vector data will be copied and normalized.

template<typename T>
Normal<CoordType> operator+(const T &other) const
template<typename T>
Normal<CoordType> operator-(const T &other) const
Normal<CoordType> operator-() const

Public Static Functions

template<typename CollectionT>
static Normal<CoordType> &average(const CollectionT &normals)

Returns the average of all normals in the given collection.

The collection need to work with a range-based for-loop and its elements need to be normals. It has to contain at least one element.

Friends

template<typename T, typename S>
friend Normal<T> operator*(const Eigen::Matrix<S, 4, 4> &mat, const Normal<T> &normal)