gltf-rs / gltf

A crate for loading glTF 2.0
Apache License 2.0
534 stars 124 forks source link

Allow to iterate over reference instead of copy #296

Open DavidPeicho opened 3 years ago

DavidPeicho commented 3 years ago

I was wondering if it made sense to add extra implementation of the Item trait here, which would allow to iterate over references of items instead of copies.

I think this feature may only serve few people (like me), because most users will definitely copy the data extract from accessors into their own data struct only once.

IcanDivideBy0 commented 2 years ago

Hello, i think you can achieve this by using the by_ref Iterator method?

aloucks commented 2 years ago

I'm willing to bet that small f32 and u32 arrays will be optimized into a single SSE register. I'd be pretty surprised to see any measurable performance increase by using references here.