OppDir

FUNCTION:

OppDir

TEMPLATE:

R3VECTOR *OppDir(R3VECTOR *r, R3VECTOR *dir);

PARAMETERS:

r - result

RETURN VALUE:

Address of the result vector 'r'

DESCRIPTION:

Makes sure 'r' and 'dir' always points to opposite directions by inverting the direction of 'r' if necessary. Vectors point to opposite directions when their dot product is negative.