Remove old GltfPrimitiveAttributes struct

This commit is contained in:
marceline-cramer 2022-02-16 21:36:06 -07:00
parent cb5b559bbd
commit b908fbe74d
1 changed files with 0 additions and 31 deletions

View File

@ -1,7 +1,6 @@
use crate::handle::*;
use crate::mesh::*;
use crate::pool::{MaterialData, TextureData};
use crate::renderer::Renderer;
use crate::scene::MeshInstance;
pub trait OnLoad {
@ -286,33 +285,3 @@ impl<'a, T: OnLoad> GltfLoader<'a, T> {
self.on_load.load_mesh(&MeshData { vertices, indices })
}
}
pub struct GltfPrimitiveAttributes<'a> {
pub positions: Option<gltf::Accessor<'a>>,
pub normals: Option<gltf::Accessor<'a>>,
pub texcoords: Option<gltf::Accessor<'a>>,
}
impl<'a> GltfPrimitiveAttributes<'a> {
pub fn new(primitive: gltf::Primitive<'a>) -> Self {
let mut positions = None;
let mut normals = None;
let mut texcoords = None;
for (semantic, accessor) in primitive.attributes() {
use gltf::Semantic::*;
match semantic {
Positions => positions = Some(accessor),
Normals => normals = Some(accessor),
TexCoords(0) => texcoords = Some(accessor),
_ => println!("unused glTF attribute {:?}", semantic),
}
}
Self {
positions,
normals,
texcoords,
}
}
}