Class MeshRecorder
java.lang.Object
lol.trq.helios.mesh.MeshRecorder
Records vertices of one format through the matching sink, to upload once as a
StaticMesh. Recording
touches no GL state and can run on any thread; build(MeshRenderer) must run on the render thread.
MeshRecorder rec = new MeshRecorder(MeshFormat.TEXTURED);
rec.textured().vertex(...)...;
StaticMesh mesh = rec.build(helios.meshes());
helios.meshes().texture(tex).draw(mesh, model);
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild(MeshRenderer renderer) Uploads the complete quads recorded so far.lines()Returns the sink for aMeshFormat.LINErecorder.intReturns the number of complete quads recorded; a line counts as one.quads()Returns the sink for aMeshFormat.COLORrecorder.textured()Returns the sink for aMeshFormat.TEXTUREDrecorder.
-
Constructor Details
-
MeshRecorder
Creates an empty recorder.- Parameters:
format- the vertex format; only the matching sink accepts vertices
-
-
Method Details
-
quads
Returns the sink for aMeshFormat.COLORrecorder.- Returns:
- the sink
- Throws:
IllegalStateException- if the recorder has another format
-
lines
Returns the sink for aMeshFormat.LINErecorder.- Returns:
- the sink
- Throws:
IllegalStateException- if the recorder has another format
-
textured
Returns the sink for aMeshFormat.TEXTUREDrecorder.- Returns:
- the sink
- Throws:
IllegalStateException- if the recorder has another format
-
quadCount
public int quadCount()Returns the number of complete quads recorded; a line counts as one.- Returns:
- the quad count
-
build
Uploads the complete quads recorded so far. The recorder can keep recording or be discarded.- Parameters:
renderer- the renderer the mesh will be drawn with- Returns:
- the mesh
-