Facebook Twitter YouTube

class Vec4D

Defined in:  TSMath.h
The Vec4D class template serves as a generic base class for other 4D vector types.
Definition

template <typename type> class Vec4D

Template Parameters
type The type of each component of the vector.
Constructor

Vec4D();

Vec4D(type a, type b, type c, type d);

Parameters
a The value of the x coordinate.
b The value of the y coordinate.
c The value of the z coordinate.
d The value of the w coordinate.
Description
The Vec4D class template is used to store the x, y, z, and w components of a four-dimensional vector. The type of the components is given by the type template parameter.

Objects of the Vec4D type cannot be constructed directly. Vector objects are utilized by constructing objects having the subclass type Vector4D.

The default constructor leaves the components of the vector undefined. If the values a, b, c, and d are supplied, then they are assigned to the x, y, z, and w coordinates of the vector, respectively.
Overloaded Operators
type& operator [](machine k); Returns a reference to the k-th component of a vector. The value of k must be 0, 1, 2, or 3.
const type& operator [](machine k) const; Returns a constant reference to the k-th component of a vector. The value of k must be 0, 1, 2, or 3.
Nonmember Operations
bool operator ==(const Vec4D<type>& v1, const Vec4D<type>& v2) const; Returns a boolean value indicating the equality of the two vectors v1 and v2.
bool operator !=(const Vec4D<type>& v1, const Vec4D<type>& v2) const; Returns a boolean value indicating the inequality of the two vectors v1 and v2.
See Also

Vector4D

Vec2D

Vec3D