<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc (version 1.7.0_17) on Sun Nov 03 15:35:45 CET 2013 -->
<title>Mesh (libgdx API)
</title>
<meta name="date" content="2013-11-03">
<link rel="stylesheet" type="text/css" href="../../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Mesh (libgdx API)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.
</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview
</a></li>
<li><a href="package-summary.html">Package
</a></li>
<li class="navBarCell1Rev">Class
</li>
<li><a href="class-use/Mesh.html">Use
</a></li>
<li><a href="package-tree.html">Tree
</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated
</a></li>
<li><a href="../../../../index-all.html">Index
</a></li>
<li><a href="../../../../help-doc.html">Help
</a></li>
</ul>
<div class="aboutLanguage"><em>
libgdx API
<style>
body, td, th { font-family:Helvetica, Tahoma, Arial, sans-serif; font-size:10pt }
pre, code, tt { font-size:9pt; font-family:Lucida Console, Courier New, sans-serif }
h1, h2, h3, .FrameTitleFont, .FrameHeadingFont, .TableHeadingColor font { font-size:105%; font-weight:bold }
.TableHeadingColor { background:#EEEEFF; }
a { text-decoration:none }
a:hover { text-decoration:underline }
a:link, a:visited { color:blue }
table { border:0px }
.TableRowColor td:first-child { border-left:1px solid black }
.TableRowColor td { border:0px; border-bottom:1px solid black; border-right:1px solid black }
hr { border:0px; border-bottom:1px solid #333366; }
</style>
</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/badlogic/gdx/graphics/GLTexture.html" title="class in com.badlogic.gdx.graphics"><span class="strong">Prev Class
</span></a></li>
<li><a href="../../../../com/badlogic/gdx/graphics/Mesh.VertexDataType.html" title="enum in com.badlogic.gdx.graphics"><span class="strong">Next Class
</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/badlogic/gdx/graphics/Mesh.html" target="_top">Frames
</a></li>
<li><a href="Mesh.html" target="_top">No Frames
</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../../allclasses-noframe.html">All Classes
</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:
</li>
<li><a href="#nested_class_summary">Nested
</a> |
</li>
<li><a href="#field_summary">Field
</a> |
</li>
<li><a href="#constructor_summary">Constr
</a> |
</li>
<li><a href="#method_summary">Method
</a></li>
</ul>
<ul class="subNavList">
<li>Detail:
</li>
<li><a href="#field_detail">Field
</a> |
</li>
<li><a href="#constructor_detail">Constr
</a> |
</li>
<li><a href="#method_detail">Method
</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">com.badlogic.gdx.graphics
</div>
<h2 title="Class Mesh" class="title">Class Mesh
</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object
</li>
<li>
<ul class="inheritance">
<li>com.badlogic.gdx.graphics.Mesh
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:
</dt>
<dd><a href="../../../../com/badlogic/gdx/utils/Disposable.html" title="interface in com.badlogic.gdx.utils">Disposable
</a></dd>
</dl>
<hr>
<br>
<pre>public class
<span class="strong">Mesh
</span>
extends java.lang.Object
implements
<a href="../../../../com/badlogic/gdx/utils/Disposable.html" title="interface in com.badlogic.gdx.utils">Disposable
</a></pre>
<div class="block"><p>
A Mesh holds vertices composed of attributes specified by a
<a href="../../../../com/badlogic/gdx/graphics/VertexAttributes.html" title="class in com.badlogic.gdx.graphics"><code>VertexAttributes
</code></a> instance. The vertices are held either in
VRAM in form of vertex buffer objects or in RAM in form of vertex arrays. The former variant is more performant and is prefered
over vertex arrays if hardware supports it.
</p>
<p>
Meshes are automatically managed. If the OpenGL context is lost all vertex buffer objects get invalidated and must be reloaded
when the context is recreated. This only happens on Android when a user switches to another application or receives an incoming
call. A managed Mesh will be reloaded automagically so you don't have to do this manually.
</p>
<p>
A Mesh consists of vertices and optionally indices which specify which vertices define a triangle. Each vertex is composed of
attributes such as position, normal, color or texture coordinate. Note that not all of this attributes must be given, except
for position which is non-optional. Each attribute has an alias which is used when rendering a Mesh in OpenGL ES 2.0. The alias
is used to bind a specific vertex attribute to a shader attribute. The shader source and the alias of the attribute must match
exactly for this to work. For OpenGL ES 1.x rendering this aliases are irrelevant.
</p>
<p>
Meshes can be used with either OpenGL ES 1.x or OpenGL ES 2.0.
</p></div>
<dl><dt><span class="strong">Author:
</span></dt>
<dd>mzechner, Dave Clayton
<contact@redskyforge.com></dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== NESTED CLASS SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="nested_class_summary">
<!-- -->
</a>
<h3>Nested Class Summary
</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation">
<caption><span>Nested Classes
</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type
</th>
<th class="colLast" scope="col">Class and Description
</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static class
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.VertexDataType.html" title="enum in com.badlogic.gdx.graphics">Mesh.VertexDataType
</a></strong></code> </td>
</tr>
</table>
</li>
</ul>
<!-- =========== FIELD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_summary">
<!-- -->
</a>
<h3>Field Summary
</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation">
<caption><span>Fields
</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type
</th>
<th class="colLast" scope="col">Field and Description
</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static boolean
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#forceVBO">forceVBO
</a></strong></code>
<div class="block">used for benchmarking
</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary
</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors
</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description
</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#Mesh(boolean, boolean, int, int, com.badlogic.gdx.graphics.VertexAttributes)">Mesh
</a></strong>(boolean
staticVertices,
boolean
staticIndices,
int
maxVertices,
int
maxIndices,
<a href="../../../../com/badlogic/gdx/graphics/VertexAttributes.html" title="class in com.badlogic.gdx.graphics">VertexAttributes
</a> attributes)
</code>
<div class="block">by jw:
Creates a new Mesh with the given attributes.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#Mesh(boolean, int, int, com.badlogic.gdx.graphics.VertexAttribute...)">Mesh
</a></strong>(boolean
isStatic,
int
maxVertices,
int
maxIndices,
<a href="../../../../com/badlogic/gdx/graphics/VertexAttribute.html" title="class in com.badlogic.gdx.graphics">VertexAttribute
</a>...
attributes)
</code>
<div class="block">Creates a new Mesh with the given attributes.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#Mesh(boolean, int, int, com.badlogic.gdx.graphics.VertexAttributes)">Mesh
</a></strong>(boolean
isStatic,
int
maxVertices,
int
maxIndices,
<a href="../../../../com/badlogic/gdx/graphics/VertexAttributes.html" title="class in com.badlogic.gdx.graphics">VertexAttributes
</a> attributes)
</code>
<div class="block">Creates a new Mesh with the given attributes.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colOne"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#Mesh(com.badlogic.gdx.graphics.Mesh.VertexDataType, boolean, int, int, com.badlogic.gdx.graphics.VertexAttribute...)">Mesh
</a></strong>(
<a href="../../../../com/badlogic/gdx/graphics/Mesh.VertexDataType.html" title="enum in com.badlogic.gdx.graphics">Mesh.VertexDataType
</a> type,
boolean
isStatic,
int
maxVertices,
int
maxIndices,
<a href="../../../../com/badlogic/gdx/graphics/VertexAttribute.html" title="class in com.badlogic.gdx.graphics">VertexAttribute
</a>...
attributes)
</code>
<div class="block">Creates a new Mesh with the given attributes.
</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary
</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods
</span><span class="tabEnd"> </span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type
</th>
<th class="colLast" scope="col">Method and Description
</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#bind()">bind
</a></strong>()
</code>
<div class="block">Binds the underlying
<a href="../../../../com/badlogic/gdx/graphics/glutils/VertexArray.html" title="class in com.badlogic.gdx.graphics.glutils"><code>VertexArray
</code></a>/
<a href="../../../../com/badlogic/gdx/graphics/glutils/VertexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>VertexBufferObject
</code></a> and
<a href="../../../../com/badlogic/gdx/graphics/glutils/IndexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>IndexBufferObject
</code></a> if indices were given.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#bind(com.badlogic.gdx.graphics.glutils.ShaderProgram)">bind
</a></strong>(
<a href="../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram
</a> shader)
</code>
<div class="block">Binds the underlying
<a href="../../../../com/badlogic/gdx/graphics/glutils/VertexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>VertexBufferObject
</code></a> and
<a href="../../../../com/badlogic/gdx/graphics/glutils/IndexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>IndexBufferObject
</code></a> if indices where given.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#bind(com.badlogic.gdx.graphics.glutils.ShaderProgram, int[])">bind
</a></strong>(
<a href="../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram
</a> shader,
int[]
locations)
</code>
<div class="block">Binds the underlying
<a href="../../../../com/badlogic/gdx/graphics/glutils/VertexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>VertexBufferObject
</code></a> and
<a href="../../../../com/badlogic/gdx/graphics/glutils/IndexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>IndexBufferObject
</code></a> if indices where given.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision">BoundingBox
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#calculateBoundingBox()">calculateBoundingBox
</a></strong>()
</code>
<div class="block">Calculates the
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision"><code>BoundingBox
</code></a> of the vertices contained in this mesh.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#calculateBoundingBox(com.badlogic.gdx.math.collision.BoundingBox)">calculateBoundingBox
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision">BoundingBox
</a> bbox)
</code>
<div class="block">Calculates the
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision"><code>BoundingBox
</code></a> of the vertices contained in this mesh.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision">BoundingBox
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#calculateBoundingBox(com.badlogic.gdx.math.collision.BoundingBox, int, int)">calculateBoundingBox
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision">BoundingBox
</a> out,
int
offset,
int
count)
</code>
<div class="block">Calculate the
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision"><code>BoundingBox
</code></a> of the specified part.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision">BoundingBox
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#calculateBoundingBox(com.badlogic.gdx.math.collision.BoundingBox, int, int, com.badlogic.gdx.math.Matrix4)">calculateBoundingBox
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision">BoundingBox
</a> out,
int
offset,
int
count,
<a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> transform)
</code>
<div class="block">Calculate the
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision"><code>BoundingBox
</code></a> of the specified part.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#clearAllMeshes(com.badlogic.gdx.Application)">clearAllMeshes
</a></strong>(
<a href="../../../../com/badlogic/gdx/Application.html" title="interface in com.badlogic.gdx">Application
</a> app)
</code>
<div class="block">Will clear the managed mesh cache.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#copy(boolean)">copy
</a></strong>(boolean
isStatic)
</code>
<div class="block">Copies this mesh.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#copy(boolean, boolean, int[])">copy
</a></strong>(boolean
isStatic,
boolean
removeDuplicates,
int[]
usage)
</code>
<div class="block">Copies this mesh optionally removing duplicate vertices and/or reducing the amount of attributes.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static
<a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#create(boolean, com.badlogic.gdx.graphics.Mesh[])">create
</a></strong>(boolean
isStatic,
<a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a>[]
meshes)
</code>
<div class="block">Create a new Mesh that is a combination of the supplied meshes.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static
<a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#create(boolean, com.badlogic.gdx.graphics.Mesh[], com.badlogic.gdx.math.Matrix4[])">create
</a></strong>(boolean
isStatic,
<a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a>[]
meshes,
<a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a>[]
transformations)
</code>
<div class="block">Create a new Mesh that is a combination of the supplied meshes.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static
<a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#create(boolean, com.badlogic.gdx.graphics.Mesh, com.badlogic.gdx.math.Matrix4[])">create
</a></strong>(boolean
isStatic,
<a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a> base,
<a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a>[]
transformations)
</code>
<div class="block">Create a new Mesh that is a combination of transformations of the supplied base mesh.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#dispose()">dispose
</a></strong>()
</code>
<div class="block">Frees all resources associated with this Mesh
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision">BoundingBox
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#extendBoundingBox(com.badlogic.gdx.math.collision.BoundingBox, int, int)">extendBoundingBox
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision">BoundingBox
</a> out,
int
offset,
int
count)
</code>
<div class="block">Extends the specified
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision"><code>BoundingBox
</code></a> with the specified part.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision">BoundingBox
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#extendBoundingBox(com.badlogic.gdx.math.collision.BoundingBox, int, int, com.badlogic.gdx.math.Matrix4)">extendBoundingBox
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision">BoundingBox
</a> out,
int
offset,
int
count,
<a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> transform)
</code>
<div class="block">Extends the specified
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision"><code>BoundingBox
</code></a> with the specified part.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#getIndices(short[])">getIndices
</a></strong>(short[]
indices)
</code>
<div class="block">Copies the indices from the Mesh to the short array.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#getIndices(short[], int)">getIndices
</a></strong>(short[]
indices,
int
destOffset)
</code>
<div class="block">Copies the indices from the Mesh to the short array.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>java.nio.ShortBuffer
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#getIndicesBuffer()">getIndicesBuffer
</a></strong>()
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static java.lang.String
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#getManagedStatus()">getManagedStatus
</a></strong>()
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#getMaxIndices()">getMaxIndices
</a></strong>()
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#getMaxVertices()">getMaxVertices
</a></strong>()
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#getNumIndices()">getNumIndices
</a></strong>()
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>int
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#getNumVertices()">getNumVertices
</a></strong>()
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/graphics/VertexAttribute.html" title="class in com.badlogic.gdx.graphics">VertexAttribute
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#getVertexAttribute(int)">getVertexAttribute
</a></strong>(int
usage)
</code>
<div class="block">Returns the first
<a href="../../../../com/badlogic/gdx/graphics/VertexAttribute.html" title="class in com.badlogic.gdx.graphics"><code>VertexAttribute
</code></a> having the given
<a href="../../../../com/badlogic/gdx/graphics/VertexAttributes.Usage.html" title="class in com.badlogic.gdx.graphics"><code>VertexAttributes.Usage
</code></a>.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/graphics/VertexAttributes.html" title="class in com.badlogic.gdx.graphics">VertexAttributes
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#getVertexAttributes()">getVertexAttributes
</a></strong>()
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>int
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#getVertexSize()">getVertexSize
</a></strong>()
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#getVertices(float[])">getVertices
</a></strong>(float[]
vertices)
</code>
<div class="block">Copies the vertices from the Mesh to the float array.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#getVertices(int, float[])">getVertices
</a></strong>(int
srcOffset,
float[]
vertices)
</code>
<div class="block">Copies the the remaining vertices from the Mesh to the float array.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#getVertices(int, int, float[])">getVertices
</a></strong>(int
srcOffset,
int
count,
float[]
vertices)
</code>
<div class="block">Copies the specified vertices from the Mesh to the float array.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#getVertices(int, int, float[], int)">getVertices
</a></strong>(int
srcOffset,
int
count,
float[]
vertices,
int
destOffset)
</code>
<div class="block">Copies the specified vertices from the Mesh to the float array.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>java.nio.FloatBuffer
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#getVerticesBuffer()">getVerticesBuffer
</a></strong>()
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#invalidateAllMeshes(com.badlogic.gdx.Application)">invalidateAllMeshes
</a></strong>(
<a href="../../../../com/badlogic/gdx/Application.html" title="interface in com.badlogic.gdx">Application
</a> app)
</code>
<div class="block">Invalidates all meshes so the next time they are rendered new VBO handles are generated.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#render(int)">render
</a></strong>(int
primitiveType)
</code>
<div class="block">
Renders the mesh using the given primitive type.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#render(int, int, int)">render
</a></strong>(int
primitiveType,
int
offset,
int
count)
</code>
<div class="block">
Renders the mesh using the given primitive type.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#render(int, int, int, boolean)">render
</a></strong>(int
primitiveType,
int
offset,
int
count,
boolean
autoBind)
</code>
<div class="block">
Renders the mesh using the given primitive type.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#render(com.badlogic.gdx.graphics.glutils.ShaderProgram, int)">render
</a></strong>(
<a href="../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram
</a> shader,
int
primitiveType)
</code>
<div class="block">
Renders the mesh using the given primitive type.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#render(com.badlogic.gdx.graphics.glutils.ShaderProgram, int, int, int)">render
</a></strong>(
<a href="../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram
</a> shader,
int
primitiveType,
int
offset,
int
count)
</code>
<div class="block">
Renders the mesh using the given primitive type.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#render(com.badlogic.gdx.graphics.glutils.ShaderProgram, int, int, int, boolean)">render
</a></strong>(
<a href="../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram
</a> shader,
int
primitiveType,
int
offset,
int
count,
boolean
autoBind)
</code>
<div class="block">
Renders the mesh using the given primitive type.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#scale(float, float, float)">scale
</a></strong>(float
scaleX,
float
scaleY,
float
scaleZ)
</code>
<div class="block">Method to scale the positions in the mesh.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#setAutoBind(boolean)">setAutoBind
</a></strong>(boolean
autoBind)
</code>
<div class="block">Sets whether to bind the underlying
<a href="../../../../com/badlogic/gdx/graphics/glutils/VertexArray.html" title="class in com.badlogic.gdx.graphics.glutils"><code>VertexArray
</code></a> or
<a href="../../../../com/badlogic/gdx/graphics/glutils/VertexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>VertexBufferObject
</code></a> automatically on a call to one of the
<a href="../../../../com/badlogic/gdx/graphics/Mesh.html#render(int)"><code>render(int)
</code></a> methods or not.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#setIndices(short[])">setIndices
</a></strong>(short[]
indices)
</code>
<div class="block">Sets the indices of this Mesh
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#setIndices(short[], int, int)">setIndices
</a></strong>(short[]
indices,
int
offset,
int
count)
</code>
<div class="block">Sets the indices of this Mesh.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#setVertices(float[])">setVertices
</a></strong>(float[]
vertices)
</code>
<div class="block">Sets the vertices of this Mesh.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#setVertices(float[], int, int)">setVertices
</a></strong>(float[]
vertices,
int
offset,
int
count)
</code>
<div class="block">Sets the vertices of this Mesh.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#transform(com.badlogic.gdx.math.Matrix4)">transform
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> matrix)
</code>
<div class="block">Method to transform the positions in the mesh.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>static void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#transform(com.badlogic.gdx.math.Matrix4, float[], int, int, int, int, int)">transform
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> matrix,
float[]
vertices,
int
vertexSize,
int
offset,
int
dimensions,
int
start,
int
count)
</code>
<div class="block">Method to transform the positions in the float array.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>protected void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#transform(com.badlogic.gdx.math.Matrix4, int, int)">transform
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> matrix,
int
start,
int
count)
</code> </td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#transformUV(com.badlogic.gdx.math.Matrix3)">transformUV
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/Matrix3.html" title="class in com.badlogic.gdx.math">Matrix3
</a> matrix)
</code>
<div class="block">Method to transform the texture coordinates in the mesh.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>static void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#transformUV(com.badlogic.gdx.math.Matrix3, float[], int, int, int, int)">transformUV
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/Matrix3.html" title="class in com.badlogic.gdx.math">Matrix3
</a> matrix,
float[]
vertices,
int
vertexSize,
int
offset,
int
start,
int
count)
</code>
<div class="block">Method to transform the texture coordinates (UV) in the float array.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>protected void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#transformUV(com.badlogic.gdx.math.Matrix3, int, int)">transformUV
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/Matrix3.html" title="class in com.badlogic.gdx.math">Matrix3
</a> matrix,
int
start,
int
count)
</code> </td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#unbind()">unbind
</a></strong>()
</code>
<div class="block">Unbinds the underlying
<a href="../../../../com/badlogic/gdx/graphics/glutils/VertexArray.html" title="class in com.badlogic.gdx.graphics.glutils"><code>VertexArray
</code></a>/
<a href="../../../../com/badlogic/gdx/graphics/glutils/VertexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>VertexBufferObject
</code></a> and
<a href="../../../../com/badlogic/gdx/graphics/glutils/IndexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>IndexBufferObject
</code></a> is indices were given.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#unbind(com.badlogic.gdx.graphics.glutils.ShaderProgram)">unbind
</a></strong>(
<a href="../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram
</a> shader)
</code>
<div class="block">Unbinds the underlying
<a href="../../../../com/badlogic/gdx/graphics/glutils/VertexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>VertexBufferObject
</code></a> and
<a href="../../../../com/badlogic/gdx/graphics/glutils/IndexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>IndexBufferObject
</code></a> is indices were given.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Mesh.html#unbind(com.badlogic.gdx.graphics.glutils.ShaderProgram, int[])">unbind
</a></strong>(
<a href="../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram
</a> shader,
int[]
locations)
</code>
<div class="block">Unbinds the underlying
<a href="../../../../com/badlogic/gdx/graphics/glutils/VertexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>VertexBufferObject
</code></a> and
<a href="../../../../com/badlogic/gdx/graphics/glutils/IndexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>IndexBufferObject
</code></a> is indices were given.
</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class
java.lang.Object
</h3>
<code>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
</code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ FIELD DETAIL =========== -->
<ul class="blockList">
<li class="blockList"><a name="field_detail">
<!-- -->
</a>
<h3>Field Detail
</h3>
<a name="forceVBO">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>forceVBO
</h4>
<pre>public static
boolean forceVBO
</pre>
<div class="block">used for benchmarking
</div>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail
</h3>
<a name="Mesh(boolean, int, int, com.badlogic.gdx.graphics.VertexAttribute...)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Mesh
</h4>
<pre>public
Mesh(boolean
isStatic,
int
maxVertices,
int
maxIndices,
<a href="../../../../com/badlogic/gdx/graphics/VertexAttribute.html" title="class in com.badlogic.gdx.graphics">VertexAttribute
</a>...
attributes)
</pre>
<div class="block">Creates a new Mesh with the given attributes.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>isStatic
</code> - whether this mesh is static or not. Allows for internal optimizations.
</dd><dd><code>maxVertices
</code> - the maximum number of vertices this mesh can hold
</dd><dd><code>maxIndices
</code> - the maximum number of indices this mesh can hold
</dd><dd><code>attributes
</code> - the
<a href="../../../../com/badlogic/gdx/graphics/VertexAttribute.html" title="class in com.badlogic.gdx.graphics"><code>VertexAttribute
</code></a>s. Each vertex attribute defines one property of a vertex such as position,
normal or texture coordinate
</dd></dl>
</li>
</ul>
<a name="Mesh(boolean, int, int, com.badlogic.gdx.graphics.VertexAttributes)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Mesh
</h4>
<pre>public
Mesh(boolean
isStatic,
int
maxVertices,
int
maxIndices,
<a href="../../../../com/badlogic/gdx/graphics/VertexAttributes.html" title="class in com.badlogic.gdx.graphics">VertexAttributes
</a> attributes)
</pre>
<div class="block">Creates a new Mesh with the given attributes.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>isStatic
</code> - whether this mesh is static or not. Allows for internal optimizations.
</dd><dd><code>maxVertices
</code> - the maximum number of vertices this mesh can hold
</dd><dd><code>maxIndices
</code> - the maximum number of indices this mesh can hold
</dd><dd><code>attributes
</code> - the
<a href="../../../../com/badlogic/gdx/graphics/VertexAttributes.html" title="class in com.badlogic.gdx.graphics"><code>VertexAttributes
</code></a>. Each vertex attribute defines one property of a vertex such as position,
normal or texture coordinate
</dd></dl>
</li>
</ul>
<a name="Mesh(boolean, boolean, int, int, com.badlogic.gdx.graphics.VertexAttributes)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>Mesh
</h4>
<pre>public
Mesh(boolean
staticVertices,
boolean
staticIndices,
int
maxVertices,
int
maxIndices,
<a href="../../../../com/badlogic/gdx/graphics/VertexAttributes.html" title="class in com.badlogic.gdx.graphics">VertexAttributes
</a> attributes)
</pre>
<div class="block">by jw:
Creates a new Mesh with the given attributes.
Adds extra optimizations for dynamic (frequently modified) meshes.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>staticVertices
</code> - whether vertices of this mesh are static or not. Allows for internal optimizations.
</dd><dd><code>staticIndices
</code> - whether indices of this mesh are static or not. Allows for internal optimizations.
</dd><dd><code>maxVertices
</code> - the maximum number of vertices this mesh can hold
</dd><dd><code>maxIndices
</code> - the maximum number of indices this mesh can hold
</dd><dd><code>attributes
</code> - the
<a href="../../../../com/badlogic/gdx/graphics/VertexAttributes.html" title="class in com.badlogic.gdx.graphics"><code>VertexAttributes
</code></a>. Each vertex attribute defines one property of a vertex such as position,
normal or texture coordinate
</dd></dl>
</li>
</ul>
<a name="Mesh(com.badlogic.gdx.graphics.Mesh.VertexDataType, boolean, int, int, com.badlogic.gdx.graphics.VertexAttribute...)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Mesh
</h4>
<pre>public
Mesh(
<a href="../../../../com/badlogic/gdx/graphics/Mesh.VertexDataType.html" title="enum in com.badlogic.gdx.graphics">Mesh.VertexDataType
</a> type,
boolean
isStatic,
int
maxVertices,
int
maxIndices,
<a href="../../../../com/badlogic/gdx/graphics/VertexAttribute.html" title="class in com.badlogic.gdx.graphics">VertexAttribute
</a>...
attributes)
</pre>
<div class="block">Creates a new Mesh with the given attributes. This is an expert method with no error checking. Use at your own risk.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>type
</code> - the
<a href="../../../../com/badlogic/gdx/graphics/Mesh.VertexDataType.html" title="enum in com.badlogic.gdx.graphics"><code>Mesh.VertexDataType
</code></a> to be used, VBO or VA.
</dd><dd><code>isStatic
</code> - whether this mesh is static or not. Allows for internal optimizations.
</dd><dd><code>maxVertices
</code> - the maximum number of vertices this mesh can hold
</dd><dd><code>maxIndices
</code> - the maximum number of indices this mesh can hold
</dd><dd><code>attributes
</code> - the
<a href="../../../../com/badlogic/gdx/graphics/VertexAttribute.html" title="class in com.badlogic.gdx.graphics"><code>VertexAttribute
</code></a>s. Each vertex attribute defines one property of a vertex such as position,
normal or texture coordinate
</dd></dl>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail
</h3>
<a name="create(boolean, com.badlogic.gdx.graphics.Mesh, com.badlogic.gdx.math.Matrix4[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>create
</h4>
<pre>public static
<a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a> create(boolean
isStatic,
<a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a> base,
<a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a>[]
transformations)
</pre>
<div class="block">Create a new Mesh that is a combination of transformations of the supplied base mesh.
Not all primitive types, like line strip and triangle strip, can be combined.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>isStatic
</code> - whether this mesh is static or not. Allows for internal optimizations.
</dd><dd><code>transformations
</code> - the transformations to apply to the meshes
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the combined mesh
</dd></dl>
</li>
</ul>
<a name="create(boolean, com.badlogic.gdx.graphics.Mesh[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>create
</h4>
<pre>public static
<a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a> create(boolean
isStatic,
<a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a>[]
meshes)
</pre>
<div class="block">Create a new Mesh that is a combination of the supplied meshes. The meshes must have the same VertexAttributes signature.
Not all primitive types, like line strip and triangle strip, can be combined.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>isStatic
</code> - whether this mesh is static or not. Allows for internal optimizations.
</dd><dd><code>meshes
</code> - the meshes to combine
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the combined mesh
</dd></dl>
</li>
</ul>
<a name="create(boolean, com.badlogic.gdx.graphics.Mesh[], com.badlogic.gdx.math.Matrix4[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>create
</h4>
<pre>public static
<a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a> create(boolean
isStatic,
<a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a>[]
meshes,
<a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a>[]
transformations)
</pre>
<div class="block">Create a new Mesh that is a combination of the supplied meshes. The meshes must have the same VertexAttributes signature.
If transformations is supplied, it must have the same length as meshes.
Not all primitive types, like line strip and triangle strip, can be combined.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>isStatic
</code> - whether this mesh is static or not. Allows for internal optimizations.
</dd><dd><code>meshes
</code> - the meshes to combine
</dd><dd><code>transformations
</code> - the transformations to apply to the meshes
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the combined mesh
</dd></dl>
</li>
</ul>
<a name="setVertices(float[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setVertices
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a> setVertices(float[]
vertices)
</pre>
<div class="block">Sets the vertices of this Mesh. The attributes are assumed to be given in float format.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>vertices
</code> - the vertices.
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the mesh for invocation chaining.
</dd></dl>
</li>
</ul>
<a name="setVertices(float[], int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setVertices
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a> setVertices(float[]
vertices,
int
offset,
int
count)
</pre>
<div class="block">Sets the vertices of this Mesh. The attributes are assumed to be given in float format.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>vertices
</code> - the vertices.
</dd><dd><code>offset
</code> - the offset into the vertices array
</dd><dd><code>count
</code> - the number of floats to use
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the mesh for invocation chaining.
</dd></dl>
</li>
</ul>
<a name="getVertices(float[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getVertices
</h4>
<pre>public
void
getVertices(float[]
vertices)
</pre>
<div class="block">Copies the vertices from the Mesh to the float array. The float array must be large enough to hold all the Mesh's vertices.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>vertices
</code> - the array to copy the vertices to
</dd></dl>
</li>
</ul>
<a name="getVertices(int, float[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getVertices
</h4>
<pre>public
void
getVertices(int
srcOffset,
float[]
vertices)
</pre>
<div class="block">Copies the the remaining vertices from the Mesh to the float array. The float array must be large enough to hold the remaining vertices.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>srcOffset
</code> - the offset (in number of floats) of the vertices in the mesh to copy
</dd><dd><code>vertices
</code> - the array to copy the vertices to
</dd></dl>
</li>
</ul>
<a name="getVertices(int, int, float[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getVertices
</h4>
<pre>public
void
getVertices(int
srcOffset,
int
count,
float[]
vertices)
</pre>
<div class="block">Copies the specified vertices from the Mesh to the float array. The float array must be large enough to hold count vertices.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>srcOffset
</code> - the offset (in number of floats) of the vertices in the mesh to copy
</dd><dd><code>count
</code> - the amount of floats to copy
</dd><dd><code>vertices
</code> - the array to copy the vertices to
</dd></dl>
</li>
</ul>
<a name="getVertices(int, int, float[], int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getVertices
</h4>
<pre>public
void
getVertices(int
srcOffset,
int
count,
float[]
vertices,
int
destOffset)
</pre>
<div class="block">Copies the specified vertices from the Mesh to the float array. The float array must be large enough to hold destOffset+count vertices.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>srcOffset
</code> - the offset (in number of floats) of the vertices in the mesh to copy
</dd><dd><code>count
</code> - the amount of floats to copy
</dd><dd><code>vertices
</code> - the array to copy the vertices to
</dd><dd><code>destOffset
</code> - the offset (in floats) in the vertices array to start copying
</dd></dl>
</li>
</ul>
<a name="setIndices(short[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setIndices
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a> setIndices(short[]
indices)
</pre>
<div class="block">Sets the indices of this Mesh
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>indices
</code> - the indices
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the mesh for invocation chaining.
</dd></dl>
</li>
</ul>
<a name="setIndices(short[], int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setIndices
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a> setIndices(short[]
indices,
int
offset,
int
count)
</pre>
<div class="block">Sets the indices of this Mesh.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>indices
</code> - the indices
</dd><dd><code>offset
</code> - the offset into the indices array
</dd><dd><code>count
</code> - the number of indices to copy
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the mesh for invocation chaining.
</dd></dl>
</li>
</ul>
<a name="getIndices(short[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getIndices
</h4>
<pre>public
void
getIndices(short[]
indices)
</pre>
<div class="block">Copies the indices from the Mesh to the short array. The short array must be large enough to hold all the Mesh's indices.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>indices
</code> - the array to copy the indices to
</dd></dl>
</li>
</ul>
<a name="getIndices(short[], int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getIndices
</h4>
<pre>public
void
getIndices(short[]
indices,
int
destOffset)
</pre>
<div class="block">Copies the indices from the Mesh to the short array. The short array must be large enough to hold destOffset + all the Mesh's indices.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>indices
</code> - the array to copy the indices to
</dd><dd><code>destOffset
</code> - the offset in the indices array to start copying
</dd></dl>
</li>
</ul>
<a name="getNumIndices()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNumIndices
</h4>
<pre>public
int
getNumIndices()
</pre>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the number of defined indices
</dd></dl>
</li>
</ul>
<a name="getNumVertices()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getNumVertices
</h4>
<pre>public
int
getNumVertices()
</pre>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the number of defined vertices
</dd></dl>
</li>
</ul>
<a name="getMaxVertices()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxVertices
</h4>
<pre>public
int
getMaxVertices()
</pre>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the maximum number of vertices this mesh can hold
</dd></dl>
</li>
</ul>
<a name="getMaxIndices()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMaxIndices
</h4>
<pre>public
int
getMaxIndices()
</pre>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the maximum number of indices this mesh can hold
</dd></dl>
</li>
</ul>
<a name="getVertexSize()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getVertexSize
</h4>
<pre>public
int
getVertexSize()
</pre>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the size of a single vertex in bytes
</dd></dl>
</li>
</ul>
<a name="setAutoBind(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setAutoBind
</h4>
<pre>public
void
setAutoBind(boolean
autoBind)
</pre>
<div class="block">Sets whether to bind the underlying
<a href="../../../../com/badlogic/gdx/graphics/glutils/VertexArray.html" title="class in com.badlogic.gdx.graphics.glutils"><code>VertexArray
</code></a> or
<a href="../../../../com/badlogic/gdx/graphics/glutils/VertexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>VertexBufferObject
</code></a> automatically on a call to one of the
<a href="../../../../com/badlogic/gdx/graphics/Mesh.html#render(int)"><code>render(int)
</code></a> methods or not. Usually you want to use autobind. Manual binding is an expert functionality. There is a
driver bug on the MSM720xa chips that will fuck up memory if you manipulate the vertices and indices of a Mesh multiple
times while it is bound. Keep this in mind.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>autoBind
</code> - whether to autobind meshes.
</dd></dl>
</li>
</ul>
<a name="bind()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>bind
</h4>
<pre>public
void
bind()
</pre>
<div class="block">Binds the underlying
<a href="../../../../com/badlogic/gdx/graphics/glutils/VertexArray.html" title="class in com.badlogic.gdx.graphics.glutils"><code>VertexArray
</code></a>/
<a href="../../../../com/badlogic/gdx/graphics/glutils/VertexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>VertexBufferObject
</code></a> and
<a href="../../../../com/badlogic/gdx/graphics/glutils/IndexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>IndexBufferObject
</code></a> if indices were given. Use
this with OpenGL ES 1.x and when auto-bind is disabled.
</div>
</li>
</ul>
<a name="unbind()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unbind
</h4>
<pre>public
void
unbind()
</pre>
<div class="block">Unbinds the underlying
<a href="../../../../com/badlogic/gdx/graphics/glutils/VertexArray.html" title="class in com.badlogic.gdx.graphics.glutils"><code>VertexArray
</code></a>/
<a href="../../../../com/badlogic/gdx/graphics/glutils/VertexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>VertexBufferObject
</code></a> and
<a href="../../../../com/badlogic/gdx/graphics/glutils/IndexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>IndexBufferObject
</code></a> is indices were given.
Use this with OpenGL ES 1.x and when auto-bind is disabled.
</div>
</li>
</ul>
<a name="bind(com.badlogic.gdx.graphics.glutils.ShaderProgram)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>bind
</h4>
<pre>public
void
bind(
<a href="../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram
</a> shader)
</pre>
<div class="block">Binds the underlying
<a href="../../../../com/badlogic/gdx/graphics/glutils/VertexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>VertexBufferObject
</code></a> and
<a href="../../../../com/badlogic/gdx/graphics/glutils/IndexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>IndexBufferObject
</code></a> if indices where given. Use this with OpenGL
ES 2.0 and when auto-bind is disabled.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>shader
</code> - the shader (does not bind the shader)
</dd></dl>
</li>
</ul>
<a name="bind(com.badlogic.gdx.graphics.glutils.ShaderProgram, int[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>bind
</h4>
<pre>public
void
bind(
<a href="../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram
</a> shader,
int[]
locations)
</pre>
<div class="block">Binds the underlying
<a href="../../../../com/badlogic/gdx/graphics/glutils/VertexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>VertexBufferObject
</code></a> and
<a href="../../../../com/badlogic/gdx/graphics/glutils/IndexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>IndexBufferObject
</code></a> if indices where given. Use this with OpenGL
ES 2.0 and when auto-bind is disabled.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>shader
</code> - the shader (does not bind the shader)
</dd><dd><code>locations
</code> - array containing the attribute locations.
</dd></dl>
</li>
</ul>
<a name="unbind(com.badlogic.gdx.graphics.glutils.ShaderProgram)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unbind
</h4>
<pre>public
void
unbind(
<a href="../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram
</a> shader)
</pre>
<div class="block">Unbinds the underlying
<a href="../../../../com/badlogic/gdx/graphics/glutils/VertexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>VertexBufferObject
</code></a> and
<a href="../../../../com/badlogic/gdx/graphics/glutils/IndexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>IndexBufferObject
</code></a> is indices were given. Use this with OpenGL
ES 1.x and when auto-bind is disabled.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>shader
</code> - the shader (does not unbind the shader)
</dd></dl>
</li>
</ul>
<a name="unbind(com.badlogic.gdx.graphics.glutils.ShaderProgram, int[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unbind
</h4>
<pre>public
void
unbind(
<a href="../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram
</a> shader,
int[]
locations)
</pre>
<div class="block">Unbinds the underlying
<a href="../../../../com/badlogic/gdx/graphics/glutils/VertexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>VertexBufferObject
</code></a> and
<a href="../../../../com/badlogic/gdx/graphics/glutils/IndexBufferObject.html" title="class in com.badlogic.gdx.graphics.glutils"><code>IndexBufferObject
</code></a> is indices were given. Use this with OpenGL
ES 1.x and when auto-bind is disabled.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>shader
</code> - the shader (does not unbind the shader)
</dd><dd><code>locations
</code> - array containing the attribute locations.
</dd></dl>
</li>
</ul>
<a name="render(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>render
</h4>
<pre>public
void
render(int
primitiveType)
</pre>
<div class="block"><p>
Renders the mesh using the given primitive type. If indices are set for this mesh then getNumIndices() / #vertices per
primitive primitives are rendered. If no indices are set then getNumVertices() / #vertices per primitive are rendered.
</p>
<p>
This method is intended for use with OpenGL ES 1.x and will throw an IllegalStateException when OpenGL ES 2.0 is used.
</p></div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>primitiveType
</code> - the primitive type
</dd></dl>
</li>
</ul>
<a name="render(int, int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>render
</h4>
<pre>public
void
render(int
primitiveType,
int
offset,
int
count)
</pre>
<div class="block"><p>
Renders the mesh using the given primitive type. offset specifies the offset into vertex buffer and is ignored for the index
buffer. Count specifies the number of vertices or indices to use thus count / #vertices per primitive primitives are
rendered.
</p>
<p>
This method is intended for use with OpenGL ES 1.x and will throw an IllegalStateException when OpenGL ES 2.0 is used.
</p></div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>primitiveType
</code> - the primitive type
</dd><dd><code>offset
</code> - the offset into the vertex buffer, ignored for indexed rendering
</dd><dd><code>count
</code> - number of vertices or indices to use
</dd></dl>
</li>
</ul>
<a name="render(int, int, int, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>render
</h4>
<pre>public
void
render(int
primitiveType,
int
offset,
int
count,
boolean
autoBind)
</pre>
<div class="block"><p>
Renders the mesh using the given primitive type. offset specifies the offset into vertex buffer and is ignored for the index
buffer. Count specifies the number of vertices or indices to use thus count / #vertices per primitive primitives are
rendered.
</p>
<p>
This method is intended for use with OpenGL ES 1.x and will throw an IllegalStateException when OpenGL ES 2.0 is used.
</p></div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>primitiveType
</code> - the primitive type
</dd><dd><code>offset
</code> - the offset into the vertex buffer, ignored for indexed rendering
</dd><dd><code>count
</code> - number of vertices or indices to use
</dd><dd><code>autoBind
</code> - overrides the autoBind member of this Mesh
</dd></dl>
</li>
</ul>
<a name="render(com.badlogic.gdx.graphics.glutils.ShaderProgram, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>render
</h4>
<pre>public
void
render(
<a href="../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram
</a> shader,
int
primitiveType)
</pre>
<div class="block"><p>
Renders the mesh using the given primitive type. If indices are set for this mesh then getNumIndices() / #vertices per
primitive primitives are rendered. If no indices are set then getNumVertices() / #vertices per primitive are rendered.
</p>
<p>
This method will automatically bind each vertex attribute as specified at construction time via
<a href="../../../../com/badlogic/gdx/graphics/VertexAttributes.html" title="class in com.badlogic.gdx.graphics"><code>VertexAttributes
</code></a> to
the respective shader attributes. The binding is based on the alias defined for each VertexAttribute.
</p>
<p>
This method must only be called after the
<a href="../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html#begin()"><code>ShaderProgram.begin()
</code></a> method has been called!
</p>
<p>
This method is intended for use with OpenGL ES 2.0 and will throw an IllegalStateException when OpenGL ES 1.x is used.
</p></div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>primitiveType
</code> - the primitive type
</dd></dl>
</li>
</ul>
<a name="render(com.badlogic.gdx.graphics.glutils.ShaderProgram, int, int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>render
</h4>
<pre>public
void
render(
<a href="../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram
</a> shader,
int
primitiveType,
int
offset,
int
count)
</pre>
<div class="block"><p>
Renders the mesh using the given primitive type. offset specifies the offset into either the vertex buffer or the index
buffer depending on whether indices are defined. count specifies the number of vertices or indices to use thus count /
#vertices per primitive primitives are rendered.
</p>
<p>
This method will automatically bind each vertex attribute as specified at construction time via
<a href="../../../../com/badlogic/gdx/graphics/VertexAttributes.html" title="class in com.badlogic.gdx.graphics"><code>VertexAttributes
</code></a> to
the respective shader attributes. The binding is based on the alias defined for each VertexAttribute.
</p>
<p>
This method must only be called after the
<a href="../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html#begin()"><code>ShaderProgram.begin()
</code></a> method has been called!
</p>
<p>
This method is intended for use with OpenGL ES 2.0 and will throw an IllegalStateException when OpenGL ES 1.x is used.
</p></div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>shader
</code> - the shader to be used
</dd><dd><code>primitiveType
</code> - the primitive type
</dd><dd><code>offset
</code> - the offset into the vertex or index buffer
</dd><dd><code>count
</code> - number of vertices or indices to use
</dd></dl>
</li>
</ul>
<a name="render(com.badlogic.gdx.graphics.glutils.ShaderProgram, int, int, int, boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>render
</h4>
<pre>public
void
render(
<a href="../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html" title="class in com.badlogic.gdx.graphics.glutils">ShaderProgram
</a> shader,
int
primitiveType,
int
offset,
int
count,
boolean
autoBind)
</pre>
<div class="block"><p>
Renders the mesh using the given primitive type. offset specifies the offset into either the vertex buffer or the index
buffer depending on whether indices are defined. count specifies the number of vertices or indices to use thus count /
#vertices per primitive primitives are rendered.
</p>
<p>
This method will automatically bind each vertex attribute as specified at construction time via
<a href="../../../../com/badlogic/gdx/graphics/VertexAttributes.html" title="class in com.badlogic.gdx.graphics"><code>VertexAttributes
</code></a> to
the respective shader attributes. The binding is based on the alias defined for each VertexAttribute.
</p>
<p>
This method must only be called after the
<a href="../../../../com/badlogic/gdx/graphics/glutils/ShaderProgram.html#begin()"><code>ShaderProgram.begin()
</code></a> method has been called!
</p>
<p>
This method is intended for use with OpenGL ES 2.0 and will throw an IllegalStateException when OpenGL ES 1.x is used.
</p></div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>shader
</code> - the shader to be used
</dd><dd><code>primitiveType
</code> - the primitive type
</dd><dd><code>offset
</code> - the offset into the vertex or index buffer
</dd><dd><code>count
</code> - number of vertices or indices to use
</dd><dd><code>autoBind
</code> - overrides the autoBind member of this Mesh
</dd></dl>
</li>
</ul>
<a name="dispose()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>dispose
</h4>
<pre>public
void
dispose()
</pre>
<div class="block">Frees all resources associated with this Mesh
</div>
<dl>
<dt><strong>Specified by:
</strong></dt>
<dd><code><a href="../../../../com/badlogic/gdx/utils/Disposable.html#dispose()">dispose
</a></code> in interface
<code><a href="../../../../com/badlogic/gdx/utils/Disposable.html" title="interface in com.badlogic.gdx.utils">Disposable
</a></code></dd>
</dl>
</li>
</ul>
<a name="getVertexAttribute(int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getVertexAttribute
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/graphics/VertexAttribute.html" title="class in com.badlogic.gdx.graphics">VertexAttribute
</a> getVertexAttribute(int
usage)
</pre>
<div class="block">Returns the first
<a href="../../../../com/badlogic/gdx/graphics/VertexAttribute.html" title="class in com.badlogic.gdx.graphics"><code>VertexAttribute
</code></a> having the given
<a href="../../../../com/badlogic/gdx/graphics/VertexAttributes.Usage.html" title="class in com.badlogic.gdx.graphics"><code>VertexAttributes.Usage
</code></a>.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>usage
</code> - the Usage.
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the VertexAttribute or null if no attribute with that usage was found.
</dd></dl>
</li>
</ul>
<a name="getVertexAttributes()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getVertexAttributes
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/graphics/VertexAttributes.html" title="class in com.badlogic.gdx.graphics">VertexAttributes
</a> getVertexAttributes()
</pre>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the vertex attributes of this Mesh
</dd></dl>
</li>
</ul>
<a name="getVerticesBuffer()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getVerticesBuffer
</h4>
<pre>public
java.nio.FloatBuffer
getVerticesBuffer()
</pre>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the backing FloatBuffer holding the vertices. Does not have to be a direct buffer on Android!
</dd></dl>
</li>
</ul>
<a name="calculateBoundingBox()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>calculateBoundingBox
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision">BoundingBox
</a> calculateBoundingBox()
</pre>
<div class="block">Calculates the
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision"><code>BoundingBox
</code></a> of the vertices contained in this mesh. In case no vertices are defined yet a
<a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils"><code>GdxRuntimeException
</code></a> is thrown. This method creates a new BoundingBox instance.
</div>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the bounding box.
</dd></dl>
</li>
</ul>
<a name="calculateBoundingBox(com.badlogic.gdx.math.collision.BoundingBox)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>calculateBoundingBox
</h4>
<pre>public
void
calculateBoundingBox(
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision">BoundingBox
</a> bbox)
</pre>
<div class="block">Calculates the
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision"><code>BoundingBox
</code></a> of the vertices contained in this mesh. In case no vertices are defined yet a
<a href="../../../../com/badlogic/gdx/utils/GdxRuntimeException.html" title="class in com.badlogic.gdx.utils"><code>GdxRuntimeException
</code></a> is thrown.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>bbox
</code> - the bounding box to store the result in.
</dd></dl>
</li>
</ul>
<a name="calculateBoundingBox(com.badlogic.gdx.math.collision.BoundingBox, int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>calculateBoundingBox
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision">BoundingBox
</a> calculateBoundingBox(
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision">BoundingBox
</a> out,
int
offset,
int
count)
</pre>
<div class="block">Calculate the
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision"><code>BoundingBox
</code></a> of the specified part.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>out
</code> - the bounding box to store the result in.
</dd><dd><code>offset
</code> - the start index of the part.
</dd><dd><code>count
</code> - the amount of indices the part contains.
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the value specified by out.
</dd></dl>
</li>
</ul>
<a name="calculateBoundingBox(com.badlogic.gdx.math.collision.BoundingBox, int, int, com.badlogic.gdx.math.Matrix4)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>calculateBoundingBox
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision">BoundingBox
</a> calculateBoundingBox(
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision">BoundingBox
</a> out,
int
offset,
int
count,
<a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> transform)
</pre>
<div class="block">Calculate the
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision"><code>BoundingBox
</code></a> of the specified part.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>out
</code> - the bounding box to store the result in.
</dd><dd><code>offset
</code> - the start index of the part.
</dd><dd><code>count
</code> - the amount of indices the part contains.
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the value specified by out.
</dd></dl>
</li>
</ul>
<a name="extendBoundingBox(com.badlogic.gdx.math.collision.BoundingBox, int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>extendBoundingBox
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision">BoundingBox
</a> extendBoundingBox(
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision">BoundingBox
</a> out,
int
offset,
int
count)
</pre>
<div class="block">Extends the specified
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision"><code>BoundingBox
</code></a> with the specified part.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>out
</code> - the bounding box to store the result in.
</dd><dd><code>offset
</code> - the start index of the part.
</dd><dd><code>count
</code> - the amount of indices the part contains.
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the value specified by out.
</dd></dl>
</li>
</ul>
<a name="extendBoundingBox(com.badlogic.gdx.math.collision.BoundingBox, int, int, com.badlogic.gdx.math.Matrix4)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>extendBoundingBox
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision">BoundingBox
</a> extendBoundingBox(
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision">BoundingBox
</a> out,
int
offset,
int
count,
<a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> transform)
</pre>
<div class="block">Extends the specified
<a href="../../../../com/badlogic/gdx/math/collision/BoundingBox.html" title="class in com.badlogic.gdx.math.collision"><code>BoundingBox
</code></a> with the specified part.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>out
</code> - the bounding box to store the result in.
</dd><dd><code>offset
</code> - the start index of the part.
</dd><dd><code>count
</code> - the amount of indices the part contains.
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the value specified by out.
</dd></dl>
</li>
</ul>
<a name="getIndicesBuffer()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getIndicesBuffer
</h4>
<pre>public
java.nio.ShortBuffer
getIndicesBuffer()
</pre>
<dl><dt><span class="strong">Returns:
</span></dt><dd>the backing shortbuffer holding the indices. Does not have to be a direct buffer on Android!
</dd></dl>
</li>
</ul>
<a name="invalidateAllMeshes(com.badlogic.gdx.Application)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>invalidateAllMeshes
</h4>
<pre>public static
void
invalidateAllMeshes(
<a href="../../../../com/badlogic/gdx/Application.html" title="interface in com.badlogic.gdx">Application
</a> app)
</pre>
<div class="block">Invalidates all meshes so the next time they are rendered new VBO handles are generated.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>app
</code> -
</dd></dl>
</li>
</ul>
<a name="clearAllMeshes(com.badlogic.gdx.Application)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clearAllMeshes
</h4>
<pre>public static
void
clearAllMeshes(
<a href="../../../../com/badlogic/gdx/Application.html" title="interface in com.badlogic.gdx">Application
</a> app)
</pre>
<div class="block">Will clear the managed mesh cache. I wouldn't use this if i was you :)
</div>
</li>
</ul>
<a name="getManagedStatus()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getManagedStatus
</h4>
<pre>public static
java.lang.String
getManagedStatus()
</pre>
</li>
</ul>
<a name="scale(float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>scale
</h4>
<pre>public
void
scale(float
scaleX,
float
scaleY,
float
scaleZ)
</pre>
<div class="block">Method to scale the positions in the mesh. Normals will be kept as is. This is a potentially slow operation, use with care.
It will also create a temporary float[] which will be garbage collected.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>scaleX
</code> - scale on x
</dd><dd><code>scaleY
</code> - scale on y
</dd><dd><code>scaleZ
</code> - scale on z
</dd></dl>
</li>
</ul>
<a name="transform(com.badlogic.gdx.math.Matrix4)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>transform
</h4>
<pre>public
void
transform(
<a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> matrix)
</pre>
<div class="block">Method to transform the positions in the mesh. Normals will be kept as is. This is a potentially slow operation, use with care.
It will also create a temporary float[] which will be garbage collected.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>matrix
</code> - the transformation matrix
</dd></dl>
</li>
</ul>
<a name="transform(com.badlogic.gdx.math.Matrix4, int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>transform
</h4>
<pre>protected
void
transform(
<a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> matrix,
int
start,
int
count)
</pre>
</li>
</ul>
<a name="transform(com.badlogic.gdx.math.Matrix4, float[], int, int, int, int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>transform
</h4>
<pre>public static
void
transform(
<a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> matrix,
float[]
vertices,
int
vertexSize,
int
offset,
int
dimensions,
int
start,
int
count)
</pre>
<div class="block">Method to transform the positions in the float array. Normals will be kept as is. This is a potentially slow operation, use with care.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>matrix
</code> - the transformation matrix
</dd><dd><code>vertices
</code> - the float array
</dd><dd><code>vertexSize
</code> - the number of floats in each vertex
</dd><dd><code>offset
</code> - the offset within a vertex to the position
</dd><dd><code>dimensions
</code> - the size of the position
</dd><dd><code>start
</code> - the vertex to start with
</dd><dd><code>count
</code> - the amount of vertices to transform
</dd></dl>
</li>
</ul>
<a name="transformUV(com.badlogic.gdx.math.Matrix3)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>transformUV
</h4>
<pre>public
void
transformUV(
<a href="../../../../com/badlogic/gdx/math/Matrix3.html" title="class in com.badlogic.gdx.math">Matrix3
</a> matrix)
</pre>
<div class="block">Method to transform the texture coordinates in the mesh. This is a potentially slow operation, use with care.
It will also create a temporary float[] which will be garbage collected.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>matrix
</code> - the transformation matrix
</dd></dl>
</li>
</ul>
<a name="transformUV(com.badlogic.gdx.math.Matrix3, int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>transformUV
</h4>
<pre>protected
void
transformUV(
<a href="../../../../com/badlogic/gdx/math/Matrix3.html" title="class in com.badlogic.gdx.math">Matrix3
</a> matrix,
int
start,
int
count)
</pre>
</li>
</ul>
<a name="transformUV(com.badlogic.gdx.math.Matrix3, float[], int, int, int, int)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>transformUV
</h4>
<pre>public static
void
transformUV(
<a href="../../../../com/badlogic/gdx/math/Matrix3.html" title="class in com.badlogic.gdx.math">Matrix3
</a> matrix,
float[]
vertices,
int
vertexSize,
int
offset,
int
start,
int
count)
</pre>
<div class="block">Method to transform the texture coordinates (UV) in the float array. This is a potentially slow operation, use with care.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>matrix
</code> - the transformation matrix
</dd><dd><code>vertices
</code> - the float array
</dd><dd><code>vertexSize
</code> - the number of floats in each vertex
</dd><dd><code>offset
</code> - the offset within a vertex to the texture location
</dd><dd><code>start
</code> - the vertex to start with
</dd><dd><code>count
</code> - the amount of vertices to transform
</dd></dl>
</li>
</ul>
<a name="copy(boolean, boolean, int[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>copy
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a> copy(boolean
isStatic,
boolean
removeDuplicates,
int[]
usage)
</pre>
<div class="block">Copies this mesh optionally removing duplicate vertices and/or reducing the amount of attributes.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>isStatic
</code> - whether the new mesh is static or not. Allows for internal optimizations.
</dd><dd><code>removeDuplicates
</code> - whether to remove duplicate vertices if possible. Only the vertices specified by usage are checked.
</dd><dd><code>usage
</code> - which attributes (if available) to copy
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the copy of this mesh
</dd></dl>
</li>
</ul>
<a name="copy(boolean)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>copy
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/graphics/Mesh.html" title="class in com.badlogic.gdx.graphics">Mesh
</a> copy(boolean
isStatic)
</pre>
<div class="block">Copies this mesh.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>isStatic
</code> - whether the new mesh is static or not. Allows for internal optimizations.
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the copy of this mesh
</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../../overview-summary.html">Overview
</a></li>
<li><a href="package-summary.html">Package
</a></li>
<li class="navBarCell1Rev">Class
</li>
<li><a href="class-use/Mesh.html">Use
</a></li>
<li><a href="package-tree.html">Tree
</a></li>
<li><a href="../../../../deprecated-list.html">Deprecated
</a></li>
<li><a href="../../../../index-all.html">Index
</a></li>
<li><a href="../../../../help-doc.html">Help
</a></li>
</ul>
<div class="aboutLanguage"><em>libgdx API
</em></div>
</div>
<div class="subNav">
<ul class="navList">
<li><a href="../../../../com/badlogic/gdx/graphics/GLTexture.html" title="class in com.badlogic.gdx.graphics"><span class="strong">Prev Class
</span></a></li>
<li><a href="../../../../com/badlogic/gdx/graphics/Mesh.VertexDataType.html" title="enum in com.badlogic.gdx.graphics"><span class="strong">Next Class
</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../../index.html?com/badlogic/gdx/graphics/Mesh.html" target="_top">Frames
</a></li>
<li><a href="Mesh.html" target="_top">No Frames
</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../../allclasses-noframe.html">All Classes
</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:
</li>
<li><a href="#nested_class_summary">Nested
</a> |
</li>
<li><a href="#field_summary">Field
</a> |
</li>
<li><a href="#constructor_summary">Constr
</a> |
</li>
<li><a href="#method_summary">Method
</a></li>
</ul>
<ul class="subNavList">
<li>Detail:
</li>
<li><a href="#field_detail">Field
</a> |
</li>
<li><a href="#constructor_detail">Constr
</a> |
</li>
<li><a href="#method_detail">Method
</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>
<div style="font-size:9pt"><i>
Copyright
© 2010-2013 Mario Zechner (contact@badlogicgames.com), Nathan Sweet (admin@esotericsoftware.com)
</i></div>
</small></p>
</body>
</html>