95#ifndef LASS_GUARDIAN_OF_INCLUSION_PRIM_NORMALIZING_POLICY_H
96#define LASS_GUARDIAN_OF_INCLUSION_PRIM_NORMALIZING_POLICY_H
112 template<
typename VectorType>
115 ioSubject.normalize();
122 template<
typename VectorType,
typename ValueType>
125 const typename VectorType::TValue
norm = ioSubject.norm();
126 LASS_ASSERT(
norm != VectorType::TNumTraits::zero);
127 ioExtraValue /=
norm;
135 template<
typename ValueType,
typename VectorType>
145 template<
typename ValueType,
typename VectorType>
159 template<
typename VectorType>
167 template<
typename VectorType,
typename ValueType>
174 template<
typename ValueType,
typename VectorType>
175 static ValueType
divideByNorm(ValueType iValue,
const VectorType& iNormObject)
177 return iValue / iNormObject.norm();
182 template<
typename ValueType,
typename VectorType>
185 return iValue / iNormObject.squaredNorm();
T norm(const T &x)
return norm of x as if x is real part of complex number: sqr(x)
set of geometrical primitives
Library for Assembled Shared Sources.
Policy to auto-normalize normals.
static ValueType divideByNorm(ValueType iValue, const VectorType &)
since iNormObject should be normalized by now, we can "divide by 1".
static void normalize(VectorType &ioSubject)
Normalize a vector iSubject.
static ValueType divideBySquaredNorm(ValueType iValue, const VectorType &)
since iNormObject should be normalized by now, we can "divide by 1".
static void normalizeAndScale(VectorType &ioSubject, ValueType &ioExtraValue)
Normalize iSubject, and scale iExtraValue as well so iExtraValue / iSubject.norm() is constant.
Policy to keep normals unnormalized.
static ValueType divideBySquaredNorm(ValueType iValue, const VectorType &iNormObject)
static ValueType divideByNorm(ValueType iValue, const VectorType &iNormObject)
static void normalize(VectorType &)
Don't normalize normals we want to keep unnormalized!
static void normalizeAndScale(VectorType &, ValueType &)
Don't normalize and don't scale.