예제 #1
0
        private static BoxTransition ComputeTransitions(
            ChunkManager Data,
            VoxelHandle V,
            VoxelType Type)
        {
            if (Type.Transitions == VoxelType.TransitionType.Horizontal)
            {
                var value = ComputeTransitionValueOnPlane(
                    VoxelHelpers.EnumerateManhattanNeighbors2D(V.Coordinate)
                    .Select(c => new VoxelHandle(Data, c)), Type);

                return(new BoxTransition()
                {
                    Top = (TransitionTexture)value
                });
            }
            else
            {
                var transitionFrontBack = ComputeTransitionValueOnPlane(VoxelHelpers.EnumerateManhattanNeighbors2D_Z(V.Coordinate)
                                                                        .Select(c => new VoxelHandle(Data, c)),
                                                                        Type);

                var transitionLeftRight = ComputeTransitionValueOnPlane(VoxelHelpers.EnumerateManhattanNeighbors2D_X(V.Coordinate)
                                                                        .Select(c => new VoxelHandle(Data, c)),
                                                                        Type);

                return(new BoxTransition()
                {
                    Front = (TransitionTexture)transitionFrontBack,
                    Back = (TransitionTexture)transitionFrontBack,
                    Left = (TransitionTexture)transitionLeftRight,
                    Right = (TransitionTexture)transitionLeftRight
                });
            }
        }