💬

Community answer

Collected from the ACE community Discord archive around 2019-07-27. It may be informal or outdated — anyone can edit this page to improve it. Original discussion

Vector 2-arg constructor and reference semantics

🖼️ RenderingUpdated 2 days ago•0 views
Vector(x,y) defaults z to 0 (vectors are 3D). Assignment shares the reference - v2=v then v2[2]=100 changes v too; use v:clone() for an independent copy.

Does Vector(x,y) auto-add z=0 / do vector vars share memory

Vector(x,y) defaults z to 0 (vectors are 3D). Assignment shares the reference - v2=v then v2[2]=100 changes v too; use v:clone() for an independent copy.

Was this article helpful?

See More

Discussion(0)

No comments yet. Be the first to ask a question!

Have a question? Sign in to join the discussion.