jalberse / shimmer

Physically based rendering in Rust
Apache License 2.0
33 stars 0 forks source link

Make traits in vector_math module private #12

Open jalberse opened 10 months ago

jalberse commented 10 months ago

Instead, we could expose the trait operations in each Point/Vector/Normal struct (where they just call the trait implementations).

This way, callers don't need to import the traits or know they exist, they can just import the structs. This also makes it impossible for callers to use some trait object, which would result in dynamic dispatch (bad). We really don't intend callers to implement these traits for other types, we just wanted them for generic, monomorphized functions within vec_math for reducing code repetition.

This is lower priority than feature work, though.