#How to simplify working with Transform manipulations?

2 messages · Page 1 of 1 (latest)

noble dove
#

I want to modify the Transform by moving it 10 units considering the rotation. Currently, I am using this code.

transform.translation - transform.rotation.mul_vec3(Vec3::new(0., 10., 0.))

Is it possible to simplify it?

pure pawn
#
transform.compute_affine().inverse().transform_vector3(YOUR_VECTOR)

It's not necessarily simpler but it requires slightly less complex thinking, and also supports scaling