1
Fork 0

javascript(ultra32): clone

Signed-off-by: prescientmoon <git@moonythm.dev>
This commit is contained in:
Matei Adriel 2019-01-20 14:39:46 +02:00 committed by prescientmoon
parent 2ecbd6d4b4
commit 676e541926
Signed by: prescientmoon
SSH key fingerprint: SHA256:UUF9JT2s8Xfyv76b8ZuVL7XrmimH4o49p4b+iexbVH4

View file

@ -42,3 +42,10 @@ function rotate(vector) {
return vector; return vector;
} }
exports.rotate = rotate; exports.rotate = rotate;
function clone(vector) {
const newVec = new Float32Array(vector.length);
for (let i = 0; i < vector.length; i++) {
newVec[i] = vector[i];
}
return newVec;
}