public final class Mesh
- Object
- 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
verticesVertexBuffer- the vertex data
primitiveTypePrimitiveType- how the vertices are assembled into primitives
Mesh
public Mesh(VertexBuffer vertices, IndexBuffer indices, PrimitiveType primitiveType)Creates an indexed mesh.
Parameters
verticesVertexBuffer- the vertex data
indicesIndexBuffer- the element indices, or null for a non indexed mesh
primitiveTypePrimitiveType- 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.