diff options
author | metamuffin <metamuffin@disroot.org> | 2025-01-10 20:49:28 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-01-10 20:49:28 +0100 |
commit | cb46b760ae8d4aeaa0e92a9c313927ffdef27873 (patch) | |
tree | 6558cb19352b13ee3006fc1574ca82271e5a2398 /world | |
parent | 3ac853862b5965c1ebfb10b12fb35cf5c671232f (diff) | |
download | weareserver-cb46b760ae8d4aeaa0e92a9c313927ffdef27873.tar weareserver-cb46b760ae8d4aeaa0e92a9c313927ffdef27873.tar.bz2 weareserver-cb46b760ae8d4aeaa0e92a9c313927ffdef27873.tar.zst |
fix interleaved vertex arrays
Diffstat (limited to 'world')
-rw-r--r-- | world/src/main.rs | 13 | ||||
-rw-r--r-- | world/src/physics.rs | 19 |
2 files changed, 27 insertions, 5 deletions
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 <https://www.gnu.org/licenses/>. +*/ +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, |