net.jinx.video.model
Class QuadStrip
java.lang.Object
net.jinx.video.model.MeshElement
net.jinx.video.model.QuadStrip
public final class QuadStrip
- extends MeshElement
MeshElement implementation that uses OpenGL's GL_QUAD_STRIP drawing mode to
draw quadrilateral shapes (quads). Vertices come in pairs. Each quad is
formed from the two most recent pairs.
API Stability: Stable.
Constructor Summary |
QuadStrip(float[][] vertices)
Constructs a QuadStrip with the given vertex array. |
Method Summary |
int |
draw(Context opt,
float[][] normals,
float[][] texCoord,
Coloration coloration,
int offset)
Draws the mesh, using the given array of Materials. |
Face[] |
getFaces()
Provides an array of all the Faces formed by this MeshElement. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
QuadStrip
public QuadStrip(float[][] vertices)
- Constructs a QuadStrip with the given vertex array.
- Parameters:
vertices
- the vertex array.
getFaces
public Face[] getFaces()
- Description copied from class:
MeshElement
- Provides an array of all the Faces formed by this MeshElement. This is
used to calculate per-vertex normals for lighting.
- Specified by:
getFaces
in class MeshElement
- Returns:
- the array of Face objects.
draw
public int draw(Context opt,
float[][] normals,
float[][] texCoord,
Coloration coloration,
int offset)
- Description copied from class:
MeshElement
- Draws the mesh, using the given array of Materials. One Material will
be used per vertex, unless there is only one, in which case the same
color will be used for each vertex. The offset into the array will be
incremented with each vertex and then returned once the Mesh has finished
drawing.
- Specified by:
draw
in class MeshElement
- Parameters:
opt
- the rendering options to use.normals
- vectors in a vertex array for per-vertex normals. If
null, this indicates that per-face normals should be used instead.coloration
- the Coloration object to use to color the vertices.offset
- the index into normal array to start at. This is also the
current vertex number.
- Returns:
- the index of the next normal to use, once this method has
completed. This is also the number of the next vertex.