From 5b1d5502d819441746e91cbc500fe65068f29a55 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Wed, 23 Apr 2025 01:01:19 -0700 Subject: [PATCH] roblox_emulator: fixup CFrame --- lib/roblox_emulator/src/runner/cframe.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/roblox_emulator/src/runner/cframe.rs b/lib/roblox_emulator/src/runner/cframe.rs index fa606228..62e3b7de 100644 --- a/lib/roblox_emulator/src/runner/cframe.rs +++ b/lib/roblox_emulator/src/runner/cframe.rs @@ -4,7 +4,7 @@ use super::number::Number; use super::vector3::Vector3; #[derive(Clone,Copy)] -pub struct CFrame(pub(crate)glam::Affine3A); +pub struct CFrame(glam::Affine3A); impl CFrame{ pub fn new( @@ -37,14 +37,14 @@ fn vec3_from_glam(v:rbx_types::Vector3)->glam::Vec3A{ glam::vec3a(v.x,v.y,v.z) } -impl Into for CFrame{ - fn into(self)->rbx_types::CFrame{ +impl From for rbx_types::CFrame{ + fn from(CFrame(cf):CFrame)->rbx_types::CFrame{ rbx_types::CFrame::new( - vec3_to_glam(self.0.translation), + vec3_to_glam(cf.translation), rbx_types::Matrix3::new( - vec3_to_glam(self.0.matrix3.x_axis), - vec3_to_glam(self.0.matrix3.y_axis), - vec3_to_glam(self.0.matrix3.z_axis), + vec3_to_glam(cf.matrix3.x_axis), + vec3_to_glam(cf.matrix3.y_axis), + vec3_to_glam(cf.matrix3.z_axis), ) ) }