Class Mesh

java.lang.Object
com.codename1.gpu.Mesh

public final class Mesh extends Object
Renderable geometry: a VertexBuffer, an optional IndexBuffer and the PrimitiveType that ties the vertices into shapes. A mesh carries no material; the same mesh can be drawn with different materials through GraphicsDevice.draw(Mesh, Material, float[]).
  • Constructor Details

    • Mesh

      public Mesh(VertexBuffer vertices, PrimitiveType primitiveType)

      Creates a non indexed mesh.

      Parameters
      • vertices: the vertex data

      • primitiveType: how the vertices are assembled into primitives

    • Mesh

      public Mesh(VertexBuffer vertices, IndexBuffer indices, PrimitiveType primitiveType)

      Creates an indexed mesh.

      Parameters
      • vertices: the vertex data

      • indices: the element indices, or null for a non indexed mesh

      • primitiveType: how the vertices are assembled into primitives

  • Method Details

    • getVertices

      public VertexBuffer getVertices()
      Returns the vertex buffer.
    • getIndices

      public IndexBuffer getIndices()
      Returns the index buffer, or null for a non indexed mesh.
    • isIndexed

      public boolean isIndexed()
      Returns true if this mesh is drawn with an index buffer.
    • getPrimitiveType

      public PrimitiveType getPrimitiveType()
      Returns the primitive assembly type.