public class VertexAttributes
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
TYPE_FOUR_FLOATS
Type for assigning four floats to each vertex
|
static int |
TYPE_SINGLE_FLOATS
Type for assigning a single float to each vertex
|
static int |
TYPE_THREE_FLOATS
Type for assigning three floats to each vertex
|
static int |
TYPE_TWO_FLOATS
Type for assigning two floats to each vertex
|
Constructor and Description |
---|
VertexAttributes(java.lang.String name,
float[] data,
int type)
Cretes new vertex attributes.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getName()
Returns the name of the vertex attributes in your shader's code.
|
int |
getType()
Returns the type, i.e. the number of floats per vertex (1 to 4)
|
boolean |
isDynamic()
Are these attributes dynamic?
|
boolean |
matches(int vertexCount)
Returns true, if these vertex attributes are matching a given vertex
count, i.e. if these attributes can be used on a mesh with that vertex
count.
|
void |
setDynamic(boolean dynamic)
Sets these attributes as dynamic, i.e. you are allowed to update their
data.
|
void |
update(float[] data,
int start)
Updates the attributes' data.
|
public static final int TYPE_SINGLE_FLOATS
public static final int TYPE_TWO_FLOATS
public static final int TYPE_THREE_FLOATS
public static final int TYPE_FOUR_FLOATS
public VertexAttributes(java.lang.String name, float[] data, int type)
name
- the name. This is the name the attribute in your shader has to
have.data
- the datatype
- the type, i.e. the number of floats per vertex (1 to 4)public boolean isDynamic()
public void setDynamic(boolean dynamic)
dynamic
- dynamic or not?public void update(float[] data, int start)
data
- the new datastart
- the start index of the data.public boolean matches(int vertexCount)
vertexCount
- the vertex countpublic int getType()
public java.lang.String getName()