diff options
Diffstat (limited to 'world/src/main.rs')
-rw-r--r-- | world/src/main.rs | 31 |
1 files changed, 23 insertions, 8 deletions
diff --git a/world/src/main.rs b/world/src/main.rs index 1b863bb..c1289e2 100644 --- a/world/src/main.rs +++ b/world/src/main.rs @@ -56,8 +56,8 @@ use weareshared::{ helper::ReadWrite, packets::{Data, Object, Packet, Resource}, resources::{ - AnimationChannel, AnimationPart, ArmaturePart, EnvironmentPart, Image, LightPart, - ParticlesPart, Prefab, + AnimationChannel, AnimationPart, ArmaturePart, AvatarInfoPart, EnvironmentPart, Image, + LightPart, ParticlesPart, Prefab, }, store::ResourceStore, vec3a, @@ -109,6 +109,8 @@ pub struct Args { /// Wiggles joint index 6 #[arg(long)] debug_armature: bool, + #[arg(long)] + no_particles: bool, } fn main() -> Result<()> { @@ -278,7 +280,7 @@ fn main() -> Result<()> { } } } - if extras.get("particles") == Some(&Value::Bool(true)) { + if extras.get("particles") == Some(&Value::Bool(true)) && !args.no_particles { #[derive(Deserialize)] struct ParticlesAttr { density: Option<f32>, @@ -305,11 +307,11 @@ fn main() -> Result<()> { velocity_spread: attr.velocity_spread, })?; - // prefab - // .lock() - // .unwrap() - // .particles - // .push((transform_to_affine(node.transform()), part)); + prefab + .lock() + .unwrap() + .particles + .push((transform_to_affine(node.transform()), part)); } if let Some(light) = node.light() { @@ -402,6 +404,19 @@ fn main() -> Result<()> { })?); } + if vrm.camera_mount.is_some() + || vrm.camera_mount_offset.is_some() + || !vrm.bone_node_names.is_empty() + { + info!("avatar info enabled"); + prefab.avatar_info = Some(store.set(&AvatarInfoPart { + armature: Some(0), // TODO + camera_mount: vrm.camera_mount.map(|e| e as u32), + camera_mount_offset: vrm.camera_mount_offset, + ..Default::default() + })?); + } + prefab.armature = if armature.parent.as_ref().is_some_and(|a| !a.is_empty()) { vec![store.set(&armature)?] } else { |