C4 Engine
C4 Engine API Documentation


Defined in:  TSVector4D.h
Unitizes the weight of a 4D vector.

Vector4D& Unitize(void);

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

The return value is a reference to the vector object.