CFrame :components()

This commit is contained in:
Quaternions 2024-09-28 12:31:52 -07:00
parent 7780e1a3f1
commit 72874d450f

View File

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