nn::math::VEC2SafeNormalize Function

Syntax

NN_MATH_INLINE VEC2 * VEC2SafeNormalize(
     VEC2 * pOut,
     const VEC2 * p,
     const VEC2 & alt
);

Parameters

Name Description
out pOut Pointer to the buffer that receives the result of the calculation. It is not a problem if this points to the same vector as p.
in p Pointer to the first input vector.
in alt Vector to set if normalization fails.

Return Values

Returns pOut.

Description

Normalizes a vector. If normalization fails, sets the specified vector.


CONFIDENTIAL