|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.neovisionaries.android.opengl.Attribute
public class Attribute
OpenGL ES vertex attribute.
// E X A M P L E 1 // Create an Attribute instance of the vertex array at // the index '0'.Attribute
attr = newAttribute
(0); // Set a constant value (1.0f, 0.0f, 0.0f, 1.0f). // As a side effect, the vertex array for the index '0' // is disabled by glDisableVertexAttribArray() because // otherwise the data set here will not take effect. attr.set
(1.0f, 0.0f, 0.0f, 1.0f); // Get a shader program instance from somewhere.Program
program = ...; // Feed data to the attribute variable 'a_color'. program.setAttribute
("a_color", attr);
// E X A M P L E 2 // Prepare position data in the form of (x0, y0, z0), // (x1, y1, z1), (x2, y2, z2), ... FloatBuffer positions = ...; // Get a shader program instance from somewhere.Program
program = ...; // Get an Attribute instance for an attribute variable // named 'a_position'.Attribute
attr = program.getAttribute
("a_position"); // Feed data to the attribute variable. As side effects, // the vertex array for the index of the attribute is enabled // by glEnableVertexAttribArray() and the vertex array buffer // is unbound by calling glBindBuffer(GL_ARRAY_BUFFER, 0) // because otherwise the data set here will not take effect. attr.setArray3
(positions);
// E X A M P L E 3 // Prepare position data in the form of (x0, y0, z0), // (x1, y1, z1), (x2, y2, z2), ... FloatBuffer positions = ...; // Store the position data to the vertex array buffer.ArrayBuffer
ab = newArrayBuffer()
; ab.setData
(positions); // Get an Attribute instance from somewhere.Attribute
attr = ...; // Make the Attribute instance use the vertex array buffer. // As side effects, the vertex array for the index of the // attribute is enabled by glEnableVertexAttribArray() and // the vertex array buffer is bound by calling ab.bind() // which is equivalent to glBindBuffer(GL_ARRAY_BUFFER, ab.getId()). // // Note that the method call below will throw UnsupportedOperationException // in Android 2.2 (API Level 8) because android.opengl.GLES20 // class does not have glVertexAttribPointer() method whose // last argument is 'int offset' although it should have. attr.setArray3
(ab);
Constructor Summary | |
---|---|
Attribute(int index)
A constructor with a vertex attribute index. |
Method Summary | |
---|---|
int |
getIndex()
Get the index of this vertex attribute. |
Attribute |
set(float x)
Set a constant value to this vertex attribute by glVertexAttrib1f(). |
Attribute |
set(float[] values)
Set a constant value to this vertex attribute. |
Attribute |
set(FloatBuffer values)
Set a constant value to this vertex attribute. |
Attribute |
set(float x,
float y)
Set a constant value to this vertex attribute by glVertexAttrib2f(). |
Attribute |
set(float x,
float y,
float z)
Set a constant value to this vertex attribute by glVertexAttrib3f(). |
Attribute |
set(float x,
float y,
float z,
float w)
Set a constant value to this vertex attribute by glVertexAttrib4f(). |
Attribute |
set1(float[] values)
This method is an alias of set1 (values, 0). |
Attribute |
set1(float[] values,
int offset)
Set a constant value to this vertex attribute by glVertexAttrib1fv(). |
Attribute |
set1(FloatBuffer values)
Set a constant value to this vertex attribute by glVertexAttrib1fv(). |
Attribute |
set2(float[] values)
This method is an alias of set2 (values, 0). |
Attribute |
set2(float[] values,
int offset)
Set a constant value to this vertex attribute by glVertexAttrib2fv(). |
Attribute |
set2(FloatBuffer values)
Set a constant value to this vertex attribute by glVertexAttrib2fv(). |
Attribute |
set3(float[] values)
This method is an alias of set3 (values, 0). |
Attribute |
set3(float[] values,
int offset)
Set a constant value to this vertex attribute by glVertexAttrib3fv(). |
Attribute |
set3(FloatBuffer values)
Set a constant value to this vertex attribute by glVertexAttrib3fv(). |
Attribute |
set4(float[] values)
This method is an alias of set4 (values, 0). |
Attribute |
set4(float[] values,
int offset)
Set a constant value to this vertex attribute by glVertexAttrib4fv(). |
Attribute |
set4(FloatBuffer values)
Set a constant value to this vertex attribute by glVertexAttrib4fv(). |
Attribute |
setArray(ArrayBuffer values,
AttrDataSize size)
This method is an alias of setArray (values, size, null, false, 0, 0). |
Attribute |
setArray(ArrayBuffer values,
AttrDataSize size,
AttrDataType type)
This method is an alias of setArray (values, size, type,
false, 0, 0). |
Attribute |
setArray(ArrayBuffer values,
AttrDataSize size,
AttrDataType type,
boolean normalized)
This method is an alias of setArray (values, size, type,
normalized, 0, 0). |
Attribute |
setArray(ArrayBuffer values,
AttrDataSize size,
AttrDataType type,
boolean normalized,
int stride)
This method is an alias of setArray (values, size, type,
normalized, stride, 0). |
Attribute |
setArray(ArrayBuffer values,
AttrDataSize size,
AttrDataType type,
boolean normalized,
int stride,
int offset)
Set a vertex array to this vertex attribute by glVertexAttribPointer(). |
Attribute |
setArray(ArrayBuffer values,
AttrDataSize size,
boolean normalized)
This method is an alias of setArray (values, size, null,
normalized, 0, 0). |
Attribute |
setArray(ArrayBuffer values,
AttrDataSize size,
boolean normalized,
int stride)
This method is an alias of setArray (values, size, null,
normalized, stride, 0). |
Attribute |
setArray(ArrayBuffer values,
AttrDataSize size,
boolean normalized,
int stride,
int offset)
This method is an alias of setArray (values, size, null,
normalized, stride, 0). |
Attribute |
setArray(Buffer values,
AttrDataSize size,
AttrDataType type)
This method is an alias of setArray (values, size, type, false, 0). |
Attribute |
setArray(Buffer values,
AttrDataSize size,
AttrDataType type,
boolean normalized)
This method is an alias of setArray (values, size, type, normalized, 0). |
Attribute |
setArray(Buffer values,
AttrDataSize size,
AttrDataType type,
boolean normalized,
int stride)
Set a vertex array to this vertex attribute by glVertexAttribPointer(). |
Attribute |
setArray(FloatBuffer values,
AttrDataSize size)
This method is an alias of setArray (values, size,
AttrDataType.FLOAT , false, 0). |
Attribute |
setArray(FloatBuffer values,
AttrDataSize size,
int stride)
This method is an alias of setArray (values, size,
AttrDataType.FLOAT , false, stride). |
Attribute |
setArray1(ArrayBuffer values)
This method is an alias of setArray (values, AttrDataSize.ONE ,
null, false, 0, 0). |
Attribute |
setArray1(ArrayBuffer values,
AttrDataType type)
This method is an alias of setArray (values, AttrDataSize.ONE ,
type, false, 0, 0). |
Attribute |
setArray1(ArrayBuffer values,
AttrDataType type,
boolean normalized)
This method is an alias of setArray (values, AttrDataSize.ONE ,
type, normalized, 0, 0). |
Attribute |
setArray1(ArrayBuffer values,
AttrDataType type,
boolean normalized,
int stride)
This method is an alias of setArray (values, AttrDataSize.ONE ,
type, normalized, stride, 0). |
Attribute |
setArray1(ArrayBuffer values,
AttrDataType type,
boolean normalized,
int stride,
int offset)
This method is an alias of setArray (values, AttrDataSize.ONE ,
type, normalized, stride, offset). |
Attribute |
setArray1(ArrayBuffer values,
boolean normalized)
This method is an alias of setArray (values, AttrDataSize.ONE ,
null, normalized, 0, 0). |
Attribute |
setArray1(ArrayBuffer values,
boolean normalized,
int stride)
This method is an alias of setArray (values, AttrDataSize.ONE ,
null, normalized, stride, 0). |
Attribute |
setArray1(ArrayBuffer values,
boolean normalized,
int stride,
int offset)
This method is an alias of setArray (values, AttrDataSize.ONE ,
null, normalized, stride, offset). |
Attribute |
setArray1(Buffer values,
AttrDataType type)
This method is an alias of setArray (values, AttrDataSize.ONE ,
type, false, 0). |
Attribute |
setArray1(Buffer values,
AttrDataType type,
boolean normalized)
This method is an alias of setArray (values, AttrDataSize.ONE ,
type, normalized, 0). |
Attribute |
setArray1(Buffer values,
AttrDataType type,
boolean normalized,
int stride)
This method is an alias of setArray (values, AttrDataSize.ONE ,
type, normalized, stride). |
Attribute |
setArray1(FloatBuffer values)
This method is an alias of setArray (values, AttrDataSize.ONE ,
AttrDataType.FLOAT , false, 0). |
Attribute |
setArray1(FloatBuffer values,
int stride)
This method is an alias of setArray (values, AttrDataSize.ONE ,
AttrDataType.FLOAT , false, stride). |
Attribute |
setArray2(ArrayBuffer values)
This method is an alias of setArray (values, AttrDataSize.TWO ,
null, false, 0, 0). |
Attribute |
setArray2(ArrayBuffer values,
AttrDataType type)
This method is an alias of setArray (values, AttrDataSize.TWO ,
type, false, 0, 0). |
Attribute |
setArray2(ArrayBuffer values,
AttrDataType type,
boolean normalized)
This method is an alias of setArray (values, AttrDataSize.TWO ,
type, normalized, 0, 0). |
Attribute |
setArray2(ArrayBuffer values,
AttrDataType type,
boolean normalized,
int stride)
This method is an alias of setArray (values, AttrDataSize.TWO ,
type, normalized, stride, 0). |
Attribute |
setArray2(ArrayBuffer values,
AttrDataType type,
boolean normalized,
int stride,
int offset)
This method is an alias of setArray (values, AttrDataSize.TWO ,
type, normalized, stride, offset). |
Attribute |
setArray2(ArrayBuffer values,
boolean normalized)
This method is an alias of setArray (values, AttrDataSize.TWO ,
null, normalized, 0, 0). |
Attribute |
setArray2(ArrayBuffer values,
boolean normalized,
int stride)
This method is an alias of setArray (values, AttrDataSize.TWO ,
null, normalized, stride, 0). |
Attribute |
setArray2(ArrayBuffer values,
boolean normalized,
int stride,
int offset)
This method is an alias of setArray (values, AttrDataSize.TWO ,
null, normalized, stride, offset). |
Attribute |
setArray2(Buffer values,
AttrDataType type)
This method is an alias of setArray (values, AttrDataSize.TWO ,
type, false, 0). |
Attribute |
setArray2(Buffer values,
AttrDataType type,
boolean normalized)
This method is an alias of setArray (values, AttrDataSize.TWO ,
type, normalized, 0). |
Attribute |
setArray2(Buffer values,
AttrDataType type,
boolean normalized,
int stride)
This method is an alias of setArray (values, AttrDataSize.TWO ,
type, normalized, stride). |
Attribute |
setArray2(FloatBuffer values)
This method is an alias of setArray (values, AttrDataSize.TWO ,
AttrDataType.FLOAT , false, 0). |
Attribute |
setArray2(FloatBuffer values,
int stride)
This method is an alias of setArray (values, AttrDataSize.TWO ,
AttrDataType.FLOAT , false, stride). |
Attribute |
setArray3(ArrayBuffer values)
This method is an alias of setArray (values, AttrDataSize.THREE ,
null, false, 0, 0). |
Attribute |
setArray3(ArrayBuffer values,
AttrDataType type)
This method is an alias of setArray (values, AttrDataSize.THREE ,
type, false, 0, 0). |
Attribute |
setArray3(ArrayBuffer values,
AttrDataType type,
boolean normalized)
This method is an alias of setArray (values, AttrDataSize.THREE ,
type, normalized, 0, 0). |
Attribute |
setArray3(ArrayBuffer values,
AttrDataType type,
boolean normalized,
int stride)
This method is an alias of setArray (values, AttrDataSize.THREE ,
type, normalized, stride, 0). |
Attribute |
setArray3(ArrayBuffer values,
AttrDataType type,
boolean normalized,
int stride,
int offset)
This method is an alias of setArray (values, AttrDataSize.THREE ,
type, normalized, stride, offset). |
Attribute |
setArray3(ArrayBuffer values,
boolean normalized)
This method is an alias of setArray (values, AttrDataSize.THREE ,
null, normalized, 0, 0). |
Attribute |
setArray3(ArrayBuffer values,
boolean normalized,
int stride)
This method is an alias of setArray (values, AttrDataSize.THREE ,
null, normalized, stride, 0). |
Attribute |
setArray3(ArrayBuffer values,
boolean normalized,
int stride,
int offset)
This method is an alias of setArray (values, AttrDataSize.THREE ,
null, normalized, stride, offset). |
Attribute |
setArray3(Buffer values,
AttrDataType type)
This method is an alias of setArray (values, AttrDataSize.THREE ,
type, false, 0). |
Attribute |
setArray3(Buffer values,
AttrDataType type,
boolean normalized)
This method is an alias of setArray (values, AttrDataSize.THREE ,
type, normalized, 0). |
Attribute |
setArray3(Buffer values,
AttrDataType type,
boolean normalized,
int stride)
This method is an alias of setArray (values, AttrDataSize.THREE ,
type, normalized, stride). |
Attribute |
setArray3(FloatBuffer values)
This method is an alias of setArray (values, AttrDataSize.THREE ,
AttrDataType.FLOAT , false, 0). |
Attribute |
setArray3(FloatBuffer values,
int stride)
This method is an alias of setArray (values, AttrDataSize.THREE ,
AttrDataType.FLOAT , false, stride). |
Attribute |
setArray4(ArrayBuffer values)
This method is an alias of setArray (values, AttrDataSize.FOUR ,
null, false, 0, 0). |
Attribute |
setArray4(ArrayBuffer values,
AttrDataType type)
This method is an alias of setArray (values, AttrDataSize.FOUR ,
type, false, 0, 0). |
Attribute |
setArray4(ArrayBuffer values,
AttrDataType type,
boolean normalized)
This method is an alias of setArray (values, AttrDataSize.FOUR ,
type, normalized, 0, 0). |
Attribute |
setArray4(ArrayBuffer values,
AttrDataType type,
boolean normalized,
int stride)
This method is an alias of setArray (values, AttrDataSize.FOUR ,
type, normalized, stride, 0). |
Attribute |
setArray4(ArrayBuffer values,
AttrDataType type,
boolean normalized,
int stride,
int offset)
This method is an alias of setArray (values, AttrDataSize.FOUR ,
type, normalized, stride, offset). |
Attribute |
setArray4(ArrayBuffer values,
boolean normalized)
This method is an alias of setArray (values, AttrDataSize.FOUR ,
null, normalized, 0, 0). |
Attribute |
setArray4(ArrayBuffer values,
boolean normalized,
int stride)
This method is an alias of setArray (values, AttrDataSize.FOUR ,
null, normalized, stride, 0). |
Attribute |
setArray4(ArrayBuffer values,
boolean normalized,
int stride,
int offset)
This method is an alias of setArray (values, AttrDataSize.FOUR ,
null, normalized, stride, offset). |
Attribute |
setArray4(Buffer values,
AttrDataType type)
This method is an alias of setArray (values, AttrDataSize.FOUR ,
type, false, 0). |
Attribute |
setArray4(Buffer values,
AttrDataType type,
boolean normalized)
This method is an alias of setArray (values, AttrDataSize.FOUR ,
type, normalized, 0). |
Attribute |
setArray4(Buffer values,
AttrDataType type,
boolean normalized,
int stride)
This method is an alias of setArray (values, AttrDataSize.FOUR ,
type, normalized, stride). |
Attribute |
setArray4(FloatBuffer values)
This method is an alias of setArray (values, AttrDataSize.FOUR ,
AttrDataType.FLOAT , false, 0). |
Attribute |
setArray4(FloatBuffer values,
int stride)
This method is an alias of setArray (values, AttrDataSize.FOUR ,
AttrDataType.FLOAT , false, stride). |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Attribute(int index)
index
- A vertex attribute index.Method Detail |
---|
public int getIndex()
public Attribute set(float x)
x
-
public Attribute set(float x, float y)
x
- y
-
public Attribute set(float x, float y, float z)
x
- y
- z
-
public Attribute set(float x, float y, float z, float w)
x
- y
- z
- w
-
public Attribute set1(float[] values, int offset)
values
- offset
-
public Attribute set1(float[] values)
set1
(values, 0).
values
-
set1(float[], int)
public Attribute set1(FloatBuffer values)
values
-
public Attribute set2(float[] values, int offset)
values
- offset
-
public Attribute set2(float[] values)
set2
(values, 0).
values
-
set2(float[], int)
public Attribute set2(FloatBuffer values)
values
-
public Attribute set3(float[] values, int offset)
values
- offset
-
public Attribute set3(float[] values)
set3
(values, 0).
values
-
set3(float[], int)
public Attribute set3(FloatBuffer values)
values
-
public Attribute set4(float[] values, int offset)
values
- offset
-
public Attribute set4(float[] values)
set4
(values, 0).
values
-
set4(float[], int)
public Attribute set4(FloatBuffer values)
values
-
public Attribute set(float[] values)
values.length | Method to call |
---|---|
1 | set1 (values) |
2 | set2 (values) |
3 | set3 (values) |
4 | set4 (values) |
values
-
IllegalArgumentException
- The argument is null, or its length is none of
the ones listed in the above table.public Attribute set(FloatBuffer values)
values.remaining() | Method to call |
---|---|
1 | set1 (values) |
2 | set2 (values) |
3 | set3 (values) |
4 | set4 (values) |
values
-
IllegalArgumentException
- The argument is null, or its length is none of
the ones listed in the above table.public Attribute setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
values
- Data to set to this vertex attribute.size
- The number of elements per one set of data.
From ONE
to FOUR
.type
- The type of the data. Possible values are
BYTE
,
UNSIGNED_BYTE
,
SHORT
,
UNSIGNED_SHORT
,
FLOAT
and
FIXED
.
Null can be given only when 'values' is an instance of FloatBuffer
,
and in the case, AttrDataType.FLOAT
is used.normalized
- True to normalize data when they are used. This parameter does
not take any effect if 'type' is AttrDataType.FLOAT
.stride
- The number of elements between the start of one data set
and the start of the next data set. Note that the unit
is not 'bytes'. The size (in bytes) that is passed to
the underlying glVertexAttribPointer() implementation is
calculated in this method based on the actual type of the
given 'values'. For example, if the actual type of 'values'
is FloatBuffer, (stride * 4) is passed to glVertexAttribPointer().
IllegalArgumentException
- 'values', 'size', or 'type' is null. Or 'stride' is less
than 0. Note that, however, if 'values' is an instance of
FloatBuffer
, 'type' can be null.public Attribute setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized)
setArray
(values, size, type, normalized, 0).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray(Buffer values, AttrDataSize size, AttrDataType type)
setArray
(values, size, type, false, 0).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray1(Buffer values, AttrDataType type, boolean normalized, int stride)
setArray
(values, AttrDataSize.ONE
,
type, normalized, stride).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray1(Buffer values, AttrDataType type, boolean normalized)
setArray
(values, AttrDataSize.ONE
,
type, normalized, 0).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray1(Buffer values, AttrDataType type)
setArray
(values, AttrDataSize.ONE
,
type, false, 0).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray2(Buffer values, AttrDataType type, boolean normalized, int stride)
setArray
(values, AttrDataSize.TWO
,
type, normalized, stride).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray2(Buffer values, AttrDataType type, boolean normalized)
setArray
(values, AttrDataSize.TWO
,
type, normalized, 0).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray2(Buffer values, AttrDataType type)
setArray
(values, AttrDataSize.TWO
,
type, false, 0).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray3(Buffer values, AttrDataType type, boolean normalized, int stride)
setArray
(values, AttrDataSize.THREE
,
type, normalized, stride).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray3(Buffer values, AttrDataType type, boolean normalized)
setArray
(values, AttrDataSize.THREE
,
type, normalized, 0).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray3(Buffer values, AttrDataType type)
setArray
(values, AttrDataSize.THREE
,
type, false, 0).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray4(Buffer values, AttrDataType type, boolean normalized, int stride)
setArray
(values, AttrDataSize.FOUR
,
type, normalized, stride).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray4(Buffer values, AttrDataType type, boolean normalized)
setArray
(values, AttrDataSize.FOUR
,
type, normalized, 0).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray4(Buffer values, AttrDataType type)
setArray
(values, AttrDataSize.FOUR
,
type, false, 0).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray(FloatBuffer values, AttrDataSize size, int stride)
setArray
(values, size,
AttrDataType.FLOAT
, false, stride).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray(FloatBuffer values, AttrDataSize size)
setArray
(values, size,
AttrDataType.FLOAT
, false, 0).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray1(FloatBuffer values, int stride)
setArray
(values, AttrDataSize.ONE
,
AttrDataType.FLOAT
, false, stride).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray1(FloatBuffer values)
setArray
(values, AttrDataSize.ONE
,
AttrDataType.FLOAT
, false, 0).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray2(FloatBuffer values, int stride)
setArray
(values, AttrDataSize.TWO
,
AttrDataType.FLOAT
, false, stride).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray2(FloatBuffer values)
setArray
(values, AttrDataSize.TWO
,
AttrDataType.FLOAT
, false, 0).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray3(FloatBuffer values, int stride)
setArray
(values, AttrDataSize.THREE
,
AttrDataType.FLOAT
, false, stride).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray3(FloatBuffer values)
setArray
(values, AttrDataSize.THREE
,
AttrDataType.FLOAT
, false, 0).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray4(FloatBuffer values, int stride)
setArray
(values, AttrDataSize.FOUR
,
AttrDataType.FLOAT
, false, stride).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray4(FloatBuffer values)
setArray
(values, AttrDataSize.FOUR
,
AttrDataType.FLOAT
, false, 0).
setArray(Buffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
public Attribute setArray(ArrayBuffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride, int offset)
bind()
method of the given 'values'. This has the same effect as
glBindBuffer(GL_ARRAY_BUFFER, values.VertexBuffer.getId()
).
Important Note: This method will throw an UnsupportedOperationException in Android 2.2 (API Level 8). It is because android.opengl.GLES20 class does not have glVertexAttribPointer() method whose last parameter is 'int offset' although it should have.
values
- Data to set to this vertex attribute.size
- The number of elements per one set of data.
From ONE
to FOUR
.type
- The type of the data. Possible values are
BYTE
,
UNSIGNED_BYTE
,
SHORT
,
UNSIGNED_SHORT
,
FLOAT
and
FIXED
.
Null can be given only when data held by 'values' is a float
array, and in the case, AttrDataType.FLOAT
is used.normalized
- True to normalize data when they are used. This parameter does
not take any effect if 'type' is AttrDataType.FLOAT
.stride
- The number of elements between the start of one data set
and the start of the next data set. Note that the unit
is not 'bytes'. The size (in bytes) that is passed to
the underlying glVertexAttribPointer() implementation is
calculated in this method based on the actual type of the
data that has been set to 'values' in advance by
setData()
method of 'values'. For example, if a FloatBuffer
instance has been set by calling values.setData
(data), in advance,
(stride * 4) is passed to glVertexAttribPointer() in the
implementation of this setArray method. To private necessary
information for this caluculation, VertexBuffer
class remembers the class type of the given data every time
setData()
method is called.offset
- Data offset in 'values'.
IllegalArgumentException
- 'values', 'size', or 'type' is null. Or 'stride' is less
than 0. Note that, however, if data held by 'values' is
a float array, 'type' can be null.public Attribute setArray(ArrayBuffer values, AttrDataSize size, boolean normalized, int stride, int offset)
setArray
(values, size, null,
normalized, stride, 0).
Note that data held by 'values' must be a float array. If not, other
method variants having AttrDataType
as an argument must be used.
values
- size
- normalized
- stride
- offset
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray(ArrayBuffer values, AttrDataSize size, AttrDataType type, boolean normalized, int stride)
setArray
(values, size, type,
normalized, stride, 0).
values
- size
- type
- normalized
- stride
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray(ArrayBuffer values, AttrDataSize size, boolean normalized, int stride)
setArray
(values, size, null,
normalized, stride, 0).
Note that data held by 'values' must be a float array. If not, other
method variants having AttrDataType
as an argument must be used.
values
- size
- normalized
- stride
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray(ArrayBuffer values, AttrDataSize size, AttrDataType type, boolean normalized)
setArray
(values, size, type,
normalized, 0, 0).
values
- size
- type
- normalized
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray(ArrayBuffer values, AttrDataSize size, boolean normalized)
setArray
(values, size, null,
normalized, 0, 0).
Note that data held by 'values' must be a float array. If not, other
method variants having AttrDataType
as an argument must be used.
values
- size
- normalized
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray(ArrayBuffer values, AttrDataSize size, AttrDataType type)
setArray
(values, size, type,
false, 0, 0).
values
- size
- type
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray(ArrayBuffer values, AttrDataSize size)
setArray
(values, size, null, false, 0, 0).
Note that data held by 'values' must be a float array. If not, other
method variants having AttrDataType
as an argument must be used.
values
- size
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray1(ArrayBuffer values, AttrDataType type, boolean normalized, int stride, int offset)
setArray
(values, AttrDataSize.ONE
,
type, normalized, stride, offset).
values
- type
- normalized
- stride
- offset
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray1(ArrayBuffer values, boolean normalized, int stride, int offset)
setArray
(values, AttrDataSize.ONE
,
null, normalized, stride, offset).
Note that data held by 'values' must be a float array. If not, other
method variants having AttrDataType
as an argument must be used.
values
- normalized
- stride
- offset
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray1(ArrayBuffer values, AttrDataType type, boolean normalized, int stride)
setArray
(values, AttrDataSize.ONE
,
type, normalized, stride, 0).
values
- type
- normalized
- stride
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray1(ArrayBuffer values, boolean normalized, int stride)
setArray
(values, AttrDataSize.ONE
,
null, normalized, stride, 0).
Note that data held by 'values' must be a float array. If not, other
method variants having AttrDataType
as an argument must be used.
values
- normalized
- stride
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray1(ArrayBuffer values, AttrDataType type, boolean normalized)
setArray
(values, AttrDataSize.ONE
,
type, normalized, 0, 0).
values
- type
- normalized
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray1(ArrayBuffer values, boolean normalized)
setArray
(values, AttrDataSize.ONE
,
null, normalized, 0, 0).
Note that data held by 'values' must be a float array. If not, other
method variants having AttrDataType
as an argument must be used.
values
- normalized
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray1(ArrayBuffer values, AttrDataType type)
setArray
(values, AttrDataSize.ONE
,
type, false, 0, 0).
values
- type
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray1(ArrayBuffer values)
setArray
(values, AttrDataSize.ONE
,
null, false, 0, 0).
Note that data held by 'values' must be a float array. If not, other
method variants having AttrDataType
as an argument must be used.
values
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray2(ArrayBuffer values, AttrDataType type, boolean normalized, int stride, int offset)
setArray
(values, AttrDataSize.TWO
,
type, normalized, stride, offset).
values
- type
- normalized
- stride
- offset
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray2(ArrayBuffer values, boolean normalized, int stride, int offset)
setArray
(values, AttrDataSize.TWO
,
null, normalized, stride, offset).
Note that data held by 'values' must be a float array. If not, other
method variants having AttrDataType
as an argument must be used.
values
- normalized
- stride
- offset
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray2(ArrayBuffer values, AttrDataType type, boolean normalized, int stride)
setArray
(values, AttrDataSize.TWO
,
type, normalized, stride, 0).
values
- type
- normalized
- stride
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray2(ArrayBuffer values, boolean normalized, int stride)
setArray
(values, AttrDataSize.TWO
,
null, normalized, stride, 0).
Note that data held by 'values' must be a float array. If not, other
method variants having AttrDataType
as an argument must be used.
values
- normalized
- stride
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray2(ArrayBuffer values, AttrDataType type, boolean normalized)
setArray
(values, AttrDataSize.TWO
,
type, normalized, 0, 0).
values
- type
- normalized
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray2(ArrayBuffer values, boolean normalized)
setArray
(values, AttrDataSize.TWO
,
null, normalized, 0, 0).
Note that data held by 'values' must be a float array. If not, other
method variants having AttrDataType
as an argument must be used.
values
- normalized
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray2(ArrayBuffer values, AttrDataType type)
setArray
(values, AttrDataSize.TWO
,
type, false, 0, 0).
values
- type
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray2(ArrayBuffer values)
setArray
(values, AttrDataSize.TWO
,
null, false, 0, 0).
Note that data held by 'values' must be a float array. If not, other
method variants having AttrDataType
as an argument must be used.
values
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray3(ArrayBuffer values, AttrDataType type, boolean normalized, int stride, int offset)
setArray
(values, AttrDataSize.THREE
,
type, normalized, stride, offset).
values
- type
- normalized
- stride
- offset
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray3(ArrayBuffer values, boolean normalized, int stride, int offset)
setArray
(values, AttrDataSize.THREE
,
null, normalized, stride, offset).
Note that data held by 'values' must be a float array. If not, other
method variants having AttrDataType
as an argument must be used.
values
- normalized
- stride
- offset
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray3(ArrayBuffer values, AttrDataType type, boolean normalized, int stride)
setArray
(values, AttrDataSize.THREE
,
type, normalized, stride, 0).
values
- type
- normalized
- stride
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray3(ArrayBuffer values, boolean normalized, int stride)
setArray
(values, AttrDataSize.THREE
,
null, normalized, stride, 0).
Note that data held by 'values' must be a float array. If not, other
method variants having AttrDataType
as an argument must be used.
values
- normalized
- stride
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray3(ArrayBuffer values, AttrDataType type, boolean normalized)
setArray
(values, AttrDataSize.THREE
,
type, normalized, 0, 0).
values
- type
- normalized
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray3(ArrayBuffer values, boolean normalized)
setArray
(values, AttrDataSize.THREE
,
null, normalized, 0, 0).
Note that data held by 'values' must be a float array. If not, other
method variants having AttrDataType
as an argument must be used.
values
- normalized
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray3(ArrayBuffer values, AttrDataType type)
setArray
(values, AttrDataSize.THREE
,
type, false, 0, 0).
values
- type
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray3(ArrayBuffer values)
setArray
(values, AttrDataSize.THREE
,
null, false, 0, 0).
Note that data held by 'values' must be a float array. If not, other
method variants having AttrDataType
as an argument must be used.
values
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray4(ArrayBuffer values, AttrDataType type, boolean normalized, int stride, int offset)
setArray
(values, AttrDataSize.FOUR
,
type, normalized, stride, offset).
values
- type
- normalized
- stride
- offset
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray4(ArrayBuffer values, boolean normalized, int stride, int offset)
setArray
(values, AttrDataSize.FOUR
,
null, normalized, stride, offset).
Note that data held by 'values' must be a float array. If not, other
method variants having AttrDataType
as an argument must be used.
values
- normalized
- stride
- offset
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray4(ArrayBuffer values, AttrDataType type, boolean normalized, int stride)
setArray
(values, AttrDataSize.FOUR
,
type, normalized, stride, 0).
values
- type
- normalized
- stride
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray4(ArrayBuffer values, boolean normalized, int stride)
setArray
(values, AttrDataSize.FOUR
,
null, normalized, stride, 0).
Note that data held by 'values' must be a float array. If not, other
method variants having AttrDataType
as an argument must be used.
values
- normalized
- stride
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray4(ArrayBuffer values, AttrDataType type, boolean normalized)
setArray
(values, AttrDataSize.FOUR
,
type, normalized, 0, 0).
values
- type
- normalized
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray4(ArrayBuffer values, boolean normalized)
setArray
(values, AttrDataSize.FOUR
,
null, normalized, 0, 0).
Note that data held by 'values' must be a float array. If not, other
method variants having AttrDataType
as an argument must be used.
values
- normalized
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray4(ArrayBuffer values, AttrDataType type)
setArray
(values, AttrDataSize.FOUR
,
type, false, 0, 0).
values
- type
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
public Attribute setArray4(ArrayBuffer values)
setArray
(values, AttrDataSize.FOUR
,
null, false, 0, 0).
Note that data held by 'values' must be a float array. If not, other
method variants having AttrDataType
as an argument must be used.
values
-
setArray(ArrayBuffer, AttrDataSize, AttrDataType, boolean, int, int)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |