Library of Assembled Shared Sources
lass::prim::Normalized Struct Reference

Policy to auto-normalize normals. More...

#include <normalizing_policy.h>

Static Public Member Functions

template<typename VectorType>
static void normalize (VectorType &ioSubject)
 Normalize a vector iSubject.
 
template<typename VectorType, typename ValueType>
static void normalizeAndScale (VectorType &ioSubject, ValueType &ioExtraValue)
 Normalize iSubject, and scale iExtraValue as well so iExtraValue / iSubject.norm() is constant.
 
template<typename ValueType, typename VectorType>
static ValueType divideByNorm (ValueType iValue, const VectorType &)
 since iNormObject should be normalized by now, we can "divide by 1".
 
template<typename ValueType, typename VectorType>
static ValueType divideBySquaredNorm (ValueType iValue, const VectorType &)
 since iNormObject should be normalized by now, we can "divide by 1".
 

Detailed Description

Policy to auto-normalize normals.

Author
Bram de Greve [BdG]
Date
2003

Using this policy will automatically normalize all direction vectors and normals. That way, you don't have to bother what you have as input, you know that they will be normalized anyway. Also, for the implementation of the primitives, optimized routines are provided that take advantage of the knowledge that the vectors are normalized. But this are implementation details you should not worry about.

Definition at line 108 of file normalizing_policy.h.

Member Function Documentation

◆ normalizeAndScale()

template<typename VectorType, typename ValueType>
static void lass::prim::Normalized::normalizeAndScale ( VectorType & ioSubject,
ValueType & ioExtraValue )
inlinestatic

Normalize iSubject, and scale iExtraValue as well so iExtraValue / iSubject.norm() is constant.

Typically used by cartesian equations.

Postcondition
iExtraValue / iSubject.norm() is the same as before the call.

Definition at line 123 of file normalizing_policy.h.

References norm().

◆ divideByNorm()

template<typename ValueType, typename VectorType>
static ValueType lass::prim::Normalized::divideByNorm ( ValueType iValue,
const VectorType &  )
inlinestatic

since iNormObject should be normalized by now, we can "divide by 1".

Returns
iValue
Precondition
iNormObject is supposed to be normalized!

Definition at line 136 of file normalizing_policy.h.

◆ divideBySquaredNorm()

template<typename ValueType, typename VectorType>
static ValueType lass::prim::Normalized::divideBySquaredNorm ( ValueType iValue,
const VectorType &  )
inlinestatic

since iNormObject should be normalized by now, we can "divide by 1".

Returns
iValue
Precondition
iNormObject is supposed to be normalized!

Definition at line 146 of file normalizing_policy.h.


The documentation for this struct was generated from the following file: