Package rosequartz.gfx
Class VertexBuilder<T extends Enum<T> & VertexBuilder.VertexStructure>
java.lang.Object
rosequartz.gfx.VertexBuilder<T>
- Type Parameters:
T- the enum used to set the layout
- All Implemented Interfaces:
Serializable
public class VertexBuilder<T extends Enum<T> & VertexBuilder.VertexStructure>
extends Object
implements Serializable
Used to configure vertex layouts of library classes using OpenGL features.
- See Also:
- Serialized Form
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceInterface for vertex layout enums. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionSets all items in the vertex layout with the same identifier to that value.float[]get()Returns the built vertex values.int[]Returns the configured attribute sizes.getStructureName(int offset)Returns the name of the attribute at the given attribute offset.intgetSubOffset(int offset)Returns the offset of an offset inside its structure.Sets the vertex layout.toString()
-
Constructor Details
-
VertexBuilder
Creates a new VertexBuilder with default order.- Parameters:
order- the default vertex layout
-
-
Method Details
-
setOrder
Sets the vertex layout.- Parameters:
order- the new vertex layout- Returns:
- this
-
getAttributeSizes
public int[] getAttributeSizes()Returns the configured attribute sizes.- Returns:
- attribute sizes
-
define
Sets all items in the vertex layout with the same identifier to that value.- Parameters:
name- the identifiervalue- the value- Returns:
- this
-
getStructureName
Returns the name of the attribute at the given attribute offset.- Parameters:
offset- offset- Returns:
- structure name
-
getSubOffset
public int getSubOffset(int offset)Returns the offset of an offset inside its structure.- Parameters:
offset- offset- Returns:
- sub-offset
-
get
public float[] get()Returns the built vertex values.- Returns:
- vertex values
-
toString
-