johnpmayer / elm-linear-algebra

BSD 3-Clause "New" or "Revised" License
16 stars 21 forks source link

Fix setX, setY, and setZ to use correct MJS_FLOAT_ARRAY_TYPE constructor #4

Closed dackerman closed 10 years ago

dackerman commented 10 years ago

Square brackets were missing when creating a Float32Array, causing a "RangeError" at runtime when trying to set values into a vec3.

The specific error was "Uncaught RangeError: Invalid typed array length", which just seems to be because the 3 arg version of the Float32Array constructor expects the first argument to be the length, which the code tries to set as a float value.

johnpmayer commented 10 years ago

looking at this