Version: 2023.2

Transform.TransformVector

切换到手册
public Vector3 TransformVector (Vector3 vector);

描述

vector 从本地空间变换到世界空间。

该操作不受变换的位置的影响,但受缩放影响。 返回的矢量可能具有与 vector 不同的长度。

If you need the inverse operation to transform from world space to local space you can use Transform.InverseTransformVector

If you need to transform many vectors at once consider using Transform.TransformVectors instead as it is much faster than repeatedly calling this function.

Additional resources:Transform.TransformVectors, Transform.InverseTransformVector, Transform.TransformPoint, Transform.TransformDirection.


public Vector3 TransformVector (float x, float y, float z);

描述

将矢量 zzz 从本地空间变换到世界空间。

该操作不受变换的位置的影响,但受缩放影响。 返回的矢量可能具有与 vector 不同的长度。

If you need the inverse operation to transform from world space to local space you can use Transform.InverseTransformVector

If you need to transform many vectors at once consider using Transform.TransformVectors instead as it is much faster than repeatedly calling this function.

Additional resources:Transform.TransformVectors, Transform.InverseTransformVector, Transform.TransformPoint, Transform.TransformDirection.