|
JSR-184 Public Review Draft - Apr. 30, 2003. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--javax.microedition.m3d.Object3D | +--javax.microedition.m3d.VertexArray
An array of integer vectors representing vertex positions, normals, colors, or texture coordinates.
- 8 or 16 bit input
Field Summary |
Fields inherited from class javax.microedition.m3d.Object3D |
userObject |
Constructor Summary | |
VertexArray(int numVertices,
int numComponents,
int componentSize)
Constructs a new VertexArray with the given dimensions. |
Method Summary | |
void |
set(int startIndex,
int length,
byte[] values)
Copies in an array of 8-bit vertex attributes. |
void |
set(int startIndex,
int length,
short[] values)
Copies in an array of 16-bit vertex attributes. |
Methods inherited from class javax.microedition.m3d.Object3D |
addAnimationTrack, animate, clone, find, getAnimationTrack, getAnimationTrackCount, getReferences, getUserID, removeAnimationTrack, setUserID |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public VertexArray(int numVertices, int numComponents, int componentSize)
Constructs a new VertexArray with the given dimensions. The array
elements are initialized to zero. The elements can be set later with
either the 8-bit or the 16-bit version of the set
method,
depending on the component size selected here.
numVertices
- number of vertices in this VertexArray; must be [1, 65535]numComponents
- number of components per vertex; must be [2, 4]componentSize
- number of bytes per component; must be [1, 2]
java.lang.IllegalArgumentException
- if any of the parameters are outside of
their allowed rangesMethod Detail |
public void set(int startIndex, int length, short[] values)
Copies in an array of 16-bit vertex attributes. Positions, normals, and
texture coordinates can be set with this method, but colors must be set with
8-bit input. This method is available only if componentSize
,
specified in the constructor, is 2.
The vertex attributes are copied in starting from the first element of
the source array. The number of elements copied in is numComponents
* length
, where numComponents
is either 2, 3, or 4, as
specified at construction time. The source array must have at least that
many elements.
startIndex
- first vertex in this VertexArray to replacelength
- number of vertices in this VertexArray to replacevalues
- array of 16-bit integers to copy vertex attributes from
java.lang.IllegalStateException
- if this is not a 16-bit VertexArray
java.lang.IllegalArgumentException
- if values
is too short
java.lang.IllegalArgumentException
- if length
is negative
java.lang.IndexOutOfBoundsException
- if startIndex
or
startIndex+length
is out of bounds of this VertexArraypublic void set(int startIndex, int length, byte[] values)
Copies in an array of 8-bit vertex attributes. All vertex attributes can
be set with this method, including positions, normals, colors, and texture
coordinates. This method is available only if componentSize
,
specified in the constructor, is 1.
The vertex attributes are copied in starting from the first element of
the source array. The number of elements copied in is numComponents
* length
, where numComponents
is either 2, 3, or 4, as
specified at construction time. The source array must have at least that
many elements.
startIndex
- first vertex in this VertexArray to replacelength
- number of vertices in this VertexArray to replacevalues
- array of 8-bit integers to copy vertex attributes from
java.lang.IllegalStateException
- if this is not an 8-bit VertexArray
java.lang.IllegalArgumentException
- if values
is too short
java.lang.IllegalArgumentException
- if length
is negative
java.lang.IndexOutOfBoundsException
- if startIndex
or
startIndex+length
is out of bounds of this VertexArray
|
JSR-184 Public Review Draft - Apr. 30, 2003. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |