From cb46b760ae8d4aeaa0e92a9c313927ffdef27873 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Fri, 10 Jan 2025 20:49:28 +0100 Subject: fix interleaved vertex arrays --- world/src/main.rs | 13 ++++++++++--- world/src/physics.rs | 19 +++++++++++++++++-- 2 files changed, 27 insertions(+), 5 deletions(-) (limited to 'world') diff --git a/world/src/main.rs b/world/src/main.rs index c90ff0c..72e7df2 100644 --- a/world/src/main.rs +++ b/world/src/main.rs @@ -18,7 +18,7 @@ pub mod mesh; pub mod physics; -use anyhow::{Result, bail}; +use anyhow::Result; use clap::Parser; use gltf::{Gltf, image::Source, import_buffers}; use image::{ImageReader, codecs::webp::WebPEncoder}; @@ -221,8 +221,15 @@ fn load_texture( File::open(path)?.read_to_end(&mut buf)?; Image(buf) } - _ => { - bail!("texture is external and has no mime type") + gltf::image::Source::Uri { + uri, + mime_type: None, + } => { + info!("{name} texture is {uri:?} and has no type"); + let path = path.join(uri); + let mut buf = Vec::new(); + File::open(path)?.read_to_end(&mut buf)?; + Image(buf) } }; diff --git a/world/src/physics.rs b/world/src/physics.rs index 82bb28f..bc39a11 100644 --- a/world/src/physics.rs +++ b/world/src/physics.rs @@ -1,3 +1,20 @@ +/* + wearechat - generic multiplayer game with voip + Copyright (C) 2025 metamuffin + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published by + the Free Software Foundation, version 3 of the License only. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . +*/ +use crate::mesh::node_transform_to_affine; use anyhow::{Result, anyhow}; use gltf::{Gltf, Node, buffer::Data, json::Value}; use log::info; @@ -7,8 +24,6 @@ use weareshared::{ vec3a, }; -use crate::mesh::node_transform_to_affine; - pub fn import_physics( gltf: &Gltf, node: &Node, -- cgit v1.2.3-70-g09d2