public final class VertexAttributes extends java.lang.Object implements java.lang.Iterable<VertexAttribute>, java.lang.Comparable<VertexAttributes>
Mesh
instances to define
its vertex structure. Vertex attributes have an order. The order is specified by the order they are added to this class.Modifier and Type | Class and Description |
---|---|
static class |
VertexAttributes.Usage
The usage of a vertex attribute.
|
Modifier and Type | Field and Description |
---|---|
int |
vertexSize
the size of a single vertex in bytes
|
Constructor and Description |
---|
VertexAttributes(VertexAttribute... attributes)
Constructor, sets the vertex attributes in a specific order
|
Modifier and Type | Method and Description |
---|---|
int |
compareTo(VertexAttributes o) |
boolean |
equals(java.lang.Object obj) |
VertexAttribute |
findByUsage(int usage)
Returns the first VertexAttribute for the given usage.
|
VertexAttribute |
get(int index) |
long |
getMask()
Calculates a mask based on the contained
VertexAttribute instances. |
long |
getMaskWithSizePacked()
Calculates the mask based on
getMask() and packs the attributes count into the last 32 bits. |
int |
getOffset(int usage)
Returns the offset for the first VertexAttribute with the specified usage.
|
int |
getOffset(int usage,
int defaultIfNotFound)
Returns the offset for the first VertexAttribute with the specified usage.
|
int |
hashCode() |
java.util.Iterator<VertexAttribute> |
iterator() |
int |
size() |
java.lang.String |
toString() |
public VertexAttributes(VertexAttribute... attributes)
public int getOffset(int usage, int defaultIfNotFound)
usage
- The usage of the VertexAttribute.public int getOffset(int usage)
usage
- The usage of the VertexAttribute.public VertexAttribute findByUsage(int usage)
usage
- The usage of the VertexAttribute to find.public int size()
public VertexAttribute get(int index)
index
- the indexpublic java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public long getMask()
VertexAttribute
instances. The mask is a bit-wise or of each attributes
VertexAttribute.usage
.public long getMaskWithSizePacked()
getMask()
and packs the attributes count into the last 32 bits.public int compareTo(VertexAttributes o)
compareTo
in interface java.lang.Comparable<VertexAttributes>
public java.util.Iterator<VertexAttribute> iterator()
iterator
in interface java.lang.Iterable<VertexAttribute>
Collections.allocateIterators