diff options
author | metamuffin <metamuffin@disroot.org> | 2025-02-11 00:18:11 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-02-11 00:18:11 +0100 |
commit | 81a191e702abcf77b73b9163ce43c4527a01ce13 (patch) | |
tree | 1f0d0dfbea037a11e041295a0dea22f0c5a67a72 /world/src/mesh.rs | |
parent | 847542d358e65ea850cfeebdd92218aa60e34261 (diff) | |
download | weareserver-81a191e702abcf77b73b9163ce43c4527a01ce13.tar weareserver-81a191e702abcf77b73b9163ce43c4527a01ce13.tar.bz2 weareserver-81a191e702abcf77b73b9163ce43c4527a01ce13.tar.zst |
rushed implementation of VRM thirdPersonOnly
Diffstat (limited to 'world/src/mesh.rs')
-rw-r--r-- | world/src/mesh.rs | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/world/src/mesh.rs b/world/src/mesh.rs index 6fff9c4..ebecfa5 100644 --- a/world/src/mesh.rs +++ b/world/src/mesh.rs @@ -14,7 +14,7 @@ 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::{Args, TextureCache, load_texture}; +use crate::{Args, TextureCache, load_texture, vrm::VrmInfo}; use anyhow::Result; use gltf::{Mesh, Node, buffer::Data}; use log::{debug, info, warn}; @@ -37,6 +37,7 @@ pub fn import_mesh( args: &Args, texture_cache: &TextureCache, joint_index_map: &BTreeMap<(usize, u16), u32>, + vrm: &VrmInfo, ) -> Result<()> { for p in mesh.primitives() { let name = mesh.name().or(node.name()).map(|e| e.to_owned()); @@ -348,6 +349,12 @@ pub fn import_mesh( None }; + let hint_hide_first_person = if vrm.hide_first_person.contains(&node.index()) { + Some(()) + } else { + None + }; + let armature = node.skin().map(|_| 0); let mesh = store.set(&MeshPart { @@ -383,6 +390,7 @@ pub fn import_mesh( tex_transmission, tex_thickness, tex_occlusion, + hint_hide_first_person, // not supported by gltf hint_mirror: None, // TODO hint_static: None, // TODO Set when instancing |