quaternion: fix init_from_array and get_rotation_axis
quaternion: fix init_from_array and get_rotation_axis

In cogl_quaternion_init_from_array we were passing the address of the x
component as the destination for memcpy, but that was wrong at least
because w is actually the first member in the structure.  Another
concern raised was whether it was safe to assume that there was no
padding within the CoglQuaternion struct with some compilers so we also
switch to explicitly indexing each element of the array we want to copy.
In practice I think it's pretty safe to assume that padding will only be
introduced to ensure members are naturally aligned, but being explicit
is readable and it can't hurt to be extra cautious.

Another good catch in bug #655228 was that in
cogl_quaternion_get_rotation_axis we had a copy and paste error at the
end where we finally extract the axis and we were repeatedly calculating
just the x component. Now we calculate the y and z components too.

Thanks to Bug #655228 for identifying these issues.

https://bugzilla.gnome.org/show_bug.cgi?id=655228

Reviewed-by: Neil Roberts <822ec91a7ef82248fd36162ca8ac3283eba70848@linux.intel.com>

gcampax/cogl,gcampax/cogl,djdeath/cogl,gcampax/cogl,Distrotech/cogl,djdeath/cogl-android,Distrotech/cogl,Distrotech/cogl,gcampax/cogl,Distrotech/cogl,collects/cogl,djdeath/cogl,djdeath/cogl-android,djdeath/cogl-android,collects/cogl,djdeath/cogl