bevy_magic_fx/
euler_transform.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
use bevy::prelude::*;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EulerTransform {
    pub translation: Vec3,
    pub rotation: Vec3,
    pub scale: Vec3,
}

impl EulerTransform {
    pub fn to_transform(self) -> Transform {

        
  
        Transform {
            translation: self.translation,
           rotation: Quat::from_euler(  //this is truncating or finding the shortest path! wrong 
                bevy::math::EulerRot::YXZ,
                self.rotation.x,
                self.rotation.y,
                self.rotation.z,
            ),
            scale: self.scale,
        }
    }
}