C4 Engine
C4 Engine API Documentation


Defined in:  TSVector3D.h
Unitizes the weight of a 3D vector.

Vector3D& Unitize(void);

The Unitize function multiplies a 3D vector by the inverse of its z coordinate, transforming it into a homogeneous point having a unit weight. If the z coordinate is zero, then the resulting x and y coordinates are undefined. In all cases, the z coordinate is 1.0 when this function returns.

The return value is a reference to the vector object.