コード例 #1
0
        public bool FlipChanelOnLine(ColorChanel chan, MeshPoint other)
        {
            float val = 1;

            if (Cfg.makeVerticesUniqueOnEdgeColoring)
            {
                EditedMesh.GiveLineUniqueVerticesRefreshTriangleListing(new LineData(this, other));
            }

            foreach (var u in vertices)
            {
                if (u.ConnectedTo(other))
                {
                    val *= chan.GetValueFrom(u.color) * chan.GetValueFrom(u.GetConnectedUVinVertex(other).color);
                }
            }

            val = (val > 0.9f) ? 0 : 1;

            SetChanel(chan, other, val);
            other.SetChanel(chan, this, val);

            EditedMesh.Dirty = true;

            return(val == 1);
        }