C4 Engine
C4 Engine API Documentation

Vector4D::Unitize

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

Vector4D& Unitize(void);

Description
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.