ドキュメント

Unity Engine

Unity Engine

InverseTransformDirections

Transforms multiple directions from world space to local space writing the transformed positions to a possibly different location. The opposite of TransformHandle.TransformDirections.
読み終わるまでの所要時間 2 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule

InverseTransformDirections(ReadOnlySpan<Vector3>, Span<Vector3>)

Transforms multiple directions from world space to local space writing the transformed positions to a possibly different location. The opposite of TransformHandle.TransformDirections.
public void InverseTransformDirections(ReadOnlySpan<Vector3> directions, Span<Vector3> transformedDirections)

Parameters

The directions to be transformed, these vectors are not modified by the function unless the
transformedDirections
span overlaps.

transformedDirections

Receives the transformed directions, must be the same length as the
directions
span otherwise an exception will be thrown. If this span overlaps
directions
other than representing the exact same elements the behaviour is undefined.

Remarks

This operation is not affected by scale or position of the transform. The transformed vectors have the same lengths as the originals.
If you need the inverse operation to transform from local space to world space you can use TransformHandle.TransformDirections
You should use TransformHandle.InverseTransformPoints if the vectors represent positions in space rather than directions.

InverseTransformDirections(Span<Vector3>)

Transforms multiple directions from world space to local space overwriting each original position with the transformed version. The opposite of TransformHandle.TransformDirections.
public void InverseTransformDirections(Span<Vector3> directions)

Parameters

directions

The directions to be transformed, each is replaced by the transformed version.

Remarks

This operation is not affected by scale or position of the transform. The transformed vectors have the same lengths as the originals.
If you need the inverse operation to transform from local space to world space you can use TransformHandle.TransformDirections
You should use TransformHandle.InverseTransformPoints if the vectors represent positions in space rather than directions.