Open ink0rr opened 2 months ago
A build of a stale comment leftover when I was first implementing this I guess. I was a bit torn on how valuable people would find the immutable version vs. just using the functions instead. Is this something you would find valuable?
Not really, I've settled with just cloning the vector when I need to avoid mutating the original object.
const a = new Vector3Builder(0, 0, 0);
const b = new Vector3Builder(a).add({ x: 1, y: 2, z: 3 });
Though it looks kinda awkward, I think it would be nice to have something like a .clone()
method if possible.
const a = new Vector3Builder(0, 0, 0);
const b = a.clone().add({ x: 1, y: 2, z: 3 });
It's mentioned in a comment, but the implementation doesn't exists.
https://github.com/Mojang/minecraft-scripting-libraries/blob/8cf3f6aa9c7d1826f2e8abc74fa583d17b1b8795/libraries/math/src/vector3/vectorWrapper.ts#L13