summaryrefslogtreecommitdiff
path: root/shared/src/resources.rs
diff options
context:
space:
mode:
Diffstat (limited to 'shared/src/resources.rs')
-rw-r--r--shared/src/resources.rs5
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)?)),