public class RenderObject extends java.lang.Object implements Versioned, DisposeObservable, Disposable
Modifier and Type | Class and Description |
---|---|
static class |
RenderObject.RenderObjectIdentifier
Used for uniquely identifying a RenderObject, and checking
validity (can be safely shared)
|
static class |
RenderObject.RenderObjectState
Stores exposable state of the object, tracking the
current primitive group indices.
|
static class |
RenderObject.RenderObjectVersion
Keeps track of versions for detecting changes.
|
Constructor and Description |
---|
RenderObject() |
Modifier and Type | Method and Description |
---|---|
int |
addColor(byte[] rgba)
Adds an indexable color by reference.
|
int |
addColor(byte r,
byte g,
byte b,
byte a)
Adds an indexable color
|
int |
addColor(java.awt.Color color)
Adds an indexable color
|
int |
addColor(float[] rgba)
Adds an indexable color.
|
int |
addColor(float r,
float g,
float b,
float a)
Adds an indexable color
|
int |
addColor(int r,
int g,
int b,
int a)
Adds an indexable color
|
void |
addLine(float[] v0,
float[] v1)
Creates a line primitive between two new vertices defined
at the supplied locations.
|
void |
addLine(int v0idx,
int v1idx)
Creates a line primitive between the supplied vertices.
|
void |
addLineLoop(int... vidxs)
Creates a set of connected line segments between neighboring vertices
in the supplied list of vertex indices.
|
void |
addLineLoop(int vStart,
int vEnd)
Creates a set of line primitives between neighboring vertices as specified
by the supplied vertex range.
|
void |
addLines(int... vidxs)
Creates a set of line primitives between pairs of vertices as specified
by the supplied set of vertex indices.
|
void |
addLines(int vStart,
int vEnd)
Creates a set of line primitives between pairs of vertices as specified
by the supplied vertex range.
|
void |
addLines(java.lang.Iterable<int[]> lines)
Creates a set of line primitives between the supplied pairs of vertices.
|
void |
addLineStrip(int... vidxs)
Creates a set of connected line segments between neighboring vertices
in the supplied list of vertex indices.
|
void |
addLineStrip(int vStart,
int vEnd)
Creates a set of connected line primitives between neighboring vertices
as specified by the supplied vertex range.
|
int |
addNormal(float[] nrm)
Adds an indexable 3D normal by reference.
|
int |
addNormal(float nx,
float ny,
float nz)
Adds an indexable 3D normal.
|
int |
addNormal(Vector3d nrm)
Adds an indexable 3D normal
|
void |
addPoint(float[] v)
Creates a point primitive at the supplied position.
|
void |
addPoint(int vidx)
Creates a point primitive at the supplied vertex.
|
void |
addPoints(int... vidxs)
Creates point primitives at the supplied vertex locations.
|
void |
addPoints(java.lang.Iterable<float[]> pnts)
Creates a set of vertices and point primitives at the supplied positions.
|
int |
addPosition(float[] xyz)
Adds a position by reference.
|
int |
addPosition(float px,
float py,
float pz)
Adds an indexable 3D position
|
int |
addPosition(Vector3d pos)
Adds an indexable 3D position
|
int |
addTextureCoord(float[] xy)
Adds an indexable 2D texture coordinate by reference.
|
int |
addTextureCoord(float tx,
float ty)
Adds an indexable 2D texture coordinate
|
int |
addTextureCoord(Vector2d xy)
Adds an indexable 2D texture coordinate
|
void |
addTriangle(float[] v0,
float[] v1,
float[] v2)
Creates a triangle primitive between three new vertices defined at the
supplied locations.
|
void |
addTriangle(int v0idx,
int v1idx,
int v2idx)
Creates a triangle primitive between supplied vertices (CCW order).
|
void |
addTriangleFan(int... vidxs)
Creates a set of triangle primitives forming a fan using the
supplied by vertex indices.
|
void |
addTriangleFan(int vStart,
int vEnd)
Creates a set of triangle primitives forming a fan using the
supplied vertex range.
|
void |
addTriangles(int... vidxs)
Creates a set of triangle primitives between triples of vertices as
supplied by vertex indices.
|
void |
addTriangles(int vStart,
int vEnd)
Creates a set of triangle primitives between triples of vertices as
supplied by the given vertex range.
|
void |
addTriangles(java.lang.Iterable<int[]> tris)
Creates a set of triangle primitives between supplied triples of
vertices.
|
void |
addTriangleStrip(int... vidxs)
Creates a set of triangle primitives forming a strip using the
supplied by vertex indices.
|
void |
addTriangleStrip(int vStart,
int vEnd)
Creates a set of triangle primitives forming a strip using the
supplied by vertex range.
|
int |
addVertex()
Adds a vertex using the currently active position, normal, color,
and texture coordinate (if available).
|
int |
addVertex(int pidx)
Adds a vertex using the supplied position index.
|
int |
addVertex(int pidx,
int nidx)
Adds a vertex using the supplied position and normal indices.
|
int |
addVertex(int pidx,
int nidx,
int cidx,
int tidx)
Adds a vertex using the position, normal, color and texture
coordinates identified by index number.
|
void |
beginBuild(Renderer.DrawMode mode)
Start automatically building primitives for every added vertex,
using a specified mode.
|
void |
clearAll()
Clears everything in the RenderObject, allowing it to be
recreated.
|
void |
clearPrimitives()
Clears all primitive groups, allowing them to be recreated.
|
int |
createLineGroup()
Creates a new group of lines that can be rendered.
|
int |
createPointGroup()
Creates a new group of points that can be rendered.
|
int |
createTriangleGroup()
Creates a new group of triangles that can be rendered.
|
void |
dispose()
Signal a destruction of the object.
|
void |
endBuild()
End automatically building primitives.
|
void |
ensureColorCapacity(int cap)
Hint for ensuring sufficient storage for colors
|
void |
ensureLineCapacity(int cap)
Hint for ensuring sufficient storage for lines
|
void |
ensureNormalCapacity(int cap)
Hint for ensuring sufficient storage for normals
|
void |
ensurePointCapacity(int cap)
Hint for ensuring sufficient storage for points
|
void |
ensurePositionCapacity(int cap)
Hint for ensuring sufficient storage for positions
|
void |
ensureTextureCoordCapacity(int cap)
Hint for ensuring sufficient storage for texture coordinates
|
void |
ensureTriangleCapacity(int cap)
Hint for ensuring sufficient storage for triangles
|
void |
ensureVertexCapacity(int cap)
Hint for ensuring sufficient storage for vertices
|
Renderer.DrawMode |
getBuildMode() |
byte[] |
getColor(int cidx)
Retrieves the color at the supplied index.
|
java.util.List<byte[]> |
getColors()
Retrieves the full list of Colors.
|
int |
getColorsVersion()
Returns the latest colors version number,
for use in detecting if changes are present.
|
int |
getCurrentColor()
Returns the index associated with the current color, or -1
if there is no current color.
|
int |
getCurrentNormal()
Returns the index associated with the current normal, or -1
if there is no current normal.
|
int |
getCurrentPosition()
Returns the index associated with the current position, or -1
if there is no current position.
|
int |
getCurrentTextureCoord()
Returns the index associated with the current texture coordinate, or -1
if there is no current texture coordinate.
|
RenderObject.RenderObjectIdentifier |
getDisposeObserver()
Return an "observer" object that tracks the dispose status
of this object.
|
RenderObject.RenderObjectIdentifier |
getIdentifier()
Returns a special object to be used as a unique identifier for this
RenderObject.
|
int |
getLineGroupIdx()
Returns the index of the currently active line group.
|
int[] |
getLines()
Returns a list of vertex indices of all line primitives defined
in the current group.
|
int[] |
getLines(int lgroup)
Returns a list of vertex indices of all point primitives defined
in the requested group.
|
int |
getLineStride() |
int |
getLinesVersion()
Returns the latest lines version number,
for use in detecting if changes are present.
|
float[] |
getNormal(int nidx)
Retrieves the normal at the supplied index.
|
java.util.List<float[]> |
getNormals()
Retrieves the full list of normals.
|
int |
getNormalsVersion()
Returns the latest triangles version number,
for use in detecting if changes are present.
|
int |
getPointGroupIdx()
Returns the index of the currently active point group.
|
int[] |
getPoints()
Returns a list of vertex indices of all point primitives defined
in the current group.
|
int[] |
getPoints(int pgroup)
Returns a list of vertex indices of all point primitives defined
in a given point group.
|
int |
getPointStride()
Returns the stride used within the point buffer.
|
int |
getPointsVersion()
Returns the latest points version number,
for use in detecting if changes are present.
|
float[] |
getPosition(int pidx)
Retrieves the position at the supplied index.
|
java.util.List<float[]> |
getPositions()
Retrieves the full list of positions.
|
int |
getPositionsVersion()
Returns the latest positions version number,
for use in detecting if changes are present.
|
RenderObject.RenderObjectState |
getStateInfo() |
float[] |
getTextureCoord(int tidx)
Retrieves the texture coordinate at the supplied index.
|
java.util.List<float[]> |
getTextureCoords()
Retrieves the full list of texture coordinates.
|
int |
getTextureCoordsVersion()
Returns the latest texture coordinates version number,
for use in detecting if changes are present.
|
int |
getTriangleGroupIdx()
Returns the index of the currently active triangle group.
|
int[] |
getTriangles()
Returns a list of vertex indices of all triangle primitives defined
in the current group.
|
int[] |
getTriangles(int tgroup)
Returns a list of vertex indices of all triangle primitives defined
in the requested group.
|
int |
getTriangleStride() |
int |
getTrianglesVersion()
Returns the latest triangles version number,
for use in detecting if changes are present.
|
int |
getVersion()
Retrieves the version of the object, for use in detecting
whether any information has changed since last use.
|
RenderObject.RenderObjectVersion |
getVersionInfo()
Returns an immutable copy of all version information in this RenderObject,
safe for sharing between threads.
|
int[] |
getVertexBuffer()
Raw pointer to vertex data (mainly used by renderers).
|
byte[] |
getVertexColor(int vidx)
Returns the color of the supplied vertex
|
int |
getVertexColorOffset() |
float[] |
getVertexNormal(int vidx)
Returns the normal of the supplied vertex
|
int |
getVertexNormalOffset() |
float[] |
getVertexPosition(int vidx)
Returns the position of the supplied vertex
|
int |
getVertexPositionOffset() |
int |
getVertexStride() |
float[] |
getVertexTextureCoord(int vidx)
Returns the texture coordinate of the supplied vertex
|
int |
getVertexTextureCoordOffset() |
int |
getVerticesVersion()
Returns the latest vertices version number,
for use in detecting if changes are present.
|
boolean |
hasColors()
Whether or not any colors have been defined.
|
boolean |
hasLines()
Indicates whether any line primitives have been defined
|
boolean |
hasNormals()
Whether or not any normals have been defined.
|
boolean |
hasPoints()
Indicates whether any point primitives have been defined.
|
boolean |
hasPositions()
Whether or not any positions have been defined.
|
boolean |
hasTextureCoords()
Whether or not any texture coordinates have been defined.
|
boolean |
hasTriangles()
Indicates whether any triangle primitives have been defined.
|
boolean |
isDisposed()
Whether or not the current object is disposed
|
boolean |
isTransient()
Checks if the render object is labelled as "transient".
|
boolean |
isValid()
Returns whether or not this RenderObject is valid.
|
void |
lineGroup(int setIdx)
Sets the current active line group for rendering.
|
void |
notifyColorsModified() |
void |
notifyLinesModified()
Informs the render object that lines have been modified outside of its
control.
|
void |
notifyNormalsModified()
Indicate that the normals have been modified.
|
void |
notifyPointsModified()
Informs the render object that points have been modified outside of its control.
|
void |
notifyPositionsModified()
Indicate that the positions have been modified.
|
void |
notifyTextureCoordsModified() |
void |
notifyTrianglesModified()
Informs the render object that triangles have been modified outside of its control.
|
int |
numColors()
Number of colors defined
|
int |
numLineGroups()
The number of line groups available.
|
int |
numLines()
Number of line primitives defined
|
int |
numLines(int lgroup)
Number of line primitives defined in a group.
|
int |
numNormals()
Number of normals defined.
|
int |
numPointGroups()
The number of point groups available.
|
int |
numPoints()
Number of point primitives defined.
|
int |
numPoints(int pgroup)
Number of point primitives defined in a point group.
|
int |
numPositions()
Number of positions defined.
|
int |
numTextureCoords()
Number of texture coordinates defined.
|
int |
numTriangleGroups()
The number of triangle groups available.
|
int |
numTriangles()
Number of triangle primitives defined.
|
int |
numTriangles(int tgroup)
Number of triangle primitives defined in a group.
|
int |
numVertices()
Returns the number of vertices, as defined by unique sets of position,
normal, color, and texture indices.
|
void |
pointGroup(int setIdx)
Sets the current active point group for rendering.
|
void |
readLock()
Locks object, prevents further modifications until object is unlocked
|
void |
readUnlock()
Locks object, prevents further modifications until object is unlocked
|
void |
setColor(int cidx,
byte[] rgba)
Updates the values of the color, by reference, with index cidx.
|
void |
setColor(int cidx,
byte r,
byte g,
byte b,
byte a)
Updates the values of the color with index cidx.
|
void |
setColor(int cidx,
java.awt.Color color)
Updates the values of the color with index cidx.
|
void |
setColor(int cidx,
float r,
float g,
float b,
float a)
Updates the values of the color with index cidx.
|
void |
setColor(int cidx,
int r,
int g,
int b,
int a)
Updates the values of the color with index cidx.
|
void |
setCurrentColor(int cidx)
Sets the current color to be used in following vertices
based on color index.
|
void |
setCurrentNormal(int nidx)
Sets the current normal to be used in following vertices,
based on normal index.
|
void |
setCurrentPosition(int pidx)
Sets the current position to be used in following vertices,
based on position index.
|
void |
setCurrentTextureCoord(int tidx)
Sets the current texture coordinates to be used in following vertices,
based on texture coordinate index.
|
void |
setNormal(int nidx,
float[] nrm)
Updates the new normal, by reference, with index nidx.
|
void |
setNormal(int nidx,
float nx,
float ny,
float nz)
Updates the values of the normal with index nidx.
|
void |
setNormal(int nidx,
Vector3d nrm)
Updates the values of the normal with index nidx.
|
void |
setPosition(int pidx,
float[] pos)
Updates the values of the position with index pidx, to the provide
values by reference.
|
void |
setPosition(int pidx,
float px,
float py,
float pz)
Updates the values of the position with index pidx.
|
void |
setPosition(int pidx,
Vector3d pos)
Updates the values of the position with index pidx.
|
void |
setTextureCoord(int tidx,
float[] xy)
Updates the values of the texture coordinate with index tidx by reference.
|
void |
setTextureCoord(int tidx,
float tx,
float ty)
Updates the values of the texture coordinate with index tidx.
|
void |
setTextureCoord(int tidx,
Vector2d xy)
Updates the values of the texture coordinate with index tidx.
|
void |
setTransient(boolean set)
Sets or clears the transient state of the render object.
|
void |
setVertex(int vidx,
int pidx,
int nidx,
int cidx,
int tidx)
Modify the attribute indices of a particular vertex
|
void |
triangleGroup(int setIdx)
Sets the current active triangle group for rendering.
|
int |
vertex(float[] xyz)
Add a vertex at the supplied position using the currently active
normal, color and texture coordinate (if available).
|
int |
vertex(float px,
float py,
float pz)
Add a vertex at the supplied position, using the currently active
normal, color and texture coordinate (if available).
|
int |
vertex(Vector3d pos)
Add a vertex at the supplied position, using the currently active
normal, color and texture coordinate (if available).
|
public void readLock()
public void readUnlock()
public RenderObject.RenderObjectIdentifier getIdentifier()
public RenderObject.RenderObjectVersion getVersionInfo()
public RenderObject.RenderObjectState getStateInfo()
public void ensurePositionCapacity(int cap)
cap
- capacitypublic int addPosition(float px, float py, float pz)
px
- x coordinatepy
- y coordinatepz
- z coordinatepublic int addPosition(float[] xyz)
notifyPositionsModified()
. Otherwise, renderers are free to assume the
positions have not changed.xyz
- position vectorpublic int addPosition(Vector3d pos)
pos
- coordinates of the positionpublic void setCurrentPosition(int pidx)
pidx
- index of a previously added positionpublic int getCurrentPosition()
public void setPosition(int pidx, float px, float py, float pz)
pidx
- position to modifypx
- x coordinatepy
- y coordinatepz
- z coordinatepublic void setPosition(int pidx, Vector3d pos)
pidx
- position to modifypos
- new position coordinatespublic void setPosition(int pidx, float[] pos)
pidx
- position to modifypos
- new position values by referencepublic boolean hasPositions()
public int numPositions()
public float[] getPosition(int pidx)
notifyPositionsModified()
must be manually called.pidx
- position indexpublic java.util.List<float[]> getPositions()
public void notifyPositionsModified()
public int getPositionsVersion()
public void ensureNormalCapacity(int cap)
cap
- capacitypublic int addNormal(float nx, float ny, float nz)
nx
- x componentny
- y componentnz
- z componentpublic int addNormal(float[] nrm)
notifyNormalsModified()
.
Otherwise, renders are free to assume there has been
no change.nrm
- the normal to addpublic int addNormal(Vector3d nrm)
nrm
- coordinates of the normalpublic void setCurrentNormal(int nidx)
nidx
- index of a previously added normalpublic int getCurrentNormal()
public void setNormal(int nidx, float nx, float ny, float nz)
nidx
- normal to modifynx
- x componentny
- y componentnz
- z componentpublic void setNormal(int nidx, Vector3d nrm)
nidx
- normal to modifynrm
- new normal coordinatespublic void setNormal(int nidx, float[] nrm)
nidx
- normal to modifynrm
- the new normalpublic boolean hasNormals()
public int numNormals()
public float[] getNormal(int nidx)
notifyNormalsModified()
must
be called.nidx
- normal indexpublic java.util.List<float[]> getNormals()
notifyNormalsModified()
must be called.public void notifyNormalsModified()
public int getNormalsVersion()
public void ensureColorCapacity(int cap)
cap
- capacitypublic int addColor(byte r, byte g, byte b, byte a)
r
- redg
- greenb
- bluea
- alphapublic int addColor(int r, int g, int b, int a)
r
- red [0-255]g
- green [0-255]b
- blue [0-255]a
- alpha [0-255]public int addColor(float r, float g, float b, float a)
r
- red [0-1]g
- green [0-1]b
- blue [0-1]a
- alpha [0-1]public int addColor(float[] rgba)
rgba
- 4-float vectorpublic int addColor(java.awt.Color color)
color
- color from which RGBA values are determinespublic int addColor(byte[] rgba)
notifyColorsModified()
must
be called. Otherwise, renderers are free to assume the render object
has not changed.rgba
- {red, green, blue, alpha}public void notifyColorsModified()
public void setCurrentColor(int cidx)
cidx
- index of a previously added colorpublic int getCurrentColor()
public void setColor(int cidx, byte r, byte g, byte b, byte a)
cidx
- color to modifyr
- redg
- greenb
- bluea
- alphapublic void setColor(int cidx, int r, int g, int b, int a)
cidx
- color to modifyr
- redg
- greenb
- bluea
- alphapublic void setColor(int cidx, float r, float g, float b, float a)
cidx
- color to modifyr
- redg
- greenb
- bluea
- alphapublic void setColor(int cidx, java.awt.Color color)
cidx
- color to modifycolor
- new color valuespublic void setColor(int cidx, byte[] rgba)
cidx
- color to modifyrgba
- {red, green, blue, alpha}public boolean hasColors()
public int numColors()
public byte[] getColor(int cidx)
notifyColorsModified()
must be manually called.cidx
- color indexpublic java.util.List<byte[]> getColors()
public int getColorsVersion()
public void ensureTextureCoordCapacity(int cap)
cap
- capacitypublic int addTextureCoord(float tx, float ty)
tx
- x coordinatety
- y coordinatepublic int addTextureCoord(Vector2d xy)
xy
- texture coordinatespublic int addTextureCoord(float[] xy)
notifyTextureCoordsModified()
must be called. Otherwise,
renderers are free to assume the render object has not changed.xy
- x and y coordinate valuespublic void notifyTextureCoordsModified()
public void setCurrentTextureCoord(int tidx)
tidx
- index of a previously added texture coordinatepublic int getCurrentTextureCoord()
public void setTextureCoord(int tidx, float tx, float ty)
tidx
- coordinate indextx
- x coordinatety
- y coordinatepublic void setTextureCoord(int tidx, Vector2d xy)
tidx
- coordinate indexxy
- new texture coordinatespublic void setTextureCoord(int tidx, float[] xy)
tidx
- coordinate indexxy
- x and y coordinate valuespublic boolean hasTextureCoords()
public int numTextureCoords()
public float[] getTextureCoord(int tidx)
notifyTextureCoordsModified()
must be manually called.tidx
- position indexpublic java.util.List<float[]> getTextureCoords()
public int getTextureCoordsVersion()
public void ensureVertexCapacity(int cap)
cap
- capacitypublic int addVertex()
public int addVertex(int pidx)
public int addVertex(int pidx, int nidx)
public int addVertex(int pidx, int nidx, int cidx, int tidx)
pidx
- position indexnidx
- normal indexcidx
- color indextidx
- texture coordinate indexpublic int vertex(float px, float py, float pz)
px
- x coordinatepy
- y coordinatepz
- z coordinatepublic int vertex(Vector3d pos)
pos
- position coordinatespublic int vertex(float[] xyz)
xyz
- x, y, and z coordinate valuesaddPosition(float[])
,
addVertex(int)
public void setVertex(int vidx, int pidx, int nidx, int cidx, int tidx)
vidx
- index of vertex to modifypidx
- new position indexnidx
- new normal indexcidx
- new color indextidx
- new texture coordinate indexpublic int numVertices()
public float[] getVertexPosition(int vidx)
public float[] getVertexNormal(int vidx)
public byte[] getVertexColor(int vidx)
public float[] getVertexTextureCoord(int vidx)
public int[] getVertexBuffer()
getVertexStride()
.public int getVertexStride()
public int getVertexPositionOffset()
public int getVertexNormalOffset()
public int getVertexColorOffset()
public int getVertexTextureCoordOffset()
public int getVerticesVersion()
public void beginBuild(Renderer.DrawMode mode)
endBuild()
.mode
- mode for adding consecutive primitivespublic void endBuild()
public Renderer.DrawMode getBuildMode()
public void notifyPointsModified()
public void addPoint(int vidx)
vidx
- vertex index for pointpublic void addPoints(int... vidxs)
vidxs
- array of vertex indices at which to create point primitives.public void addPoint(float[] v)
v
- array of length 3 (x,y,z)public void addPoints(java.lang.Iterable<float[]> pnts)
pnts
- positions at which points and vertices should be createdaddPoint(float[])
public boolean hasPoints()
public int numPoints()
public int[] getPoints()
getPointStride()
.public int getPointStride()
getPoints(int)
public void ensurePointCapacity(int cap)
cap
- capacitypublic int createPointGroup()
pointGroup(int)
public void pointGroup(int setIdx)
setIdx
- index of active point group.public int getPointGroupIdx()
public int numPointGroups()
public int numPoints(int pgroup)
public int[] getPoints(int pgroup)
getPointStride()
.pgroup
- point grouppublic int getPointsVersion()
public void notifyLinesModified()
public void addLine(int v0idx, int v1idx)
v0idx
- vertex index for start of linev1idx
- vertex index for end of linepublic void addLines(int... vidxs)
vidxs
- vertex indices, in pairs, defining line segments.public void addLines(int vStart, int vEnd)
vStart
- starting vertexvEnd
- ending vertexpublic void addLines(java.lang.Iterable<int[]> lines)
lines
- int pairs of vertex indices defining line segments.public void addLineStrip(int... vidxs)
vidxs
- vertex indices specifying connectivitypublic void addLineStrip(int vStart, int vEnd)
vStart
- starting vertexvEnd
- ending vertexpublic void addLineLoop(int... vidxs)
vidxs
- vertex indices specifying connectivitypublic void addLineLoop(int vStart, int vEnd)
vStart
- starting vertexvEnd
- ending vertexpublic void addLine(float[] v0, float[] v1)
v0
- length 3 array for position of starting vertex (x,y,z)v1
- length 3 array for position of ending vertex (x,y,z)public boolean hasLines()
public int numLines()
public int[] getLines()
getLineStride()
.public int getLineStride()
public void ensureLineCapacity(int cap)
cap
- capacitypublic int createLineGroup()
lineGroup(int)
public void lineGroup(int setIdx)
setIdx
- index of active line group.public int getLineGroupIdx()
public int numLineGroups()
public int numLines(int lgroup)
public int[] getLines(int lgroup)
getPointStride()
.lgroup
- line group indexpublic int getLinesVersion()
public void notifyTrianglesModified()
public void addTriangle(int v0idx, int v1idx, int v2idx)
v0idx
- first vertexv1idx
- second vertexv2idx
- third vertexpublic void addTriangles(int... vidxs)
vidxs
- vertex indices, in triples, defining triangles.public void addTriangles(int vStart, int vEnd)
vStart
- starting vertex indexvEnd
- ending vertex indexpublic void addTriangleFan(int... vidxs)
vidxs
- vertex indices defining triangles.public void addTriangleFan(int vStart, int vEnd)
vStart
- starting vertex indexvEnd
- ending vertex indexpublic void addTriangleStrip(int... vidxs)
vidxs
- vertex indices defining triangles.public void addTriangleStrip(int vStart, int vEnd)
vStart
- starting vertex indexvEnd
- ending vertex indexpublic void addTriangles(java.lang.Iterable<int[]> tris)
tris
- int triples of vertex indices defining triangles (CCW)public void addTriangle(float[] v0, float[] v1, float[] v2)
v0
- {x,y,z} position of first vertexv1
- {x,y,z} position of second vertexv2
- {x,y,z} position of third vertexpublic boolean hasTriangles()
public int numTriangles()
public int[] getTriangles()
getTriangleStride()
.public int getTriangleStride()
getTriangles()
public void ensureTriangleCapacity(int cap)
cap
- capacitypublic int createTriangleGroup()
triangleGroup(int)
public void triangleGroup(int setIdx)
setIdx
- index of active triangle group.public int getTriangleGroupIdx()
public int numTriangleGroups()
public int numTriangles(int tgroup)
public int[] getTriangles(int tgroup)
getTriangleStride()
.tgroup
- triangle group indexpublic int getTrianglesVersion()
public void clearPrimitives()
public void clearAll()
public int getVersion()
getVersion
in interface Versioned
public boolean isValid()
true
if this RenderObject is validpublic void setTransient(boolean set)
set
- if true
, sets this object to be transientpublic boolean isTransient()
public void dispose()
dispose
in interface Disposable
public boolean isDisposed()
DisposeObservable
isDisposed
in interface DisposeObservable
public RenderObject.RenderObjectIdentifier getDisposeObserver()
DisposeObservable
getDisposeObserver
in interface DisposeObservable