56template <
class DT> 
class Tvec4;
 
   57template <
class DT> 
class Tmat3;
 
   58template <
class DT> 
class Tmat4;
 
   94  inline Tvec3(
const DT px, 
const DT py, 
const DT pz)
 
   96    Superclass::_buffer[0] = px;
 
   97    Superclass::_buffer[1] = py;
 
   98    Superclass::_buffer[2] = pz;
 
 
  104    Superclass::_buffer[0] = v[0];
 
  105    Superclass::_buffer[1] = v[1];
 
  106    Superclass::_buffer[2] = pz;
 
 
  120        Superclass::_buffer[0] = v[0]*divi;
 
  121        Superclass::_buffer[1] = v[1]*divi;
 
  122        Superclass::_buffer[2] = v[2]*divi;
 
  128                       "Normalization with zero fourth component of homogeneous vector " 
  129                       "performed. Leaving vector unchanged.");
 
  134      Superclass::_buffer[0] = v[0];
 
  135      Superclass::_buffer[1] = v[1];
 
  136      Superclass::_buffer[2] = v[2];
 
 
  147        Superclass::_buffer[0] = v[1];
 
  148        Superclass::_buffer[1] = v[2];
 
  149        Superclass::_buffer[2] = v[3];
 
  152        Superclass::_buffer[0] = v[0];
 
  153        Superclass::_buffer[1] = v[2];
 
  154        Superclass::_buffer[2] = v[3];
 
  157        Superclass::_buffer[0] = v[0];
 
  158        Superclass::_buffer[1] = v[1];
 
  159        Superclass::_buffer[2] = v[3];
 
  162        Superclass::_buffer[0] = v[0];
 
  163        Superclass::_buffer[1] = v[1];
 
  164        Superclass::_buffer[2] = v[2];
 
 
  171  inline void assign(
const DT px, 
const DT py, 
const DT pz)
 
  173    Superclass::_buffer[0] = px;
 
  174    Superclass::_buffer[1] = py;
 
  175    Superclass::_buffer[2] = pz;
 
 
  184    const DT lastComp = Superclass::_buffer[2];
 
  187    const DT div = 
static_cast<DT
>(1) / lastComp;
 
  189    return Tvec3(Superclass::_buffer[0] * div,
 
  190                 Superclass::_buffer[1] * div,
 
 
 
  215template <
class DT, 
class DT2>
 
  218  return Tvec3<DT>(a[0][0]*v[0] + a[0][1]*v[1] + a[0][2]*v[2],
 
  219                   a[1][0]*v[0] + a[1][1]*v[1] + a[1][2]*v[2],
 
  220                   a[2][0]*v[0] + a[2][1]*v[1] + a[2][2]*v[2]);
 
 
  227template <
class DT, 
class DT2>
 
  241template <
class DT, 
class DT2>
 
  256template <
class DT, 
class DT2>
 
  267template <
class DT, 
class DT2>
 
  271                   a[2]*b[0] - a[0]*b[2],
 
  272                   a[0]*b[1] - a[1]*b[0]);
 
 
Template class for vector arithmetic with floating point datatypes.
 
A 3x3 matrix class of three row vectors.
 
Tmat3 transpose() const
Returns the transpose of this matrix.
 
A 4x4 matrix class consisting of four row vectors.
 
Tmat4< DT > transpose() const
Returns the transposed *this.
 
Declaration of float vector type traits.
 
Forward declarations to resolve header file dependencies.
 
DT ComponentType
A typedef to 'export' the type of components.
 
FloatingPointVector< DT, 3, Vector3DataContainer< DT > > Superclass
A typedef as a shorthand for the base class.
 
Tvec3(const Tvec4< DT > &v, const bool normalizeV)
Casts a Tvec4 v to Tvec3.
 
Tvec3< DT > divideByLastComp() const
Divides all vector components by its last component and returns it as Tvec3, which then has a 1 as la...
 
void assign(const DT px, const DT py, const DT pz)
Sets all components to the passed values.
 
Tvec3(const DT value=0)
Default and value constructor.
 
Tvec3(const Superclass &v)
Copy constructor from FloatingPointVector.
 
Tvec3(const Tvec4< DT > &v, const int axis)
Casts a Tvec4 v to Tvec3.
 
Tvec3(const DT px, const DT py, const DT pz)
Constructor building the vector px, py, and pz.
 
Tvec4< DT > affineVec() const
Builds a homogeneous Tvec4 vector from *this and returns it, i.e., leaves all components unchanged an...
 
Tvec3(const Tvec2< DT > &v, const DT pz)
Builds a Tvec3 from a Tvec2 and a scalar. Sets the third entry to user given value pz.
 
Tvec4< DT > affinePoint() const
Builds a homogeneous Tvec4 point from *this and returns it, i.e., leaves all components unchanged and...
 
Forward declarations to resolve header file dependencies.
 
Specialized base class for the FloatingPointVectorDataContainerBase.
 
DT x
X-component of the vector, same as _buffer[0].
 
DT z
Z-component of the vector, same as _buffer[2].
 
DT y
Y-component of the vector, same as _buffer[1].
 
bool MLValuesDifferWOM(MLint8 a, MLint8 b)
Returns true if values differ; otherwise, it returns false.
 
#define ML_BAD_PARAMETER
A bad/invalid parameter (or even an inappropriate image) has been passed to a module or an algorithm,...
 
#define ML_CHECK_FLOAT(x)
 
void ML_UTILS_EXPORT printTemplateError(const char *location, MLErrorCode reason, const std::string_view &handling)
 
T operator*(const FloatingPointVector< T, size, DataContainer > &a, const FloatingPointVector< T, size, DataContainer > &b)
Dot product, returns a.dot(b).
 
Tvec3< DT > operator^(const Tvec3< DT > &a, const Tvec3< DT2 > &b)
Returns a vector orthogonal to a and b.