...
dir = Vector3()
...
input_movement_vector = input_movement_vector.normalized()
dir += -cam_xform.basis.z.normalized() * input_movement_vector.y
...
Why can the product of input_movement_vector.y and cam_xform.basis.z be assigned(+=) to vector dir?
And, why can cam_xform.basis.z.normalized() be used? I saw kidscancode said “you can’t normalize only the x component”.
I can’t understand that.
“Normalizing” means setting a vector’s length to 1.
transform.basis is made up of three vectors, x, y, and z, which represent the object’s local coordinate axes. So basis.z is a Vector3. See Transform for details.
That said, basis vectors are already normalized, so it’s not necessary to use normalized() on them.
Thank you for your answer.
But if I understand correctly, you say “basis.z” doesn’t need to use “normalized()”, and docs does have code like that, which means DOCS is wrong, right?
pass0 | 2019-06-20 15:48
Nobody’s perfect.
Normalizing an already normalized vector doesn’t hurt, it just doesn’t do anything.