Transform
- childCount
- DetachChildren
- eulerAngles
- Find
- forward
- InverseTransformDirection
- InverseTransformPoint
- IsChildOf
- localEulerAngles
- localPosition
- localRotation
- localScale
- localToWorldMatrix
- LookAt
- lossyScale
- parent
- position
- right
- root
- RotateAround
- Rotate
- rotation
- TransformDirection
- TransformPoint
- Translate
- up
- worldToLocalMatrix
Transform.InverseTransformDirection 变换反方向
function InverseTransformDirection (direction : Vector3) : Vector3
Description描述
Transforms a direction from world space to local space. The opposite of Transform.TransformDirection.
变换方向从世界坐标到自身坐标。和Transform.TransformDirection相反。
This operation is unaffected by scale.
此操作不受缩放影响。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
private Vector3 relative;
public void Awake() {
relative = transform.InverseTransformDirection(Vector3.forward);
Debug.Log(relative);
}
}
// transform the world forward into local space:
//变换世界向前坐标变为自身坐标
private var relative : Vector3;
relative = transform.InverseTransformDirection(Vector3.forward);
Debug.Log(relative);
• function InverseTransformDirection (x : float, y : float, z : float) : Vector3
Description描述
Transforms the direction x, y, z from world space to local space. The opposite of Transform.TransformDirection.
变换方向x, y, z 从世界坐标到自身坐标,和Transform.TransformDirection相反。
This operation is unaffected by scale.
此操作不受缩放影响。
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
private Vector3 relative;
public void Awake() {
relative = transform.InverseTransformDirection(0, 0, 1);
Debug.Log(relative);
}
}
最后修改:2010年12月19日 Sunday 16:00