mirror of
https://github.com/bevyengine/bevy
synced 2024-11-25 22:20:20 +00:00
Made Mesh::merge
take a reference of Mesh
. (#13710)
# Objective `Mesh::merge` does not need ownership of the right hand side mesh. ## Solution Made `Mesh::merge` take a reference. ## Testing Modified existing tests. --- ## Changelog Made `Mesh::merge` take a reference. ## Migration Guide * `Mesh::merge` now take a reference of a mesh instead of an owned mesh.
This commit is contained in:
parent
9389de5c71
commit
31be32ff10
2 changed files with 4 additions and 4 deletions
|
@ -741,7 +741,7 @@ impl Mesh {
|
|||
/// Panics if the vertex attribute values of `other` are incompatible with `self`.
|
||||
/// For example, [`VertexAttributeValues::Float32`] is incompatible with [`VertexAttributeValues::Float32x3`].
|
||||
#[allow(clippy::match_same_arms)]
|
||||
pub fn merge(&mut self, other: Mesh) {
|
||||
pub fn merge(&mut self, other: &Mesh) {
|
||||
use VertexAttributeValues::*;
|
||||
|
||||
// The indices of `other` should start after the last vertex of `self`.
|
||||
|
|
|
@ -207,7 +207,7 @@ where
|
|||
|
||||
// An extrusion of depth 0 does not need a mantel
|
||||
if self.half_depth == 0. {
|
||||
front_face.merge(back_face);
|
||||
front_face.merge(&back_face);
|
||||
return front_face;
|
||||
}
|
||||
|
||||
|
@ -374,8 +374,8 @@ where
|
|||
.with_inserted_attribute(Mesh::ATTRIBUTE_UV_0, uvs)
|
||||
};
|
||||
|
||||
front_face.merge(back_face);
|
||||
front_face.merge(mantel);
|
||||
front_face.merge(&back_face);
|
||||
front_face.merge(&mantel);
|
||||
front_face
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue