Transform Component:
层次寻址:
public Transform root;
public Transform parent;
public int childCount;
public Transform GetChild(int index);
public int GetSiblingIndex();
public Transform Find(string name);
判断父子关系:
public bool IsChildOf(Transform parent);
设置层次关系:
public void SetParent(Transform parent);
public void SetParent(Transform parent, bool worldPositionStays);
public void SetSiblingIndex(int index);
public void SetAsFirstSibling();
public void SetAsLastSibling();
public void DetachChildren();
空间变换脏标记:
public bool hasChanged; //只有hasChanged=true时才会更新内部的矩阵变换
世界坐标系表示:
public Vector3 position;
public Vector3 lossyScale;(readonly)
public Quaternion rotation;
public Vector3 eulerAngles;
public Matrix4x4 localToWorldMatrix;
public Vector3 forward;
public Vector3 right;
public Vector3 up;
局部坐标系表示(相对父亲的偏移表示):
public Vector3 localPosition;
public Vector3 localScale;
public Quaternion localRotation;
public Vector3 localEulerAngles;
public Matrix4x4 worldToLocalMatrix;
世界-->局部/局部-->世界变换的方法:
public Vector3 TransformPoint(Vector3 position);
public Vector3 InverseTransformPoint(Vector3 position);
public Vector3 TransformVector(Vector3 vector);
public Vector3 InverseTransformVector(Vector3 vector);
public Vector3 TransformDirection(Vector3 direction);
public Vector3 InverseTransformDirection(Vector3 direction);
以轴为中心旋转一个点的方法:
public void RotateAround(Vector3 point, Vector3 axis, float angle);
设置Transform的世界位置和方向的方法:
public void SetPositionAndRotation(Vector3 position, Quaternion rotation);
指定相对坐标系运动的方法:
public void Translate(Vector3 translation, Space relativeTo = Space.Self);
public void Rotate(Vector3 eulerAngles, Space relativeTo = Space.Self);
LookAt变换,指哪打哪,经典的朝向变换:
public void LookAt(Transform target, Vector3 worldUp = Vector3.up);
Unity3D中显示Doom3场景:
目前仅能显示Doom3场景,下一步将Doom3 MD5骨骼动画移植到Unity3D系统中去,碰撞检测,任意多边形表面贴画(decal)等等都弄进去,想的到的都放到Unity中去,这几天尝试了一下Unity3D,感觉的确是非常棒,非常好用的引擎,棒棒的!!!