Class TextureCoords


  • public class TextureCoords
    extends Object
    Specifies texture coordinates for a rectangular area of a texture. Note that some textures are inherently flipped vertically from OpenGL's standard coordinate system. This class takes care of this vertical flip so that the "bottom" and "top" coordinates may sometimes be reversed. From the point of view of code rendering textured polygons, it can always map the bottom and left texture coordinates from the TextureCoords to the lower left point of the textured polygon and achieve correct results.
    • Constructor Summary

      Constructors 
      Constructor Description
      TextureCoords​(float left, float bottom, float right, float top)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      float bottom()
      Returns the bottommost (y) texture coordinate of this rectangle.
      float[] getST_LB_RB_LT_RT​(float[] d, int d_off, float ss, float ts)
      Transfers {s * ss, t * ts} from this object into the given float[8+d_off] in the following order:
      float left()
      Returns the leftmost (x) texture coordinate of this rectangle.
      float right()
      Returns the rightmost (x) texture coordinate of this rectangle.
      float top()
      Returns the topmost (y) texture coordinate of this rectangle.
      String toString()  
    • Constructor Detail

      • TextureCoords

        public TextureCoords​(float left,
                             float bottom,
                             float right,
                             float top)
    • Method Detail

      • getST_LB_RB_LT_RT

        public float[] getST_LB_RB_LT_RT​(float[] d,
                                         int d_off,
                                         float ss,
                                         float ts)
        Transfers {s * ss, t * ts} from this object into the given float[8+d_off] in the following order:
           left,  bottom
           right, bottom
           left,  top
           right  top
         
      • left

        public float left()
        Returns the leftmost (x) texture coordinate of this rectangle.
      • right

        public float right()
        Returns the rightmost (x) texture coordinate of this rectangle.
      • bottom

        public float bottom()
        Returns the bottommost (y) texture coordinate of this rectangle.
      • top

        public float top()
        Returns the topmost (y) texture coordinate of this rectangle.