From 72874d450fb834536e1cac8f50545d5170bf3fa3 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Sat, 28 Sep 2024 12:31:52 -0700 Subject: [PATCH] CFrame :components() --- src/runner/cframe.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/runner/cframe.rs b/src/runner/cframe.rs index 8536204..d3c0890 100644 --- a/src/runner/cframe.rs +++ b/src/runner/cframe.rs @@ -19,7 +19,20 @@ impl mlua::UserData for CFrame{ } fn add_methods<'lua,M:mlua::UserDataMethods<'lua,Self>>(methods:&mut M){ - //methods.add_method("area",|_,this,()|Ok(this.length*this.width)); + methods.add_method("components",|_,this,()|Ok(( + this.0.translation.x, + this.0.translation.y, + this.0.translation.z, + this.0.matrix3.x_axis.x, + this.0.matrix3.y_axis.x, + this.0.matrix3.z_axis.x, + this.0.matrix3.x_axis.y, + this.0.matrix3.y_axis.y, + this.0.matrix3.z_axis.y, + this.0.matrix3.x_axis.z, + this.0.matrix3.y_axis.z, + this.0.matrix3.z_axis.z, + ))); //methods.add_meta_method(mlua::MetaMethod::Mul,|_,this,val:&Vector3|Ok(Vector3(this.0.matrix3*val.0+this.0.translation))); methods.add_meta_function(mlua::MetaMethod::Mul,|_,(this,val):(Self,Self)|Ok(Self(this.0*val.0)));