public static Polygon3D operator -(Polygon3D polygon, Vector3 vector) { Polygon3D clone = CloneUtil.CloneDeep(polygon); clone.AddWorldOffset(-vector); return(clone); }
/// <summary> /// 画多边形 /// </summary> /// <param name="mutiplyMatrix"></param> /// <param name="color"></param> /// <param name="points"></param> public static void HandlesPolygon(Matrix4x4 mutiplyMatrix, Color color, params Vector3[] points) { if (!Is_Handles_Enable) { return; } using (new HandlesColorScope(color)) { var polygon = new Polygon3D(points); polygon.MultiplyMatrix(mutiplyMatrix); polygon.GetDrawLineList().ForEach(kv => { HandlesLine(kv.Key, kv.Value, color); }); } }
/// <summary> /// 画多边形 /// </summary> /// <param name="mutiplyMatrix"></param> /// <param name="color"></param> /// <param name="duration">持续时间</param> /// <param name="isDepthTest"></param> /// <param name="points"></param> public static void DebugPolygon(Matrix4x4 mutiplyMatrix, Color color, float duration, bool isDepthTest, params Vector3[] points) { if (!Is_Debug_Enable) { return; } var polygon = new Polygon3D(points); polygon.MultiplyMatrix(mutiplyMatrix); polygon.GetDrawLineList().ForEach(kv => { DebugLine(kv.Key, kv.Value, color, duration, isDepthTest); }); }