From a87b657d731041f6e58285d29e4c554cbe07bcfc Mon Sep 17 00:00:00 2001 From: Damien Lespiau Date: Wed, 30 May 2012 14:40:09 +0100 Subject: [PATCH] Add a note about [0, 0, 0] and cogl_vector3_normalize() When having the [0, 0, 0] vector, normalize() won't try to divide by 0 and thus it's always safe to use that funtion. Reviewed-by: Neil Roberts (cherry picked from commit 64370e7ddd32f25556a1792c00d14adc48a81d45) --- cogl/cogl-vector.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cogl/cogl-vector.h b/cogl/cogl-vector.h index 01c600640..eaeba565c 100644 --- a/cogl/cogl-vector.h +++ b/cogl/cogl-vector.h @@ -233,6 +233,10 @@ cogl_vector3_divide_scalar (float *vector, * Updates the vector so it is a "unit vector" such that the * @vectors magnitude or length is equal to 1. * + * It's safe to use this function with the [0, 0, 0] vector, it will not + * try to divide components by 0 (its norm) and will leave the vector + * untouched. + * * Since: 1.4 * Stability: Unstable */