예제 #1
0
    ////////////////////////////////////////////////////////////////////////////////

    /// <summary>
    /// // Snaps a world point to a fog pixel. It returns the position
    /// </summary>
    /// <param name="fow"></param>
    /// <param name="worldpos"></param>
    /// <param name="offset"></param>
    /// <param name="resolution"></param>
    /// <param name="size"></param>
    /// <returns></returns>
    public static Vector2 SnapWorldPositionToNearestFogPixel(FogManager fow, Vector2 worldpos, Vector2 offset, Vector2_1 resolution, float size)
    {
        Vector2 fogpos = WorldToFog(worldpos, fow.MapOffset, fow.MapResolution, fow.MapSize);

        fogpos = SnapToNearestFogPixel(fogpos);
        return(FogToWorld(fogpos, fow.MapOffset, fow.MapResolution, fow.MapSize));
    }
예제 #2
0
    ////////////////////////////////////////////////////////////////////////////////

    public static Vector2 WorldToFog(Vector3 wpos, FogOfWarPlane plane, Vector2 offset, Vector2_1 resolution, float size)
    {
        return(WorldToFog(WorldToFogPlane(wpos, plane), offset, resolution, size));
    }