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
  • Constructor Details

    • VertexBuilder

      public VertexBuilder(T... order)
      Creates a new VertexBuilder with default order.
      Parameters:
      order - the default vertex layout
  • Method Details

    • setOrder

      public VertexBuilder<T> setOrder(T... order)
      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

      public VertexBuilder<T> define(T name, float... value)
      Sets all items in the vertex layout with the same identifier to that value.
      Parameters:
      name - the identifier
      value - the value
      Returns:
      this
    • getStructureName

      public T getStructureName(int offset)
      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

      public String toString()
      Overrides:
      toString in class Object