Facebook Twitter YouTube

class Vec3D

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

template <typename type> class Vec3D

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

Vec3D();

Vec3D(type a, type b, type c);

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

Objects of the Vec3D type cannot be constructed directly. Vector objects are utilized by constructing objects having the subclass types Vector3D and Integer3D.

The default constructor leaves the components of the vector undefined. If the values a, b, and c are supplied, then they are assigned to the x, y, and z 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, or 2.
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, or 2.
Nonmember Operations
bool operator ==(const Vec3D<type>& v1, const Vec3D<type>& v2) const; Returns a boolean value indicating the equality of the two vectors v1 and v2.
bool operator !=(const Vec3D<type>& v1, const Vec3D<type>& v2) const; Returns a boolean value indicating the inequality of the two vectors v1 and v2.
See Also

Vector3D

Integer3D

Vec2D

Vec4D