diff options
author | metamuffin <metamuffin@disroot.org> | 2025-02-08 02:13:29 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-02-08 02:13:29 +0100 |
commit | 8ec0c2a7dbe832e71971e2c68dc929f2c86c8bc8 (patch) | |
tree | 77be4095a0da5142a269bdbd81e2e313d678287a /shared/src | |
parent | a8e2b45074d5f3cd3bdfb1740cd0bee1dfae3277 (diff) | |
download | weareserver-8ec0c2a7dbe832e71971e2c68dc929f2c86c8bc8.tar weareserver-8ec0c2a7dbe832e71971e2c68dc929f2c86c8bc8.tar.bz2 weareserver-8ec0c2a7dbe832e71971e2c68dc929f2c86c8bc8.tar.zst |
mesh colliders
Diffstat (limited to 'shared/src')
-rw-r--r-- | shared/src/resources.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/shared/src/resources.rs b/shared/src/resources.rs index b3d9414..4cfc6fa 100644 --- a/shared/src/resources.rs +++ b/shared/src/resources.rs @@ -98,6 +98,7 @@ pub struct ArmaturePart { #[derive(Debug, Default, Clone)] pub struct CollisionPart { + pub name: Option<String>, pub restitution_coeff: Option<f32>, pub friction_kinetic: Option<f32>, pub friction_static: Option<f32>, @@ -105,7 +106,7 @@ pub struct CollisionPart { pub sh_sphere: Option<f32>, pub sh_cylinder: Option<(f32, f32, f32)>, pub sh_capsule: Option<(f32, f32, f32)>, - pub sh_convex_hull: Option<Resource>, + pub sh_convex_hull: Option<Resource<Vec<Vec3A>>>, pub sh_mesh: Option<(Resource<Vec<[u32; 3]>>, Resource<Vec<Vec3A>>)>, } @@ -158,6 +159,7 @@ impl ReadWrite for ArmaturePart { } impl ReadWrite for CollisionPart { fn write(&self, w: &mut dyn Write) -> Result<()> { + write_kv_opt(w, b"name", &self.name)?; write_kv_opt(w, b"restitution_coeff", &self.restitution_coeff)?; write_kv_opt(w, b"friction_kinetic", &self.friction_kinetic)?; write_kv_opt(w, b"friction_static", &self.friction_static)?; @@ -172,6 +174,7 @@ impl ReadWrite for CollisionPart { fn read(r: &mut dyn Read) -> Result<Self> { let mut s = Self::default(); read_kv_iter(r, |k, v| match k { + b"name" => Ok(s.name = Some(read_slice(v)?)), b"restitution_coeff" => Ok(s.restitution_coeff = Some(read_slice(v)?)), b"friction_kinetic" => Ok(s.friction_kinetic = Some(read_slice(v)?)), b"friction_static" => Ok(s.friction_static = Some(read_slice(v)?)), |