public final class VertexAttribute extends Object
VertexAttributes.Usage
, its number of components and its shader alias. The Usage is needed for
the fixed function pipeline of OpenGL ES 1.x. Generic attributes are not supported in the fixed function pipeline. The number
of components defines how many components the attribute has. The alias defines to which shader attribute this attribute should
bind. The alias is used by a Mesh
when drawing with a ShaderProgram
. The alias can be changed at any time.Modifier and Type | Field and Description |
---|---|
String |
alias
the alias for the attribute used in a
ShaderProgram |
boolean |
normalized
whether the values are normalized to either -1f and +1f (signed) or 0f and +1f (unsigned)
|
int |
numComponents
the number of components this attribute has
|
int |
offset
the offset of this attribute in bytes, don't change this!
|
int |
type
the OpenGL type of each component, e.g.
|
int |
unit
optional unit/index specifier, used for texture coordinates and bone weights
|
int |
usage
the attribute
VertexAttributes.Usage |
Constructor and Description |
---|
VertexAttribute(int usage,
int numComponents,
String alias)
Constructs a new VertexAttribute.
|
VertexAttribute(int usage,
int numComponents,
String alias,
int index)
Constructs a new VertexAttribute.
|
Modifier and Type | Method and Description |
---|---|
static VertexAttribute |
Binormal() |
static VertexAttribute |
BoneWeight(int unit) |
static VertexAttribute |
Color()
Deprecated.
use
ColorPacked() |
static VertexAttribute |
ColorPacked() |
static VertexAttribute |
ColorUnpacked() |
boolean |
equals(Object obj)
Tests to determine if the passed object was created with the same parameters
|
boolean |
equals(VertexAttribute other) |
int |
getKey() |
int |
hashCode() |
static VertexAttribute |
Normal() |
static VertexAttribute |
Position() |
static VertexAttribute |
Tangent() |
static VertexAttribute |
TexCoords(int unit) |
public final int usage
VertexAttributes.Usage
public final int numComponents
public final boolean normalized
public final int type
GL20.GL_FLOAT
or GL20.GL_UNSIGNED_BYTE
public int offset
public String alias
ShaderProgram
public int unit
public VertexAttribute(int usage, int numComponents, String alias)
usage
- the usage, used for the fixed function pipeline. Generic attributes are not supported in the fixed function
pipeline.numComponents
- the number of components of this attribute, must be between 1 and 4.alias
- the alias used in a shader for this attribute. Can be changed after construction.public VertexAttribute(int usage, int numComponents, String alias, int index)
usage
- the usage, used for the fixed function pipeline. Generic attributes are not supported in the fixed function
pipeline.numComponents
- the number of components of this attribute, must be between 1 and 4.alias
- the alias used in a shader for this attribute. Can be changed after construction.index
- unit/index of the attribute, used for boneweights and texture coordinates.public static VertexAttribute Position()
public static VertexAttribute TexCoords(int unit)
public static VertexAttribute Normal()
@Deprecated public static VertexAttribute Color()
ColorPacked()
public static VertexAttribute ColorPacked()
public static VertexAttribute ColorUnpacked()
public static VertexAttribute Tangent()
public static VertexAttribute Binormal()
public static VertexAttribute BoneWeight(int unit)
public boolean equals(Object obj)
public boolean equals(VertexAttribute other)
public int getKey()
Copyright © 2014. All rights reserved.