Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions benches/benches/bevy_render/compute_normals.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use rand::random;
use std::time::{Duration, Instant};

use bevy_asset::RenderAssetUsages;
use bevy_mesh::{Indices, Mesh, PrimitiveTopology};
use bevy_mesh::{Indices, InfallibleMesh, Mesh, PrimitiveTopology};

const GRID_SIZE: usize = 256;

Expand All @@ -28,7 +28,7 @@ fn compute_normals(c: &mut Criterion) {
.flat_map(|i| std::iter::repeat(i).zip(0..GRID_SIZE))
.map(|(i, j)| [i as f32, j as f32, random::<f32>()])
.collect::<Vec<_>>();
Mesh::new(
InfallibleMesh::new(
PrimitiveTopology::TriangleList,
RenderAssetUsages::MAIN_WORLD,
)
Expand Down
3 changes: 1 addition & 2 deletions crates/bevy_camera/src/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,7 @@ impl MeshAabb for Mesh {
return Some(aabb.into());
}

let Ok(VertexAttributeValues::Float32x3(values)) =
self.try_attribute(Mesh::ATTRIBUTE_POSITION)
let Ok(VertexAttributeValues::Float32x3(values)) = self.attribute(Mesh::ATTRIBUTE_POSITION)
else {
return None;
};
Expand Down
7 changes: 4 additions & 3 deletions crates/bevy_gltf/src/loader/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ use bevy_math::{Mat4, Vec3};
use bevy_mesh::{
morph::{MeshMorphWeights, MorphAttributes, MorphTargetImage, MorphWeights},
skinning::{SkinnedMesh, SkinnedMeshInverseBindposes},
Indices, Mesh, Mesh3d, MeshVertexAttribute, PrimitiveTopology,
Indices, InfallibleMesh, Mesh, Mesh3d, MeshVertexAttribute, PrimitiveTopology,
};
#[cfg(feature = "pbr_transmission_textures")]
use bevy_pbr::UvChannel;
Expand Down Expand Up @@ -727,7 +727,7 @@ impl GltfLoader {
};
let primitive_topology = primitive_topology(primitive.mode())?;

let mut mesh = Mesh::new(primitive_topology, settings.load_meshes);
let mut mesh = InfallibleMesh::new(primitive_topology, settings.load_meshes);

// Read vertex attributes
for (semantic, accessor) in primitive.attributes() {
Expand Down Expand Up @@ -837,7 +837,8 @@ impl GltfLoader {
});
}

let mesh_handle = load_context.add_labeled_asset(primitive_label.to_string(), mesh);
let mesh_handle =
load_context.add_labeled_asset(primitive_label.to_string(), mesh.into());
primitives.push(super::GltfPrimitive::new(
&gltf_mesh,
&primitive,
Expand Down
2 changes: 1 addition & 1 deletion crates/bevy_math/src/primitives/dim2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1956,7 +1956,7 @@ impl From<ConvexPolygon> for Polygon {
)]
pub struct ConvexPolygon {
/// The vertices of the [`ConvexPolygon`].
vertices: Vec<Vec2>,
pub vertices: Vec<Vec2>,
}

#[cfg(feature = "alloc")]
Expand Down
Loading