Esempio n. 1
0
    public static uint PackSNorm(uint bitmask, float value)
    {
        float num = bitmask >> 1;

        value *= num;
        return((uint)((int)PackUtils.ClampAndRound(value, -num, num) & (int)bitmask));
    }
Esempio n. 2
0
    public static uint PackSigned(uint bitmask, float value)
    {
        float num = bitmask >> 1;
        float min = -num - 1f;

        return((uint)((int)PackUtils.ClampAndRound(value, min, num) & (int)bitmask));
    }
Esempio n. 3
0
            public static uint PackSNorm(uint bitmask, float value)
            {
                float single = (float)((float)(bitmask >> 1));

                value = value * single;
                return((uint)PackUtils.ClampAndRound(value, -single, single) & bitmask);
            }
Esempio n. 4
0
            public static uint PackSigned(uint bitmask, float value)
            {
                float single  = (float)((float)(bitmask >> 1));
                float single1 = -single - 1f;

                return((uint)PackUtils.ClampAndRound(value, single1, single) & bitmask);
            }
Esempio n. 5
0
 public static uint PackUnsigned(float bitmask, float value)
 {
     return((uint)PackUtils.ClampAndRound(value, 0f, bitmask));
 }
Esempio n. 6
0
 public static uint PackUNorm(float bitmask, float value)
 {
     value *= bitmask;
     return((uint)PackUtils.ClampAndRound(value, 0f, bitmask));
 }