Class VertexData
java.lang.Object
nl.colorize.multimedialib.renderer.webgl.VertexData
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
float[]
getColor()
float[]
float[]
float[]
getScale()
org.teavm.jso.webgl.WebGLTexture
org.teavm.jso.webgl.WebGLBuffer
org.teavm.jso.webgl.WebGLBuffer
int
int
hashCode()
void
setColor
(float[] color) void
void
setPosition
(float[] position) void
setPosition
(float x, float y) void
setRotation
(float[] rotation) void
setRotationInRadians
(float radians) void
setScale
(float[] scale) void
setScale
(float scaleX, float scaleY) void
setTexture
(org.teavm.jso.webgl.WebGLTexture texture) void
setTextureCoordinateBuffer
(org.teavm.jso.webgl.WebGLBuffer textureCoordinateBuffer) void
setVertexBuffer
(org.teavm.jso.webgl.WebGLBuffer vertexBuffer) void
setVertices
(int vertices) toString()
-
Constructor Details
-
VertexData
public VertexData()
-
-
Method Details
-
setPosition
public void setPosition(float x, float y) -
setColor
-
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
-
canEqual
-
hashCode
public int hashCode() -
toString
-