magnitude是精确距离,sqrMagnitude是节省CPU的粗略距离,精度有损失

magnitude是精确距离,sqrMagnitude是节省CPU的粗略距离,精度有损失

 

CubeA坐标 x:0 y:0.844 z:0

CubeC坐标 x:0 y:0 z:0

Vector3 aaa = A.position - C.position;

       Debug.DrawLine(A.position, C.position, Color.green);

        Debug.Log("aaa: " + aaa.ToString() + " magnitude:" + aaa.magnitude + " sqrMagnitude:" + aaa.sqrMagnitude);

 

posted on 2016-12-01 13:59  jiahuafu  阅读(3520)  评论(2编辑  收藏  举报

导航