Esempio n. 1
0
    private CoordSurfaceStatus lightValueAt(Coord chunkCo, Coord offsetStart, Vector3 nudgeV)
    {
        CoordLine testLine = new CoordLine();

        //radius is chunkLength
        for (int i = 1; i < Chunk.CHUNKLENGTH; ++i)
        {
            Coord nudgeC      = LightDataProvider.BlockCoordFromVectorBlockRadius(nudgeV, i);
            Coord totalOffset = offsetStart + nudgeC;

            //TEST
            if (i == 1)
            {
                testLine.start = CoordUtil.WorldCoordForChunkCoord(chunkCo) + totalOffset;
            }

            //END TEST

            // TODO: if already a result at this coord return that result.
            CoordSurfaceStatus surfaceStatus = m_noisePatch.coordIsAboveSurface(chunkCo, totalOffset);

            if (surfaceStatus == CoordSurfaceStatus.ABOVE_SURFACE || surfaceStatus == CoordSurfaceStatus.BELOW_SURFACE_SOLID)
            {
//				if (surfaceStatus == CoordSurfaceStatus.BELOW_SURFACE_SOLID) //TEST
//				{
//					testLine.end = CoordUtil.WorldCoordForChunkCoord(chunkCo) +  totalOffset;
//					debugLinesAssistant.addCoordLine(testLine.start, testLine.end); //TEST
//				}
                return(surfaceStatus);
            }
        }

        return(CoordSurfaceStatus.BELOW_SURFACE_TRANSLUCENT);
    }
Esempio n. 2
0
    public void addCoordLine(Coord start, Coord end)
    {
        CoordLine cl = new CoordLine();

        cl.start = start;
        cl.end   = end;

        lines.Add(cl);
    }