Пример #1
0
 /// <summary>
 /// 移除点对象
 /// </summary>
 /// <param name="point">点对象</param>
 public void Remove(C_Point point)
 {
     if (points.Contains(point))
     {
         points.Remove(point);
     }
 }
Пример #2
0
        /// <summary>
        /// 添加或插入新点对象,index为-1代表插入到最后
        /// </summary>
        /// <param name="point">点对象</param>
        /// <param name="index">插入索引</param>
        public void Add(C_Point point, int index = -1)
        {
            if (index == -1)
            {
                index = Count;
            }

            if (index >= 0 && index <= Count)
            {
                points.Insert(index, point);
            }
        }
Пример #3
0
 /// <summary>
 /// 获取世界坐标下的点
 /// </summary>
 public C_Point GetWorldSpacePoint(C_Point p)
 {
     return(new C_Point(GetWorldPosition(p), GetWorldRotation(p)));
 }
Пример #4
0
 /// <summary>
 /// 获取点旋转的世界坐标
 /// </summary>
 public Quaternion GetWorldRotation(C_Point p)
 {
     return(transform.rotation * p.rotation);
 }
Пример #5
0
 /// <summary>
 /// 获取点位置的世界坐标
 /// </summary>
 public Vector3 GetWorldPosition(C_Point p)
 {
     return(transform.rotation * p.position + transform.position);
 }