Beispiel #1
0
        ChildVertex FoldVertex(TileVertex vert, Vector2 uv, bool opposite = false)
        {
            ChildVertex v = FoldVertex(vert, opposite);

            v.uv = uv;
            return(v);
        }
Beispiel #2
0
        ChildVertex FoldVertex(TileVertex vert, bool opposite = false)
        {
            Vector3 foldOffset = new Vector3(b.position.x - a.position.x, 0f, b.position.y - a.position.y).normalized *chunk.world.EdgeFoldWidth;
            Vector3 axis       = a.ground[dir][2].Position - a.ground[dir][3].Position;
            float   angle      = Mathf.Atan2((b.Height - a.Height) * chunk.world.edgeFoldAngle, chunk.world.EdgeFoldWidth) * Mathf.Rad2Deg;

            foldOffset = Quaternion.AngleAxis(angle, axis) * foldOffset * (opposite ? -1 : 1);

            ChildVertex v = new ChildVertex(vert, foldOffset);

            return(v);
        }