C4 Engine
C4 Engine API Documentation

class Integer4D

Defined in:  TSInteger.h
The Integer4D class encapsulates a vector containing a 4-tuple of integer coordinates.
Definition

class Integer4D : public Vec4D<TypeInteger4D>

Member Functions
Integer4D::Set Sets all four components of a vector.
Constructor

Integer4D();

Integer4D(int32 i, int32 j, int32 k, int32 l);

template <typename type> Integer4D(const Vec4D<type>& u);

Parameters
i The value of the x coordinate.
j The value of the y coordinate.
k The value of the z coordinate.
l The value of the w coordinate.
u Another 4D vector, possibly with a different component type, that is converted to an Integer4D.
Description
The Integer4D class is used to store a vector having four integer components x, y, z, and w.

The default constructor leaves the components of the vector undefined. If the values i, j, k, and l are supplied, then they are assigned to the x, y, z, and w coordinates of the vector, respectively.
Overloaded Operators
int32operator [](machine k); Returns a reference to the k-th scalar component of a vector. The value of k must be 0, 1, 2, or 3.
const int32operator [](machine k) const; Returns a constant reference to the k-th scalar component of a vector. The value of k must be 0, 1, 2, or 3.
Integer4D& operator +=(const Integer4D& v); Adds the vector v.
Integer4D& operator -=(const Integer4D& v); Subtracts the vector v.
Nonmember Operations
Integer4D operator +(const Integer4D& v1, const Integer4D& v2) const; Returns the componentwise sum of the vectors v1 and v2.
Integer4D operator -(const Integer4D& v1, const Integer4D& v2) const; Returns the componentwise difference of the vectors v1 and v2.
Integer4D operator *(const Integer4D& v, int32 t) const; Returns a vector for which each component of the vector v has been multiplied by t.
Integer4D operator /(const Integer4D& v, int32 t) const; Returns a vector for which each component of the vector v has been divided by t.
bool operator ==(const Integer4D& v1, const Integer4D& v2) const; Returns a boolean value indicating whether the two vectors v1 and v2 are equal.
bool operator !=(const Integer4D& v1, const Integer4D& v2) const; Returns a boolean value indicating whether the two vectors v1 and v2 are not equal.
Base Classes
Vec4D Vectors use a generic base class to store their components.
See Also

Integer2D

Integer3D