roblox_emulator: fixup CFrame
This commit is contained in:
@@ -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<rbx_types::CFrame> for CFrame{
|
||||
fn into(self)->rbx_types::CFrame{
|
||||
impl From<CFrame> 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),
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user