Skip to content

Conversation

@tychedelia
Copy link
Member

Closes #14

The actual transform stack part of this PR is pretty straight forward. We track a current matrix which the user mutates through a variety of commands. When they push a new matrix, we copy this one onto the transform stack, i.e. save the current state.

One minor thing worth knowing is that the A suffix in glam means that the matrix is 16-byte aligned and so will/should get SIMD'd.

A second, slightly more complicated, change here is tracking RenderState as a component on the Graphics entity, rather than a system Local. This was just a mistake from my initial implementation -- local's are cached inside the system state, and so this means that we could accidentally be leaking draw state between graphics. We don't currently support / test multiple graphics at the moment, but I realized in the course of implementing this feature that this was a booboo.

We might need to revisit transform stuff when we do 3d retained, but I think it's likely fine?

@tychedelia tychedelia requested a review from catilac December 13, 2025 05:51
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.

Add Transform support

1 participant