implement VectorToWorldSpace

This commit is contained in:
Quaternions 2024-12-31 23:42:43 -08:00
parent f51c554492
commit ef4e699598

View File

@ -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)));