Class Util

    • Constructor Summary

      Constructors 
      Constructor Description
      Util()  
    • Constructor Detail

      • Util

        public Util()
    • Method Detail

      • ceil

        protected static int ceil​(int a,
                                  int b)
        Return ceiling of integer division
        Parameters:
        a -
        b -
        Returns:
        int
      • normalize

        protected static float[] normalize​(float[] v)
        Normalize vector
        Parameters:
        v -
        Returns:
        float[]
      • cross

        protected static void cross​(float[] v1,
                                    float[] v2,
                                    float[] result)
        Calculate cross-product
        Parameters:
        v1 -
        v2 -
        result -
      • compPerPix

        protected static int compPerPix​(int format)
        Method compPerPix.
        Parameters:
        format -
        Returns:
        int
      • nearestPower

        protected static int nearestPower​(int value)
        Method nearestPower.

        Compute the nearest power of 2 number. This algorithm is a little strange, but it works quite well.

        Parameters:
        value -
        Returns:
        int
      • bytesPerPixel

        protected static int bytesPerPixel​(int format,
                                           int type)
        Method bytesPerPixel.
        Parameters:
        format -
        type -
        Returns:
        int
      • glGetIntegerv

        protected static int glGetIntegerv​(int what)
        Convenience method for returning an int, rather than getting it out of a buffer yourself.
        Parameters:
        what -
        Returns:
        int