datenwolf / linmath.h

a lean linear math library, aimed at graphics programming. Supports vec3, vec4, mat4x4 and quaternions
Do What The F*ck You Want To Public License
922 stars 134 forks source link

mat4x4_scale_aniso leaves target W vector uninitialized #12

Closed cormac-obrien closed 10 years ago

cormac-obrien commented 10 years ago

The mat4x4_scale_aniso function should copy the W vector from the reference matrix to the target matrix. As it stands:

mat4x4 id;
mat4x4_identity(id);

mat4x4 scaled;
mat4x4_scale_aniso(scaled, id, 0.1, 0.4, 0.9); // scales x, y, z, doesn't copy w

Found this while running some really basic tests on the library.

datenwolf commented 10 years ago

Thanks for the info. The w-column now gets copied. If compiling with optimization the tested compilers are smart enough to vectorize it.