|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.threed.jpct.VertexAttributes
This class can be used to assign additional vertex attributes to meshes. This is only useful when using shaders. You can still assign them when not using shaders, but all it does is to consume memory and processing power. The attributes will be injected into the shader used by an object that uses this mesh, if the shader provides an attribute variable with the correct name.
Field Summary | |
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 Summary | |
VertexAttributes(java.lang.String name,
float[] data,
int type)
Cretes new vertex attributes. |
Method Summary | |
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. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
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
Constructor Detail |
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)Method Detail |
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 count
public int getType()
public java.lang.String getName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |