33 #ifndef OPENVDB_TOOLS_VECTORTRANSFORMER_HAS_BEEN_INCLUDED 34 #define OPENVDB_TOOLS_VECTORTRANSFORMER_HAS_BEEN_INCLUDED 36 #include <openvdb/Types.h> 37 #include <openvdb/math/Mat4.h> 38 #include <openvdb/math/Vec3.h> 40 #include <type_traits> 51 template<
typename Gr
idType>
65 template<
typename TreeIterT>
void operator()(
const TreeIterT& it)
const 76 template<
typename TreeIterT>
88 template<
typename TreeIterT>
103 template<
typename Gr
idType>
inline 104 typename std::enable_if<!VecTraits<typename GridType::ValueType>::IsVec,
void>::type
105 doTransformVectors(GridType&,
const Mat4d&)
111 template<
typename Gr
idType>
inline 112 typename std::enable_if<VecTraits<typename GridType::ValueType>::IsVec,
void>::type
113 doTransformVectors(GridType& grid,
const Mat4d& mat)
115 if (!grid.isInWorldSpace())
return;
117 const VecType vecType = grid.getVectorType();
128 foreach(grid.beginValueAll(),
MatMul(invmat));
134 foreach(grid.beginValueAll(),
MatMul(mat));
150 template<
typename Gr
idType>
154 doTransformVectors<GridType>(grid, mat);
161 #endif // OPENVDB_TOOLS_VECTORTRANSFORMER_HAS_BEEN_INCLUDED
Vec3< T0 > transform3x3(const Vec3< T0 > &v) const
Transform a Vec3 by post-multiplication, without translation.
Definition: Mat4.h:1115
Mat4 inverse(T tolerance=0) const
Definition: Mat4.h:531
Definition: Exceptions.h:90
VecType
Definition: Types.h:297
#define OPENVDB_THROW(exception, message)
Definition: Exceptions.h:108
Vec3< double > Vec3d
Definition: Vec3.h:679
#define OPENVDB_VERSION_NAME
The version namespace name for this library version.
Definition: version.h:136
Definition: Exceptions.h:39
Mat4 transpose() const
Definition: Mat4.h:518
Vec3< T0 > transformH(const Vec3< T0 > &p) const
Transform a Vec3 by post-multiplication, doing homogenous divison.
Definition: Mat4.h:1072
#define OPENVDB_USE_VERSION_NAMESPACE
Definition: version.h:188
math::Mat4< double > Mat4d
Definition: Types.h:106