Skip to content

Optional glam feature#41

Merged
redstrate merged 3 commits intoredstrate:mainfrom
OhKannaDuh:glam-feature
Mar 14, 2026
Merged

Optional glam feature#41
redstrate merged 3 commits intoredstrate:mainfrom
OhKannaDuh:glam-feature

Conversation

@OhKannaDuh
Copy link
Copy Markdown
Contributor

Add an optional glam feature flag for less friction on type coercion. Because of Rust's orphan rules, this is the type of thing that can only live in this library, outside of an intermediate type being implemented. This came about because I was thinking about what was discussed in this issue: redstrate/Kawari#323

There a few options:

  • We could do it this way, by allow Physis to optionally integrate with glam.
  • We could implement an intermediary newtype that wraps Affine3a and implements From<Transformation>
  • We could have a converter function, similar to what is in the linked issue. fn physis_transform_to_affine3a(transformation: &Transformation) -> Affine3A

@redstrate
Copy link
Copy Markdown
Owner

We could do it this way, by allow Physis to optionally integrate with glam.

This is the method I was thinking of, I was under the assumption you could maybe use Into instead but really I think enough people would find this useful as an optional thing.

OhKannaDuh and others added 2 commits March 14, 2026 18:19
Co-authored-by: Joshua Goins <josh@redstrate.com>
Copy link
Copy Markdown
Owner

@redstrate redstrate left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM is very much appreciated (along with the tests as well)

@OhKannaDuh
Copy link
Copy Markdown
Contributor Author

We could do it this way, by allow Physis to optionally integrate with glam.

This is the method I was thinking of, I was under the assumption you could maybe use Into instead but really I think enough people would find this useful as an optional thing.

You get Into for free from a From impl

@redstrate redstrate merged commit b35de74 into redstrate:main Mar 14, 2026
2 checks passed
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.

2 participants