コード例 #1
0
        private void TriangulateWaterfallInWater(
            Vector3 v1, Vector3 v2, Vector3 v3, Vector3 v4,
            float y1, float y2, float waterY, Vector3 indices)
        {
            v1.y = v2.y = y1;
            v3.y = v4.y = y2;
            v1   = HexMetrics.Perturb(v1);
            v2   = HexMetrics.Perturb(v2);
            v3   = HexMetrics.Perturb(v3);
            v4   = HexMetrics.Perturb(v4);
            var t = (waterY - y2) / (y1 - y2);

            v3 = Vector3.Lerp(v3, v1, t);
            v4 = Vector3.Lerp(v4, v2, t);
            Rivers.AddQuadUnperterbed(v1, v2, v3, v4);
            Rivers.AddQuadUV(0f, 1f, 0.8f, 1f);
            Rivers.AddQuadCellData(indices, weights1, weights2);
        }