public final class Mesh

  1. Object
  2. Mesh
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[]).

Constructors

public Mesh(VertexBuffer vertices, PrimitiveType primitiveType)Creates a non indexed mesh.
public Mesh(VertexBuffer vertices, IndexBuffer indices, PrimitiveType primitiveType)Creates an indexed mesh.

Methods

public VertexBuffer getVertices()Returns the vertex buffer.
public IndexBuffer getIndices()Returns the index buffer, or null for a non indexed mesh.
public boolean isIndexed()Returns true if this mesh is drawn with an index buffer.
public PrimitiveType getPrimitiveType()Returns the primitive assembly type.

Inherited methods

Constructor details

Mesh

public Mesh(VertexBuffer vertices, PrimitiveType primitiveType)
Creates a non indexed mesh.

Parameters

vertices VertexBuffer
the vertex data
primitiveType PrimitiveType
how the vertices are assembled into primitives

Mesh

public Mesh(VertexBuffer vertices, IndexBuffer indices, PrimitiveType primitiveType)
Creates an indexed mesh.

Parameters

vertices VertexBuffer
the vertex data
indices IndexBuffer
the element indices, or null for a non indexed mesh
primitiveType 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.