bevy/crates/bevy_mesh/src
Stepan Koltsov 1f69bc1f96
Mesh::merge: count_vertices instead of initializing positions (#16024)
# Objective

When merging two meshes, we need to find the offset of indices for the
second mesh. Currently it is done by inserting empty positions if
positions is not set.

Although practically it is not an issue, this does not feel right:
- We did not have positions before, then why we have positions after
merge?
- Moreover, if positions are not set, but uvs are not empty, computed
offset will be zero, while it should be equal to the number of uvs.

## Solution

Use `Mesh::count_vertices` to find the number of vertices.

## Testing

Looking hard.
2024-10-31 17:06:32 +00:00
..
primitives Use en-us locale for typos (#16037) 2024-10-20 18:55:17 +00:00
conversions.rs Remove thiserror from bevy_mesh (#15768) 2024-10-09 14:24:54 +00:00
index.rs Indices::extend (#16023) 2024-10-31 16:39:32 +00:00
lib.rs Split out bevy_mesh from bevy_render (#15666) 2024-10-06 14:18:11 +00:00
mesh.rs Mesh::merge: count_vertices instead of initializing positions (#16024) 2024-10-31 17:06:32 +00:00
mikktspace.rs Remove thiserror from bevy_mesh (#15768) 2024-10-09 14:24:54 +00:00
morph.rs Fix *most* clippy lints (#15906) 2024-10-14 20:52:35 +00:00
skinning.rs Split out bevy_mesh from bevy_render (#15666) 2024-10-06 14:18:11 +00:00
vertex.rs Remove thiserror from bevy_mesh (#15768) 2024-10-09 14:24:54 +00:00