Пример #1
0
            // GetPixelHeightAlpha - Float
            public override HeightAlpha GetPixelHeightAlpha(float x, float y)
            {
                if (!IsLoaded)
                {
                    if (OnDemandStorage.onDemandLogOnMissing)
                    {
                        Debug.Log("[OD] ERROR: getting pixelHeightAlphaF with unloaded map " + name + " of path " + Path + ", autoload = " + AutoLoad);
                    }
                    if (AutoLoad)
                    {
                        Load();
                    }
                    else
                    {
                        return(new HeightAlpha(0f, 0f));
                    }
                }

                BilinearCoords coords = ConstructBilinearCoords(x, y);

                return(HeightAlpha.Lerp(
                           HeightAlpha.Lerp(
                               GetPixelHeightAlpha(coords.xFloor, coords.yFloor),
                               GetPixelHeightAlpha(coords.xCeiling, coords.yFloor),
                               coords.u),
                           HeightAlpha.Lerp(
                               GetPixelHeightAlpha(coords.xFloor, coords.yCeiling),
                               GetPixelHeightAlpha(coords.xFloor, coords.yCeiling),
                               coords.u),
                           coords.v));
            }
Пример #2
0
            /// GetPixelHeightAlpha - Float
            public HeightAlpha GetPixelHeightAlpha(Single x, Single y)
            {
                BilinearCoords coords = ConstructBilinearCoords(x, y);

                return(HeightAlpha.Lerp(
                           HeightAlpha.Lerp(
                               GetPixelHeightAlpha(coords.xFloor, coords.yFloor),
                               GetPixelHeightAlpha(coords.xCeiling, coords.yFloor),
                               coords.u),
                           HeightAlpha.Lerp(
                               GetPixelHeightAlpha(coords.xFloor, coords.yCeiling),
                               GetPixelHeightAlpha(coords.xFloor, coords.yCeiling),
                               coords.u),
                           coords.v));
            }