49template <
class DT>
class Tvec3;
90 inline void assign(
const DT px,
const DT py)
92 Superclass::_buffer[0] = px;
93 Superclass::_buffer[1] = py;
105 Superclass::_buffer[0] = v[0]/v[2];
106 Superclass::_buffer[1] = v[1]/v[2];
110 Superclass::_buffer[0] = v[0];
111 Superclass::_buffer[1] = v[1];
121 case 0: Superclass::_buffer[0] = v[1];
122 Superclass::_buffer[1] = v[2];
break;
123 case 1: Superclass::_buffer[0] = v[0];
124 Superclass::_buffer[1] = v[2];
break;
125 default: Superclass::_buffer[0] = v[0];
126 Superclass::_buffer[1] = v[1];
break;
Template class for vector arithmetic with floating point data types.
Declaration of float vector type traits:
Tvec2(const DT px, const DT py)
Constructor building the vector x (first entry) and y (second entry).
Tvec2(const Superclass &v)
Copy constructor from FloatingPointVector.
Tvec3< DT > affinePoint() const
Builds a homogeneous Tvec3point from *this and return it, i.e.
void assign(const DT px, const DT py)
Sets all components to the passed values.
Tvec3< DT > affineVec() const
Builds a homogeneous Tvec3vector from *this and return it, i.e.
Tvec2(const DT value=0)
Default and value constructor.
Tvec2(const Tvec3< DT > &v, const int axis)
Casts v3 to v2.
Tvec2(const Tvec3< DT > &v, const bool normalize)
Casts v to Tvec2.
DT ComponentType
A typedef to "export" the type of components.
FloatingPointVector< DT, 2, Vector2DataContainer< DT > > Superclass
A typedef as a shorthand for the base class.
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 y
Y-component of the vector, same as _buffer[1].
#define ML_CHECK_FLOAT_THROW(x)