mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 12:43:34 +00:00
parent
1ebb7e44ff
commit
268b520105
1 changed files with 13 additions and 13 deletions
|
@ -1,5 +1,5 @@
|
|||
use bevy_render::{
|
||||
mesh::{Mesh, VertexAttribute, VertexAttributeValues},
|
||||
mesh::{Mesh, VertexAttribute},
|
||||
pipeline::PrimitiveTopology,
|
||||
};
|
||||
|
||||
|
@ -76,24 +76,24 @@ fn load_node(buffer_data: &[Vec<u8>], node: &gltf::Node, depth: i32) -> Result<M
|
|||
let primitive_topology = get_primitive_topology(primitive.mode())?;
|
||||
let mut mesh = Mesh::new(primitive_topology);
|
||||
|
||||
if let Some(vertex_attribute) = reader.read_positions().map(|v| VertexAttribute {
|
||||
name: "Vertex_Position".into(),
|
||||
values: VertexAttributeValues::Float3(v.collect()),
|
||||
}) {
|
||||
if let Some(vertex_attribute) = reader
|
||||
.read_positions()
|
||||
.map(|v| VertexAttribute::position(v.collect()))
|
||||
{
|
||||
mesh.attributes.push(vertex_attribute);
|
||||
}
|
||||
|
||||
if let Some(vertex_attribute) = reader.read_normals().map(|v| VertexAttribute {
|
||||
name: "Vertex_Normal".into(),
|
||||
values: VertexAttributeValues::Float3(v.collect()),
|
||||
}) {
|
||||
if let Some(vertex_attribute) = reader
|
||||
.read_normals()
|
||||
.map(|v| VertexAttribute::normal(v.collect()))
|
||||
{
|
||||
mesh.attributes.push(vertex_attribute);
|
||||
}
|
||||
|
||||
if let Some(vertex_attribute) = reader.read_tex_coords(0).map(|v| VertexAttribute {
|
||||
name: "Vertex_Uv".into(),
|
||||
values: VertexAttributeValues::Float2(v.into_f32().collect()),
|
||||
}) {
|
||||
if let Some(vertex_attribute) = reader
|
||||
.read_tex_coords(0)
|
||||
.map(|v| VertexAttribute::uv(v.into_f32().collect()))
|
||||
{
|
||||
mesh.attributes.push(vertex_attribute);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue