Skip to content
This repository has been archived by the owner on Jun 10, 2022. It is now read-only.

Vectors and Quaternions should be immutable #730

Open
in2dair opened this issue Oct 15, 2020 · 0 comments
Open

Vectors and Quaternions should be immutable #730

in2dair opened this issue Oct 15, 2020 · 0 comments
Labels
V2 To be included in version 2

Comments

@in2dair
Copy link

in2dair commented Oct 15, 2020

We're repeatedly running in to subtle bugs when we grab vectors/quaternions off of a transform (e.g., for math), and then inadvertently modify the source.

position = actor.transform.app.position;
rotation = actor.transform.app.rotation;
// DANGER! don't modify position or rotation or you'll mess up actor's transform

There are workaround (e.g., explicitly cloning), but the developer remains in constant danger of shooting themselves in the foot :)

@in2dair in2dair added the V2 To be included in version 2 label Oct 15, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
V2 To be included in version 2
Projects
None yet
Development

No branches or pull requests

1 participant