<!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>Camera (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="Camera (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/Camera.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>Prev Class
</li>
<li><a href="../../../../com/badlogic/gdx/graphics/Color.html" title="class 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/Camera.html" target="_top">Frames
</a></li>
<li><a href="Camera.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>Nested
|
</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 Camera" class="title">Class Camera
</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li>java.lang.Object
</li>
<li>
<ul class="inheritance">
<li>com.badlogic.gdx.graphics.Camera
</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Direct Known Subclasses:
</dt>
<dd><a href="../../../../com/badlogic/gdx/graphics/OrthographicCamera.html" title="class in com.badlogic.gdx.graphics">OrthographicCamera
</a>,
<a href="../../../../com/badlogic/gdx/graphics/PerspectiveCamera.html" title="class in com.badlogic.gdx.graphics">PerspectiveCamera
</a></dd>
</dl>
<hr>
<br>
<pre>public abstract class
<span class="strong">Camera
</span>
extends java.lang.Object
</pre>
<div class="block">Base class for
<a href="../../../../com/badlogic/gdx/graphics/OrthographicCamera.html" title="class in com.badlogic.gdx.graphics"><code>OrthographicCamera
</code></a> and
<a href="../../../../com/badlogic/gdx/graphics/PerspectiveCamera.html" title="class in com.badlogic.gdx.graphics"><code>PerspectiveCamera
</code></a>.
</div>
<dl><dt><span class="strong">Author:
</span></dt>
<dd>mzechner
</dd></dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- =========== 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><a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#combined">combined
</a></strong></code>
<div class="block">the combined projection and view matrix
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#direction">direction
</a></strong></code>
<div class="block">the unit length direction vector of the camera
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>float
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#far">far
</a></strong></code>
<div class="block">the far clipping plane distance, has to be positive
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/math/Frustum.html" title="class in com.badlogic.gdx.math">Frustum
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#frustum">frustum
</a></strong></code>
<div class="block">the frustum
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#invProjectionView">invProjectionView
</a></strong></code>
<div class="block">the inverse combined projection and view matrix
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>float
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#near">near
</a></strong></code>
<div class="block">the near clipping plane distance, has to be positive
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#position">position
</a></strong></code>
<div class="block">the position of the camera
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#projection">projection
</a></strong></code>
<div class="block">the projection matrix
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#up">up
</a></strong></code>
<div class="block">the unit length up vector of the camera
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#view">view
</a></strong></code>
<div class="block">the view matrix
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>float
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#viewportHeight">viewportHeight
</a></strong></code>
<div class="block">the viewport height
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>float
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#viewportWidth">viewportWidth
</a></strong></code>
<div class="block">the viewport width
</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/Camera.html#Camera()">Camera
</a></strong>()
</code> </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/Camera.html#apply(com.badlogic.gdx.graphics.GL10)">apply
</a></strong>(
<a href="../../../../com/badlogic/gdx/graphics/GL10.html" title="interface in com.badlogic.gdx.graphics">GL10
</a> gl)
</code>
<div class="block">Sets the current projection and model-view matrix of this camera.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/math/collision/Ray.html" title="class in com.badlogic.gdx.math.collision">Ray
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#getPickRay(float, float)">getPickRay
</a></strong>(float
x,
float
y)
</code>
<div class="block">Creates a picking
<a href="../../../../com/badlogic/gdx/math/collision/Ray.html" title="class in com.badlogic.gdx.math.collision"><code>Ray
</code></a> from the coordinates given in window coordinates.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="../../../../com/badlogic/gdx/math/collision/Ray.html" title="class in com.badlogic.gdx.math.collision">Ray
</a></code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#getPickRay(float, float, float, float, float, float)">getPickRay
</a></strong>(float
x,
float
y,
float
viewportX,
float
viewportY,
float
viewportWidth,
float
viewportHeight)
</code>
<div class="block">Creates a picking
<a href="../../../../com/badlogic/gdx/math/collision/Ray.html" title="class in com.badlogic.gdx.math.collision"><code>Ray
</code></a> from the coordinates given in window coordinates.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#lookAt(float, float, float)">lookAt
</a></strong>(float
x,
float
y,
float
z)
</code>
<div class="block">Recalculates the direction of the camera to look at the point (x, y, z).
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#lookAt(com.badlogic.gdx.math.Vector3)">lookAt
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> target)
</code>
<div class="block">Recalculates the direction of the camera to look at the point (x, y, z).
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#normalizeUp()">normalizeUp
</a></strong>()
</code>
<div class="block">Normalizes the up vector by first calculating the right vector via a cross product between direction and up, and then
recalculating the up vector via a cross product between right and direction.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#project(com.badlogic.gdx.math.Vector3)">project
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> vec)
</code>
<div class="block">Projects the
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math"><code>Vector3
</code></a> given in object/world space to window coordinates.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#project(com.badlogic.gdx.math.Vector3, float, float, float, float)">project
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> vec,
float
viewportX,
float
viewportY,
float
viewportWidth,
float
viewportHeight)
</code>
<div class="block">Projects the
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math"><code>Vector3
</code></a> given in object/world space to window coordinates.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#rotate(float, float, float, float)">rotate
</a></strong>(float
angle,
float
axisX,
float
axisY,
float
axisZ)
</code>
<div class="block">Rotates the direction and up vector of this camera by the given angle around the given axis.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#rotate(com.badlogic.gdx.math.Matrix4)">rotate
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> transform)
</code>
<div class="block">Rotates the direction and up vector of this camera by the given rotation matrix.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#rotate(com.badlogic.gdx.math.Quaternion)">rotate
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/Quaternion.html" title="class in com.badlogic.gdx.math">Quaternion
</a> quat)
</code>
<div class="block">Rotates the direction and up vector of this camera by the given
<a href="../../../../com/badlogic/gdx/math/Quaternion.html" title="class in com.badlogic.gdx.math"><code>Quaternion
</code></a>.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#rotate(com.badlogic.gdx.math.Vector3, float)">rotate
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> axis,
float
angle)
</code>
<div class="block">Rotates the direction and up vector of this camera by the given angle around the given axis.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#rotateAround(com.badlogic.gdx.math.Vector3, com.badlogic.gdx.math.Vector3, float)">rotateAround
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> point,
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> axis,
float
angle)
</code>
<div class="block">Rotates the direction and up vector of this camera by the given angle around the given axis, with the axis attached to given
point.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.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> transform)
</code>
<div class="block">Transform the position, direction and up vector by the given matrix
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#translate(float, float, float)">translate
</a></strong>(float
x,
float
y,
float
z)
</code>
<div class="block">Moves the camera by the given amount on each axis.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#translate(com.badlogic.gdx.math.Vector3)">translate
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> vec)
</code>
<div class="block">Moves the camera by the given vector.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#unproject(com.badlogic.gdx.math.Vector3)">unproject
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> vec)
</code>
<div class="block">Function to translate a point given in window (or window) coordinates to world space.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#unproject(com.badlogic.gdx.math.Vector3, float, float, float, float)">unproject
</a></strong>(
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> vec,
float
viewportX,
float
viewportY,
float
viewportWidth,
float
viewportHeight)
</code>
<div class="block">Function to translate a point given in window (or window) coordinates to world space.
</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#update()">update
</a></strong>()
</code>
<div class="block">Recalculates the projection and view matrix of this camera and the
<a href="../../../../com/badlogic/gdx/math/Frustum.html" title="class in com.badlogic.gdx.math"><code>Frustum
</code></a> planes.
</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract void
</code></td>
<td class="colLast"><code><strong><a href="../../../../com/badlogic/gdx/graphics/Camera.html#update(boolean)">update
</a></strong>(boolean
updateFrustum)
</code>
<div class="block">Recalculates the projection and view matrix of this camera and the
<a href="../../../../com/badlogic/gdx/math/Frustum.html" title="class in com.badlogic.gdx.math"><code>Frustum
</code></a> planes if
<code>updateFrustum
</code> is
true.
</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="position">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>position
</h4>
<pre>public final
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> position
</pre>
<div class="block">the position of the camera
</div>
</li>
</ul>
<a name="direction">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>direction
</h4>
<pre>public final
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> direction
</pre>
<div class="block">the unit length direction vector of the camera
</div>
</li>
</ul>
<a name="up">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>up
</h4>
<pre>public final
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> up
</pre>
<div class="block">the unit length up vector of the camera
</div>
</li>
</ul>
<a name="projection">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>projection
</h4>
<pre>public final
<a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> projection
</pre>
<div class="block">the projection matrix
</div>
</li>
</ul>
<a name="view">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>view
</h4>
<pre>public final
<a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> view
</pre>
<div class="block">the view matrix
</div>
</li>
</ul>
<a name="combined">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>combined
</h4>
<pre>public final
<a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> combined
</pre>
<div class="block">the combined projection and view matrix
</div>
</li>
</ul>
<a name="invProjectionView">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>invProjectionView
</h4>
<pre>public final
<a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> invProjectionView
</pre>
<div class="block">the inverse combined projection and view matrix
</div>
</li>
</ul>
<a name="near">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>near
</h4>
<pre>public
float near
</pre>
<div class="block">the near clipping plane distance, has to be positive
</div>
</li>
</ul>
<a name="far">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>far
</h4>
<pre>public
float far
</pre>
<div class="block">the far clipping plane distance, has to be positive
</div>
</li>
</ul>
<a name="viewportWidth">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>viewportWidth
</h4>
<pre>public
float viewportWidth
</pre>
<div class="block">the viewport width
</div>
</li>
</ul>
<a name="viewportHeight">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>viewportHeight
</h4>
<pre>public
float viewportHeight
</pre>
<div class="block">the viewport height
</div>
</li>
</ul>
<a name="frustum">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>frustum
</h4>
<pre>public final
<a href="../../../../com/badlogic/gdx/math/Frustum.html" title="class in com.badlogic.gdx.math">Frustum
</a> frustum
</pre>
<div class="block">the frustum
</div>
</li>
</ul>
</li>
</ul>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail
</h3>
<a name="Camera()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>Camera
</h4>
<pre>public
Camera()
</pre>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail
</h3>
<a name="update()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update
</h4>
<pre>public abstract
void
update()
</pre>
<div class="block">Recalculates the projection and view matrix of this camera and the
<a href="../../../../com/badlogic/gdx/math/Frustum.html" title="class in com.badlogic.gdx.math"><code>Frustum
</code></a> planes. Use this after you've manipulated
any of the attributes of the camera.
</div>
</li>
</ul>
<a name="update(boolean)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>update
</h4>
<pre>public abstract
void
update(boolean
updateFrustum)
</pre>
<div class="block">Recalculates the projection and view matrix of this camera and the
<a href="../../../../com/badlogic/gdx/math/Frustum.html" title="class in com.badlogic.gdx.math"><code>Frustum
</code></a> planes if
<code>updateFrustum
</code> is
true. Use this after you've manipulated any of the attributes of the camera.
</div>
</li>
</ul>
<a name="apply(com.badlogic.gdx.graphics.GL10)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>apply
</h4>
<pre>public
void
apply(
<a href="../../../../com/badlogic/gdx/graphics/GL10.html" title="interface in com.badlogic.gdx.graphics">GL10
</a> gl)
</pre>
<div class="block">Sets the current projection and model-view matrix of this camera. Only works with
<a href="../../../../com/badlogic/gdx/graphics/GL10.html" title="interface in com.badlogic.gdx.graphics"><code>GL10
</code></a> and
<a href="../../../../com/badlogic/gdx/graphics/GL11.html" title="interface in com.badlogic.gdx.graphics"><code>GL11
</code></a> of course.
The parameter is there to remind you that it does not work with GL20. Make sure to call
<a href="../../../../com/badlogic/gdx/graphics/Camera.html#update()"><code>update()
</code></a> before calling
this method so all matrices are up to date.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>gl
</code> - the GL10 or GL11 instance.
</dd></dl>
</li>
</ul>
<a name="lookAt(float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>lookAt
</h4>
<pre>public
void
lookAt(float
x,
float
y,
float
z)
</pre>
<div class="block">Recalculates the direction of the camera to look at the point (x, y, z).
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>x
</code> - the x-coordinate of the point to look at
</dd><dd><code>y
</code> - the x-coordinate of the point to look at
</dd><dd><code>z
</code> - the x-coordinate of the point to look at
</dd></dl>
</li>
</ul>
<a name="lookAt(com.badlogic.gdx.math.Vector3)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>lookAt
</h4>
<pre>public
void
lookAt(
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> target)
</pre>
<div class="block">Recalculates the direction of the camera to look at the point (x, y, z).
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>target
</code> - the point to look at
</dd></dl>
</li>
</ul>
<a name="normalizeUp()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>normalizeUp
</h4>
<pre>public
void
normalizeUp()
</pre>
<div class="block">Normalizes the up vector by first calculating the right vector via a cross product between direction and up, and then
recalculating the up vector via a cross product between right and direction.
</div>
</li>
</ul>
<a name="rotate(float, float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rotate
</h4>
<pre>public
void
rotate(float
angle,
float
axisX,
float
axisY,
float
axisZ)
</pre>
<div class="block">Rotates the direction and up vector of this camera by the given angle around the given axis. The direction and up vector
will not be orthogonalized.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>angle
</code> - the angle
</dd><dd><code>axisX
</code> - the x-component of the axis
</dd><dd><code>axisY
</code> - the y-component of the axis
</dd><dd><code>axisZ
</code> - the z-component of the axis
</dd></dl>
</li>
</ul>
<a name="rotate(com.badlogic.gdx.math.Vector3, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rotate
</h4>
<pre>public
void
rotate(
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> axis,
float
angle)
</pre>
<div class="block">Rotates the direction and up vector of this camera by the given angle around the given axis. The direction and up vector
will not be orthogonalized.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>axis
</code> -
</dd><dd><code>angle
</code> - the angle
</dd></dl>
</li>
</ul>
<a name="rotate(com.badlogic.gdx.math.Matrix4)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rotate
</h4>
<pre>public
void
rotate(
<a href="../../../../com/badlogic/gdx/math/Matrix4.html" title="class in com.badlogic.gdx.math">Matrix4
</a> transform)
</pre>
<div class="block">Rotates the direction and up vector of this camera by the given rotation matrix. The direction and up vector
will not be orthogonalized.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>transform
</code> - The rotation matrix
</dd></dl>
</li>
</ul>
<a name="rotate(com.badlogic.gdx.math.Quaternion)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rotate
</h4>
<pre>public
void
rotate(
<a href="../../../../com/badlogic/gdx/math/Quaternion.html" title="class in com.badlogic.gdx.math">Quaternion
</a> quat)
</pre>
<div class="block">Rotates the direction and up vector of this camera by the given
<a href="../../../../com/badlogic/gdx/math/Quaternion.html" title="class in com.badlogic.gdx.math"><code>Quaternion
</code></a>. The direction and up vector
will not be orthogonalized.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>quat
</code> - The quaternion
</dd></dl>
</li>
</ul>
<a name="rotateAround(com.badlogic.gdx.math.Vector3, com.badlogic.gdx.math.Vector3, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>rotateAround
</h4>
<pre>public
void
rotateAround(
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> point,
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> axis,
float
angle)
</pre>
<div class="block">Rotates the direction and up vector of this camera by the given angle around the given axis, with the axis attached to given
point. The direction and up vector will not be orthogonalized.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>point
</code> -
</dd><dd><code>axis
</code> -
</dd><dd><code>angle
</code> - the angle
</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> transform)
</pre>
<div class="block">Transform the position, direction and up vector by the given matrix
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>transform
</code> - The transform matrix
</dd></dl>
</li>
</ul>
<a name="translate(float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>translate
</h4>
<pre>public
void
translate(float
x,
float
y,
float
z)
</pre>
<div class="block">Moves the camera by the given amount on each axis.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>x
</code> - the displacement on the x-axis
</dd><dd><code>y
</code> - the displacement on the y-axis
</dd><dd><code>z
</code> - the displacement on the z-axis
</dd></dl>
</li>
</ul>
<a name="translate(com.badlogic.gdx.math.Vector3)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>translate
</h4>
<pre>public
void
translate(
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> vec)
</pre>
<div class="block">Moves the camera by the given vector.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>vec
</code> - the displacement vector
</dd></dl>
</li>
</ul>
<a name="unproject(com.badlogic.gdx.math.Vector3, float, float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unproject
</h4>
<pre>public
void
unproject(
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> vec,
float
viewportX,
float
viewportY,
float
viewportWidth,
float
viewportHeight)
</pre>
<div class="block">Function to translate a point given in window (or window) coordinates to world space. It's the same as GLU gluUnProject, but
does not rely on OpenGL. The x- and y-coordinate of vec are assumed to be in window coordinates (origin is the top left
corner, y pointing down, x pointing to the right) as reported by the touch methods in
<a href="../../../../com/badlogic/gdx/Input.html" title="interface in com.badlogic.gdx"><code>Input
</code></a>. A z-coordinate of 0
will return a point on the near plane, a z-coordinate of 1 will return a point on the far plane. This method allows you to
specify the viewport position and dimensions in the coordinate system expected by
<a href="../../../../com/badlogic/gdx/graphics/GLCommon.html#glViewport(int, int, int, int)"><code>GLCommon.glViewport(int, int, int, int)
</code></a>, with the origin in the bottom left corner of the screen.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>vec
</code> - the point in window coordinates (origin top left)
</dd><dd><code>viewportX
</code> - the coordinate of the top left corner of the viewport in glViewport coordinates (origin bottom left)
</dd><dd><code>viewportY
</code> - the coordinate of the top left corner of the viewport in glViewport coordinates (origin bottom left)
</dd><dd><code>viewportWidth
</code> - the width of the viewport in pixels
</dd><dd><code>viewportHeight
</code> - the height of the viewport in pixels
</dd></dl>
</li>
</ul>
<a name="unproject(com.badlogic.gdx.math.Vector3)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>unproject
</h4>
<pre>public
void
unproject(
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> vec)
</pre>
<div class="block">Function to translate a point given in window (or window) coordinates to world space. It's the same as GLU gluUnProject but
does not rely on OpenGL. The viewport is assumed to span the whole screen and is fetched from
<a href="../../../../com/badlogic/gdx/Graphics.html#getWidth()"><code>Graphics.getWidth()
</code></a>
and
<a href="../../../../com/badlogic/gdx/Graphics.html#getHeight()"><code>Graphics.getHeight()
</code></a>. The x- and y-coordinate of vec are assumed to be in window coordinates (origin is the top
left corner, y pointing down, x pointing to the right) as reported by the touch methods in
<a href="../../../../com/badlogic/gdx/Input.html" title="interface in com.badlogic.gdx"><code>Input
</code></a>. A z-coordinate of
0 will return a point on the near plane, a z-coordinate of 1 will return a point on the far plane.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>vec
</code> - the point in window coordinates
</dd></dl>
</li>
</ul>
<a name="project(com.badlogic.gdx.math.Vector3)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>project
</h4>
<pre>public
void
project(
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> vec)
</pre>
<div class="block">Projects the
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math"><code>Vector3
</code></a> given in object/world space to window coordinates. It's the same as GLU gluProject with one
small deviation: The viewport is assumed to span the whole screen. The window coordinate system has its origin in the
<b>bottom
</b> left, with the y-axis pointing
<b>upwards
</b> and the x-axis pointing to the right. This makes it easily
useable in conjunction with
<a href="../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html" title="class in com.badlogic.gdx.graphics.g2d"><code>SpriteBatch
</code></a> and similar classes.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>vec
</code> - the position in object/world space.
</dd></dl>
</li>
</ul>
<a name="project(com.badlogic.gdx.math.Vector3, float, float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>project
</h4>
<pre>public
void
project(
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math">Vector3
</a> vec,
float
viewportX,
float
viewportY,
float
viewportWidth,
float
viewportHeight)
</pre>
<div class="block">Projects the
<a href="../../../../com/badlogic/gdx/math/Vector3.html" title="class in com.badlogic.gdx.math"><code>Vector3
</code></a> given in object/world space to window coordinates. It's the same as GLU gluProject with one
small deviation: The viewport is assumed to span the whole screen. The window coordinate system has its origin in the
<b>bottom
</b> left, with the y-axis pointing
<b>upwards
</b> and the x-axis pointing to the right. This makes it easily
useable in conjunction with
<a href="../../../../com/badlogic/gdx/graphics/g2d/SpriteBatch.html" title="class in com.badlogic.gdx.graphics.g2d"><code>SpriteBatch
</code></a> and similar classes. This method allows you to specify the viewport position
and dimensions in the coordinate system expected by
<a href="../../../../com/badlogic/gdx/graphics/GLCommon.html#glViewport(int, int, int, int)"><code>GLCommon.glViewport(int, int, int, int)
</code></a>, with the origin in the
bottom left corner of the screen.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>vec
</code> - the point in object/world space
</dd><dd><code>viewportX
</code> - the coordinate of the top left corner of the viewport in glViewport coordinates (origin bottom left)
</dd><dd><code>viewportY
</code> - the coordinate of the top left corner of the viewport in glViewport coordinates (origin bottom left)
</dd><dd><code>viewportWidth
</code> - the width of the viewport in pixels
</dd><dd><code>viewportHeight
</code> - the height of the viewport in pixels
</dd></dl>
</li>
</ul>
<a name="getPickRay(float, float, float, float, float, float)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPickRay
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/math/collision/Ray.html" title="class in com.badlogic.gdx.math.collision">Ray
</a> getPickRay(float
x,
float
y,
float
viewportX,
float
viewportY,
float
viewportWidth,
float
viewportHeight)
</pre>
<div class="block">Creates a picking
<a href="../../../../com/badlogic/gdx/math/collision/Ray.html" title="class in com.badlogic.gdx.math.collision"><code>Ray
</code></a> from the coordinates given in window coordinates. It is assumed that the viewport spans the
whole screen. The window coordinates origin is assumed to be in the top left corner, its y-axis pointing down, the x-axis
pointing to the right. The returned instance is not a new instance but an internal member only accessible via this function.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>x
</code> - the x-coordinate in window coordinates.
</dd><dd><code>y
</code> - the y-coordinate in window coordinates.
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the picking Ray.
</dd></dl>
</li>
</ul>
<a name="getPickRay(float, float)">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getPickRay
</h4>
<pre>public
<a href="../../../../com/badlogic/gdx/math/collision/Ray.html" title="class in com.badlogic.gdx.math.collision">Ray
</a> getPickRay(float
x,
float
y)
</pre>
<div class="block">Creates a picking
<a href="../../../../com/badlogic/gdx/math/collision/Ray.html" title="class in com.badlogic.gdx.math.collision"><code>Ray
</code></a> from the coordinates given in window coordinates. It is assumed that the viewport spans the
whole screen. The window coordinates origin is assumed to be in the top left corner, its y-axis pointing down, the x-axis
pointing to the right. The returned instance is not a new instance but an internal member only accessible via this function.
</div>
<dl><dt><span class="strong">Parameters:
</span></dt><dd><code>x
</code> - the x-coordinate in window coordinates.
</dd><dd><code>y
</code> - the y-coordinate in window coordinates.
</dd>
<dt><span class="strong">Returns:
</span></dt><dd>the picking Ray.
</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/Camera.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>Prev Class
</li>
<li><a href="../../../../com/badlogic/gdx/graphics/Color.html" title="class 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/Camera.html" target="_top">Frames
</a></li>
<li><a href="Camera.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>Nested
|
</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>