greggman / wgpu-matrix

Fast WebGPU 3d math library
https://wgpu-matrix.org
MIT License
298 stars 13 forks source link

gl-matrix *.set() equivalent missing #14

Closed Axiverse closed 1 year ago

Axiverse commented 1 year ago

Missing a way to set a variable with specific numbers, like a create but with a dst. Or am I missing something?

e.g.

const v = vec3.create();
// ...
vec3.set(1, 2, 3, v);
greggman commented 1 year ago

you're right, there is no set ATM

On creation you can do this

const v = vec3.create(1, 2, 3);

You can also do this

vec3.copy([1, 2, 3], v);

But ATM there is no set. Can add one

greggman commented 1 year ago

added: https://github.com/greggman/wgpu-matrix/commit/b99726f7328bffdc9b54cb6018d76b8cd9b08ba2

Axiverse commented 1 year ago

thanks!