Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ManevilleF committed Feb 18, 2024
1 parent 1ca35be commit d8286c7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/components/cloth_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -331,14 +331,15 @@ impl ClothBuilder {
mesh.attribute(Mesh::ATTRIBUTE_COLOR)
.and_then(|attr| match attr {
VertexAttributeValues::Float32x3(v) => {
Some(v.iter().copied().map(Color::from).collect())
Some(v.iter().copied().map(Color::rgb_from_array).collect())
}
VertexAttributeValues::Float32x4(v) => {
Some(v.iter().copied().map(Color::from).collect())
Some(v.iter().copied().map(Color::rgba_from_array).collect())
}
VertexAttributeValues::Uint8x4(v) => Some(
v.iter()
.map(|c| Color::rgba_u8(c[0], c[1], c[2], c[3]))
.copied()
.map(|[r, g, b, a]| Color::rgba_u8(r, g, b, a))
.collect(),
),
_ => None,
Expand Down
2 changes: 1 addition & 1 deletion src/components/cloth_rendering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ impl ClothRendering {
Mesh::ATTRIBUTE_NORMAL,
Self::vec3_vertex_attr(&vertex_normals),
);
mesh.set_indices(Some(Indices::U32(new_self.indices)));
mesh.insert_indices(Indices::U32(new_self.indices));
}
}
}
Expand Down

0 comments on commit d8286c7

Please sign in to comment.