#get an entity's local rotation

3 messages · Page 1 of 1 (latest)

hollow wraith
#

Hi there, say I have a cube and I rotate it by 1.0 around the x axis then 1.0 around the y axis, how do I get a Vec3 back with 1.0, 1.0, 0.0?

stray wyvern
#

You can print it like this rs fn print_rot(query: Query<&mut Transform, (With<Cuuube>, Changed<Transform>)>) { for xform in query.iter() { println!("xform: {:?}", xform.rotation.to_euler(EulerRot::XYZ)) } }

#

You might be surprised by the result, however, if you apply euler angles individually