Skip to content

return immutable static constant when calling #zero in Vector3i and Vector3f #1494

Open
ieatglu3 wants to merge 1 commit intoretrooper:2.0from
ieatglu3:static-vec3i-3f-zero-consts
Open

return immutable static constant when calling #zero in Vector3i and Vector3f #1494
ieatglu3 wants to merge 1 commit intoretrooper:2.0from
ieatglu3:static-vec3i-3f-zero-consts

Conversation

@ieatglu3
Copy link
Copy Markdown

@ieatglu3 ieatglu3 commented Apr 14, 2026

Vector3f and Vector3i both returned a new vector object when calling the zero() method; this is unnecessary as Vector3f and Vector3i components are immutable. I considered it may have been intentional, although I see in the Vector3d class, that this isn't the case, and its zero() method does indeed return a static constant

So it may have just been forgotten to be implemented in its float and integer counterparts.

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

Successfully merging this pull request may close these issues.

1 participant