You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for skin in import.doc.skins() {
let name = skin.name().map(|name| name.into());
let joint_node_indices: Vec<usize> = skin.joints().map(|j| j.index()).collect();
for node_index in joint_node_indices.iter().cloned() {
nodes[node_index].is_joint = true;
}
let reader = skin.reader(|buffer| Some(&import.buffers[buffer.index()]));
let inverse_bind_matrices = if let Some(inverse_bind_matrices) = reader.read_inverse_bind_matrices() {
inverse_bind_matrices.collect()
} else {
let identity = *mat4(&cgmath::Matrix4::identity());
vec![identity; joint_node_indices.len()]
};
...
}
read_inverse_bind_matrices returns an iterator, which force to collect() afterwards.
Is it possible to return a slice over the buffer instead, avoiding to collect?
Maybe through a read_slice_inverse_bind_matrices ?
Thanks!
The text was updated successfully, but these errors were encountered:
The context is random access of accessors, because iterators consume their view. A slice doesn't suffer from this and is more efficient in that case, instead of rebuilding a reader everytime.
What do you think ?
Hi,
Not very experienced in Rust,
read_inverse_bind_matrices
returns an iterator, which force tocollect()
afterwards.Is it possible to return a slice over the buffer instead, avoiding to collect?
Maybe through a
read_slice_inverse_bind_matrices
?Thanks!
The text was updated successfully, but these errors were encountered: