Class VertexData

java.lang.Object
nl.colorize.multimedialib.renderer.webgl.VertexData

public class VertexData extends Object
Data structure that collects all properties necessary for rendering 2D polygon graphics using WebGL. Internally, this class stores all properties in the "native" format expected by WebGL. For example, colors are represented using an [r, g, b, a] array rather than a ColorRGB instance. However, convenience methods are provided to convert other property representations into this format.

Note this class is purely a data structure and does not perform any WebGL operations itself (since the WebGL context is effectively global and therefore benefits from central control by the renderer).

  • Constructor Details

    • VertexData

      public VertexData()
  • Method Details

    • setPosition

      public void setPosition(float x, float y)
    • setColor

      public void setColor(ColorRGB rgb, float alpha)
    • setRotationInRadians

      public void setRotationInRadians(float radians)
    • setScale

      public void setScale(float scaleX, float scaleY)
    • getVertices

      public int getVertices()
    • getVertexBuffer

      public org.teavm.jso.webgl.WebGLBuffer getVertexBuffer()
    • getTexture

      public org.teavm.jso.webgl.WebGLTexture getTexture()
    • getTextureCoordinateBuffer

      public org.teavm.jso.webgl.WebGLBuffer getTextureCoordinateBuffer()
    • getColor

      public float[] getColor()
    • getPosition

      public float[] getPosition()
    • getRotation

      public float[] getRotation()
    • getScale

      public float[] getScale()
    • setVertices

      public void setVertices(int vertices)
    • setVertexBuffer

      public void setVertexBuffer(org.teavm.jso.webgl.WebGLBuffer vertexBuffer)
    • setTexture

      public void setTexture(org.teavm.jso.webgl.WebGLTexture texture)
    • setTextureCoordinateBuffer

      public void setTextureCoordinateBuffer(org.teavm.jso.webgl.WebGLBuffer textureCoordinateBuffer)
    • setColor

      public void setColor(float[] color)
    • setPosition

      public void setPosition(float[] position)
    • setRotation

      public void setRotation(float[] rotation)
    • setScale

      public void setScale(float[] scale)
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • canEqual

      protected boolean canEqual(Object other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object