C4 Engine API Documentation

## class Integer3D

Defined in:  `TSInteger.h`
The `Integer3D` class encapsulates a vector containing a triplet of integer coordinates.
Definition

`class Integer3D : public Vec3D<TypeInteger3D>`

Member Functions
 `Integer3D::Set` Sets all three components of a vector.
Constructor

`Integer3D();`

`Integer3D(int32 i, int32 j, int32 k);`

`template <typename type> Integer3D(const Vec3D<type>& u);`

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

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