Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ImmutableVector3Builder #27

Open
ink0rr opened this issue Apr 22, 2024 · 2 comments
Open

Add ImmutableVector3Builder #27

ink0rr opened this issue Apr 22, 2024 · 2 comments

Comments

@ink0rr
Copy link

ink0rr commented Apr 22, 2024

It's mentioned in a comment, but the implementation doesn't exists.

* For an immutable version of the build, use ImmutableVector3Builder.

@rlandav
Copy link
Collaborator

rlandav commented May 10, 2024

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?

@ink0rr
Copy link
Author

ink0rr commented May 10, 2024

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 });

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants