|
|
@@ -94,9 +94,9 @@ impl<'a, A: Atlas> MeshReader<'a, A> {
|
|
|
self
|
|
|
}
|
|
|
|
|
|
- /// Extract vertices and indices from file contents
|
|
|
+ /// Extract features, vertices and indices from file contents
|
|
|
/// If using wgpu you can use `create` to also upload it to the gpu
|
|
|
- pub fn read<V: Vertex>(&self, bytes: &[u8]) -> Result<(Vec<V>, Vec<Index>)> {
|
|
|
+ pub fn read<V: Vertex>(&self, bytes: &[u8]) -> Result<(MeshFeatures, Vec<V>, Vec<Index>)> {
|
|
|
let mut bytes = Cursor::new(bytes);
|
|
|
let bytes = &mut bytes;
|
|
|
let mut header = [0; 5];
|
|
|
@@ -308,13 +308,13 @@ impl<'a, A: Atlas> MeshReader<'a, A> {
|
|
|
.map(|_| read_index(bytes))
|
|
|
.collect::<Result<_>>()?;
|
|
|
|
|
|
- Ok((vertices, indices))
|
|
|
+ Ok((features, vertices, indices))
|
|
|
}
|
|
|
|
|
|
/// Read and create a mesh on the GPU
|
|
|
#[cfg(feature = "mesh")]
|
|
|
pub fn create<V: Vertex>(&self, device: &wgpu::Device, bytes: &[u8]) -> Result<Mesh> {
|
|
|
- let (vertices, indices) = self.read::<V>(bytes)?;
|
|
|
+ let (_features, vertices, indices) = self.read::<V>(bytes)?;
|
|
|
Ok(Mesh::new(device, &vertices, &indices))
|
|
|
}
|
|
|
}
|