create constructors for VmcExtBonePos

This commit is contained in:
Cassandra de la Cruz-Munoz 2024-01-01 12:03:35 -05:00
parent d6d74353bd
commit be4d54e34c
Signed by: cassdlcm
GPG Key ID: BFEBACEA812DDA70

View File

@ -517,6 +517,20 @@ impl VmcMessage for VmcExtBonePos {
} }
} }
impl VmcExtBonePos {
fn new(name: String, transform: Transform3D) -> Result<Self, MessageCreationErr> {
return Ok(VmcExtBonePos{name, transform});
}
fn new_vmc_message(name: String, transform: Transform3D) -> Result<Box<dyn VmcMessage>, MessageCreationErr> {
let message = Self::new(name, transform);
if message.is_ok() {
let boxed_result: Box<dyn VmcMessage> = Box::new(message.ok().unwrap());
return Ok(boxed_result);
}
return Err(message.err().unwrap());
}
}
#[derive(Debug)] #[derive(Debug)]
struct VmcExtBlendVal { struct VmcExtBlendVal {
name: String, name: String,