From ef4e6995980a41fee9691fd9c038bcbf42d610e7 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Tue, 31 Dec 2024 23:42:43 -0800 Subject: [PATCH] implement VectorToWorldSpace --- src/runner/cframe.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/runner/cframe.rs b/src/runner/cframe.rs index e9f77c2..bab3c3e 100644 --- a/src/runner/cframe.rs +++ b/src/runner/cframe.rs @@ -146,6 +146,9 @@ impl mlua::UserData for CFrame{ this.0.matrix3.y_axis.z, this.0.matrix3.z_axis.z, ))); + methods.add_method("VectorToWorldSpace",|_,this,v:Vector3| + Ok(Vector3(this.0.transform_vector3a(v.0))) + ); //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)));