vectozavr-shooter/SFML/doc/html/classsf_1_1Transform.html

1039 lines
63 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SFML - Simple and Fast Multimedia Library</title>
<meta http-equiv="Content-Type" content="text/html;"/>
<meta charset="utf-8"/>
<!--<link rel='stylesheet' type='text/css' href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
<link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
</head>
<body>
<div id="banner-container">
<div id="banner">
<span id="sfml">SFML 2.5.1</span>
</div>
</div>
<div id="content">
<!-- Generated by Doxygen 1.8.14 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="classes.html"><span>Class&#160;Index</span></a></li>
<li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><b>sf</b></li><li class="navelem"><a class="el" href="classsf_1_1Transform.html">Transform</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-attribs">Static Public Attributes</a> &#124;
<a href="#related">Related Functions</a> &#124;
<a href="classsf_1_1Transform-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">sf::Transform Class Reference<div class="ingroups"><a class="el" href="group__graphics.html">Graphics module</a></div></div> </div>
</div><!--header-->
<div class="contents">
<p>Define a 3x3 transform matrix.
<a href="classsf_1_1Transform.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="Transform_8hpp_source.html">Transform.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ac32de51bd0b9f3d52fbe0838225ee83b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#ac32de51bd0b9f3d52fbe0838225ee83b">Transform</a> ()</td></tr>
<tr class="memdesc:ac32de51bd0b9f3d52fbe0838225ee83b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor. <a href="#ac32de51bd0b9f3d52fbe0838225ee83b">More...</a><br /></td></tr>
<tr class="separator:ac32de51bd0b9f3d52fbe0838225ee83b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78c48677712fcf41122d02f1301d71a3"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#a78c48677712fcf41122d02f1301d71a3">Transform</a> (float a00, float a01, float a02, float a10, float a11, float a12, float a20, float a21, float a22)</td></tr>
<tr class="memdesc:a78c48677712fcf41122d02f1301d71a3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct a transform from a 3x3 matrix. <a href="#a78c48677712fcf41122d02f1301d71a3">More...</a><br /></td></tr>
<tr class="separator:a78c48677712fcf41122d02f1301d71a3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad52616cac686f47bd26bcbdd8e2add40"><td class="memItemLeft" align="right" valign="top">const float *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#ad52616cac686f47bd26bcbdd8e2add40">getMatrix</a> () const</td></tr>
<tr class="memdesc:ad52616cac686f47bd26bcbdd8e2add40"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the transform as a 4x4 matrix. <a href="#ad52616cac686f47bd26bcbdd8e2add40">More...</a><br /></td></tr>
<tr class="separator:ad52616cac686f47bd26bcbdd8e2add40"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a14f49e81af44aabcff7611f6703a1e4a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Transform.html">Transform</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#a14f49e81af44aabcff7611f6703a1e4a">getInverse</a> () const</td></tr>
<tr class="memdesc:a14f49e81af44aabcff7611f6703a1e4a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the inverse of the transform. <a href="#a14f49e81af44aabcff7611f6703a1e4a">More...</a><br /></td></tr>
<tr class="separator:a14f49e81af44aabcff7611f6703a1e4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af2e38c3c077d28898686662558b41135"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Vector2.html">Vector2f</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#af2e38c3c077d28898686662558b41135">transformPoint</a> (float x, float y) const</td></tr>
<tr class="memdesc:af2e38c3c077d28898686662558b41135"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classsf_1_1Transform.html" title="Define a 3x3 transform matrix. ">Transform</a> a 2D point. <a href="#af2e38c3c077d28898686662558b41135">More...</a><br /></td></tr>
<tr class="separator:af2e38c3c077d28898686662558b41135"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab42a0bb7a252c6d221004f6372ce5fdc"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Vector2.html">Vector2f</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#ab42a0bb7a252c6d221004f6372ce5fdc">transformPoint</a> (const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;point) const</td></tr>
<tr class="memdesc:ab42a0bb7a252c6d221004f6372ce5fdc"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classsf_1_1Transform.html" title="Define a 3x3 transform matrix. ">Transform</a> a 2D point. <a href="#ab42a0bb7a252c6d221004f6372ce5fdc">More...</a><br /></td></tr>
<tr class="separator:ab42a0bb7a252c6d221004f6372ce5fdc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3824a20505d81a94bc22be1ffee57d3d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Rect.html">FloatRect</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#a3824a20505d81a94bc22be1ffee57d3d">transformRect</a> (const <a class="el" href="classsf_1_1Rect.html">FloatRect</a> &amp;rectangle) const</td></tr>
<tr class="memdesc:a3824a20505d81a94bc22be1ffee57d3d"><td class="mdescLeft">&#160;</td><td class="mdescRight"><a class="el" href="classsf_1_1Transform.html" title="Define a 3x3 transform matrix. ">Transform</a> a rectangle. <a href="#a3824a20505d81a94bc22be1ffee57d3d">More...</a><br /></td></tr>
<tr class="separator:a3824a20505d81a94bc22be1ffee57d3d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acd978f60421a0f839bb9a8263e8877ff"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#acd978f60421a0f839bb9a8263e8877ff">combine</a> (const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;transform)</td></tr>
<tr class="memdesc:acd978f60421a0f839bb9a8263e8877ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">Combine the current transform with another one. <a href="#acd978f60421a0f839bb9a8263e8877ff">More...</a><br /></td></tr>
<tr class="separator:acd978f60421a0f839bb9a8263e8877ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab54f6c8070cc05e2afcb3145fbf4395a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#ab54f6c8070cc05e2afcb3145fbf4395a">translate</a> (float x, float y)</td></tr>
<tr class="memdesc:ab54f6c8070cc05e2afcb3145fbf4395a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Combine the current transform with a translation. <a href="#ab54f6c8070cc05e2afcb3145fbf4395a">More...</a><br /></td></tr>
<tr class="separator:ab54f6c8070cc05e2afcb3145fbf4395a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a452ff6e32d5120fa8c132c1bf0ad83cd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#a452ff6e32d5120fa8c132c1bf0ad83cd">translate</a> (const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;offset)</td></tr>
<tr class="memdesc:a452ff6e32d5120fa8c132c1bf0ad83cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">Combine the current transform with a translation. <a href="#a452ff6e32d5120fa8c132c1bf0ad83cd">More...</a><br /></td></tr>
<tr class="separator:a452ff6e32d5120fa8c132c1bf0ad83cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3e548c3c9e3fb9d4bd43cf852669e555"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#a3e548c3c9e3fb9d4bd43cf852669e555">rotate</a> (float angle)</td></tr>
<tr class="memdesc:a3e548c3c9e3fb9d4bd43cf852669e555"><td class="mdescLeft">&#160;</td><td class="mdescRight">Combine the current transform with a rotation. <a href="#a3e548c3c9e3fb9d4bd43cf852669e555">More...</a><br /></td></tr>
<tr class="separator:a3e548c3c9e3fb9d4bd43cf852669e555"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af0b7cc3fed36d0fa22d5d331a779eee2"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#af0b7cc3fed36d0fa22d5d331a779eee2">rotate</a> (float angle, float centerX, float centerY)</td></tr>
<tr class="memdesc:af0b7cc3fed36d0fa22d5d331a779eee2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Combine the current transform with a rotation. <a href="#af0b7cc3fed36d0fa22d5d331a779eee2">More...</a><br /></td></tr>
<tr class="separator:af0b7cc3fed36d0fa22d5d331a779eee2"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad2a2520ad81724079d109d4a986f9902"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#ad2a2520ad81724079d109d4a986f9902">rotate</a> (float angle, const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;center)</td></tr>
<tr class="memdesc:ad2a2520ad81724079d109d4a986f9902"><td class="mdescLeft">&#160;</td><td class="mdescRight">Combine the current transform with a rotation. <a href="#ad2a2520ad81724079d109d4a986f9902">More...</a><br /></td></tr>
<tr class="separator:ad2a2520ad81724079d109d4a986f9902"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3f46af807f69d74120fb836334268671"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#a3f46af807f69d74120fb836334268671">scale</a> (float scaleX, float scaleY)</td></tr>
<tr class="memdesc:a3f46af807f69d74120fb836334268671"><td class="mdescLeft">&#160;</td><td class="mdescRight">Combine the current transform with a scaling. <a href="#a3f46af807f69d74120fb836334268671">More...</a><br /></td></tr>
<tr class="separator:a3f46af807f69d74120fb836334268671"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6eaeedd35e289cb17f9bf7f24dc28daa"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#a6eaeedd35e289cb17f9bf7f24dc28daa">scale</a> (float scaleX, float scaleY, float centerX, float centerY)</td></tr>
<tr class="memdesc:a6eaeedd35e289cb17f9bf7f24dc28daa"><td class="mdescLeft">&#160;</td><td class="mdescRight">Combine the current transform with a scaling. <a href="#a6eaeedd35e289cb17f9bf7f24dc28daa">More...</a><br /></td></tr>
<tr class="separator:a6eaeedd35e289cb17f9bf7f24dc28daa"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3d57622a7ab309925c9d9887c99cc720"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#a3d57622a7ab309925c9d9887c99cc720">scale</a> (const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;factors)</td></tr>
<tr class="memdesc:a3d57622a7ab309925c9d9887c99cc720"><td class="mdescLeft">&#160;</td><td class="mdescRight">Combine the current transform with a scaling. <a href="#a3d57622a7ab309925c9d9887c99cc720">More...</a><br /></td></tr>
<tr class="separator:a3d57622a7ab309925c9d9887c99cc720"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9198da375173127901f3095e0165ee1b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#a9198da375173127901f3095e0165ee1b">scale</a> (const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;factors, const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;center)</td></tr>
<tr class="memdesc:a9198da375173127901f3095e0165ee1b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Combine the current transform with a scaling. <a href="#a9198da375173127901f3095e0165ee1b">More...</a><br /></td></tr>
<tr class="separator:a9198da375173127901f3095e0165ee1b"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr class="memitem:aa4eb1eecbcb9979d76e2543b337fdb13"><td class="memItemLeft" align="right" valign="top">static const <a class="el" href="classsf_1_1Transform.html">Transform</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#aa4eb1eecbcb9979d76e2543b337fdb13">Identity</a></td></tr>
<tr class="memdesc:aa4eb1eecbcb9979d76e2543b337fdb13"><td class="mdescLeft">&#160;</td><td class="mdescRight">The identity transform (does nothing) <a href="#aa4eb1eecbcb9979d76e2543b337fdb13">More...</a><br /></td></tr>
<tr class="separator:aa4eb1eecbcb9979d76e2543b337fdb13"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="related"></a>
Related Functions</h2></td></tr>
<tr><td class="ititle" colspan="2"><p>(Note that these are not member functions.) </p>
</td></tr>
<tr class="memitem:a85ea4e5539795f9b2ceb7d4b06736c8f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Transform.html">Transform</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#a85ea4e5539795f9b2ceb7d4b06736c8f">operator*</a> (const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;left, const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;right)</td></tr>
<tr class="memdesc:a85ea4e5539795f9b2ceb7d4b06736c8f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Overload of binary operator * to combine two transforms. <a href="#a85ea4e5539795f9b2ceb7d4b06736c8f">More...</a><br /></td></tr>
<tr class="separator:a85ea4e5539795f9b2ceb7d4b06736c8f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a189899674616490f6250953ac581ac30"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#a189899674616490f6250953ac581ac30">operator*=</a> (<a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;left, const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;right)</td></tr>
<tr class="memdesc:a189899674616490f6250953ac581ac30"><td class="mdescLeft">&#160;</td><td class="mdescRight">Overload of binary operator *= to combine two transforms. <a href="#a189899674616490f6250953ac581ac30">More...</a><br /></td></tr>
<tr class="separator:a189899674616490f6250953ac581ac30"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4eeee49125c3c72c250062eef35ceb75"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Vector2.html">Vector2f</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#a4eeee49125c3c72c250062eef35ceb75">operator*</a> (const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;left, const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;right)</td></tr>
<tr class="memdesc:a4eeee49125c3c72c250062eef35ceb75"><td class="mdescLeft">&#160;</td><td class="mdescRight">Overload of binary operator * to transform a point. <a href="#a4eeee49125c3c72c250062eef35ceb75">More...</a><br /></td></tr>
<tr class="separator:a4eeee49125c3c72c250062eef35ceb75"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa2de0a3ee2f8af05dbc94bf3b4633b4a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#aa2de0a3ee2f8af05dbc94bf3b4633b4a">operator==</a> (const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;left, const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;right)</td></tr>
<tr class="memdesc:aa2de0a3ee2f8af05dbc94bf3b4633b4a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Overload of binary operator == to compare two transforms. <a href="#aa2de0a3ee2f8af05dbc94bf3b4633b4a">More...</a><br /></td></tr>
<tr class="separator:aa2de0a3ee2f8af05dbc94bf3b4633b4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5eee840ff0b2db9e5f57a87281cc2b01"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Transform.html#a5eee840ff0b2db9e5f57a87281cc2b01">operator!=</a> (const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;left, const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;right)</td></tr>
<tr class="memdesc:a5eee840ff0b2db9e5f57a87281cc2b01"><td class="mdescLeft">&#160;</td><td class="mdescRight">Overload of binary operator != to compare two transforms. <a href="#a5eee840ff0b2db9e5f57a87281cc2b01">More...</a><br /></td></tr>
<tr class="separator:a5eee840ff0b2db9e5f57a87281cc2b01"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Define a 3x3 transform matrix. </p>
<p>A <a class="el" href="classsf_1_1Transform.html" title="Define a 3x3 transform matrix. ">sf::Transform</a> specifies how to translate, rotate, scale, shear, project, whatever things.</p>
<p>In mathematical terms, it defines how to transform a coordinate system into another.</p>
<p>For example, if you apply a rotation transform to a sprite, the result will be a rotated sprite. And anything that is transformed by this rotation transform will be rotated the same way, according to its initial position.</p>
<p>Transforms are typically used for drawing. But they can also be used for any computation that requires to transform points between the local and global coordinate systems of an entity (like collision detection).</p>
<p>Example: </p><div class="fragment"><div class="line"><span class="comment">// define a translation transform</span></div><div class="line"><a class="code" href="classsf_1_1Transform.html">sf::Transform</a> translation;</div><div class="line">translation.<a class="code" href="classsf_1_1Transform.html#ab54f6c8070cc05e2afcb3145fbf4395a">translate</a>(20, 50);</div><div class="line"></div><div class="line"><span class="comment">// define a rotation transform</span></div><div class="line"><a class="code" href="classsf_1_1Transform.html">sf::Transform</a> rotation;</div><div class="line">rotation.<a class="code" href="classsf_1_1Transform.html#a3e548c3c9e3fb9d4bd43cf852669e555">rotate</a>(45);</div><div class="line"></div><div class="line"><span class="comment">// combine them</span></div><div class="line"><a class="code" href="classsf_1_1Transform.html">sf::Transform</a> transform = translation * rotation;</div><div class="line"></div><div class="line"><span class="comment">// use the result to transform stuff...</span></div><div class="line"><a class="code" href="classsf_1_1Vector2.html">sf::Vector2f</a> point = transform.<a class="code" href="classsf_1_1Transform.html#af2e38c3c077d28898686662558b41135">transformPoint</a>(10, 20);</div><div class="line"><a class="code" href="classsf_1_1Rect.html">sf::FloatRect</a> rect = transform.<a class="code" href="classsf_1_1Transform.html#a3824a20505d81a94bc22be1ffee57d3d">transformRect</a>(<a class="code" href="classsf_1_1Rect.html">sf::FloatRect</a>(0, 0, 10, 100));</div></div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Transformable.html" title="Decomposed transform defined by a position, a rotation and a scale. ">sf::Transformable</a>, <a class="el" href="classsf_1_1RenderStates.html" title="Define the states used for drawing to a RenderTarget. ">sf::RenderStates</a> </dd></dl>
<p class="definition">Definition at line <a class="el" href="Transform_8hpp_source.html#l00042">42</a> of file <a class="el" href="Transform_8hpp_source.html">Transform.hpp</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="ac32de51bd0b9f3d52fbe0838225ee83b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac32de51bd0b9f3d52fbe0838225ee83b">&#9670;&nbsp;</a></span>Transform() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">sf::Transform::Transform </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Default constructor. </p>
<p>Creates an identity transform (a transform that does nothing). </p>
</div>
</div>
<a id="a78c48677712fcf41122d02f1301d71a3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a78c48677712fcf41122d02f1301d71a3">&#9670;&nbsp;</a></span>Transform() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">sf::Transform::Transform </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>a00</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>a01</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>a02</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>a10</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>a11</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>a12</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>a20</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>a21</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>a22</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Construct a transform from a 3x3 matrix. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">a00</td><td>Element (0, 0) of the matrix </td></tr>
<tr><td class="paramname">a01</td><td>Element (0, 1) of the matrix </td></tr>
<tr><td class="paramname">a02</td><td>Element (0, 2) of the matrix </td></tr>
<tr><td class="paramname">a10</td><td>Element (1, 0) of the matrix </td></tr>
<tr><td class="paramname">a11</td><td>Element (1, 1) of the matrix </td></tr>
<tr><td class="paramname">a12</td><td>Element (1, 2) of the matrix </td></tr>
<tr><td class="paramname">a20</td><td>Element (2, 0) of the matrix </td></tr>
<tr><td class="paramname">a21</td><td>Element (2, 1) of the matrix </td></tr>
<tr><td class="paramname">a22</td><td>Element (2, 2) of the matrix </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="acd978f60421a0f839bb9a8263e8877ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acd978f60421a0f839bb9a8263e8877ff">&#9670;&nbsp;</a></span>combine()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Transform.html">Transform</a>&amp; sf::Transform::combine </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td>
<td class="paramname"><em>transform</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Combine the current transform with another one. </p>
<p>The result is a transform that is equivalent to applying *this followed by <em>transform</em>. Mathematically, it is equivalent to a matrix multiplication.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">transform</td><td><a class="el" href="classsf_1_1Transform.html" title="Define a 3x3 transform matrix. ">Transform</a> to combine with this transform</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Reference to *this </dd></dl>
</div>
</div>
<a id="a14f49e81af44aabcff7611f6703a1e4a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a14f49e81af44aabcff7611f6703a1e4a">&#9670;&nbsp;</a></span>getInverse()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Transform.html">Transform</a> sf::Transform::getInverse </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Return the inverse of the transform. </p>
<p>If the inverse cannot be computed, an identity transform is returned.</p>
<dl class="section return"><dt>Returns</dt><dd>A new transform which is the inverse of self </dd></dl>
</div>
</div>
<a id="ad52616cac686f47bd26bcbdd8e2add40"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad52616cac686f47bd26bcbdd8e2add40">&#9670;&nbsp;</a></span>getMatrix()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">const float* sf::Transform::getMatrix </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Return the transform as a 4x4 matrix. </p>
<p>This function returns a pointer to an array of 16 floats containing the transform elements as a 4x4 matrix, which is directly compatible with OpenGL functions.</p>
<div class="fragment"><div class="line"><a class="code" href="classsf_1_1Transform.html">sf::Transform</a> transform = ...;</div><div class="line">glLoadMatrixf(transform.<a class="code" href="classsf_1_1Transform.html#ad52616cac686f47bd26bcbdd8e2add40">getMatrix</a>());</div></div><!-- fragment --><dl class="section return"><dt>Returns</dt><dd>Pointer to a 4x4 matrix </dd></dl>
</div>
</div>
<a id="a3e548c3c9e3fb9d4bd43cf852669e555"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3e548c3c9e3fb9d4bd43cf852669e555">&#9670;&nbsp;</a></span>rotate() <span class="overload">[1/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Transform.html">Transform</a>&amp; sf::Transform::rotate </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>angle</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Combine the current transform with a rotation. </p>
<p>This function returns a reference to *this, so that calls can be chained. </p><div class="fragment"><div class="line"><a class="code" href="classsf_1_1Transform.html">sf::Transform</a> transform;</div><div class="line">transform.<a class="code" href="classsf_1_1Transform.html#a3e548c3c9e3fb9d4bd43cf852669e555">rotate</a>(90).<a class="code" href="classsf_1_1Transform.html#ab54f6c8070cc05e2afcb3145fbf4395a">translate</a>(50, 20);</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">angle</td><td>Rotation angle, in degrees</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Reference to *this</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Transform.html#ab54f6c8070cc05e2afcb3145fbf4395a" title="Combine the current transform with a translation. ">translate</a>, <a class="el" href="classsf_1_1Transform.html#a3f46af807f69d74120fb836334268671" title="Combine the current transform with a scaling. ">scale</a> </dd></dl>
</div>
</div>
<a id="af0b7cc3fed36d0fa22d5d331a779eee2"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af0b7cc3fed36d0fa22d5d331a779eee2">&#9670;&nbsp;</a></span>rotate() <span class="overload">[2/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Transform.html">Transform</a>&amp; sf::Transform::rotate </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>angle</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>centerX</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>centerY</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Combine the current transform with a rotation. </p>
<p>The center of rotation is provided for convenience as a second argument, so that you can build rotations around arbitrary points more easily (and efficiently) than the usual translate(-center).rotate(angle).translate(center).</p>
<p>This function returns a reference to *this, so that calls can be chained. </p><div class="fragment"><div class="line"><a class="code" href="classsf_1_1Transform.html">sf::Transform</a> transform;</div><div class="line">transform.<a class="code" href="classsf_1_1Transform.html#a3e548c3c9e3fb9d4bd43cf852669e555">rotate</a>(90, 8, 3).<a class="code" href="classsf_1_1Transform.html#ab54f6c8070cc05e2afcb3145fbf4395a">translate</a>(50, 20);</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">angle</td><td>Rotation angle, in degrees </td></tr>
<tr><td class="paramname">centerX</td><td>X coordinate of the center of rotation </td></tr>
<tr><td class="paramname">centerY</td><td>Y coordinate of the center of rotation</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Reference to *this</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Transform.html#ab54f6c8070cc05e2afcb3145fbf4395a" title="Combine the current transform with a translation. ">translate</a>, <a class="el" href="classsf_1_1Transform.html#a3f46af807f69d74120fb836334268671" title="Combine the current transform with a scaling. ">scale</a> </dd></dl>
</div>
</div>
<a id="ad2a2520ad81724079d109d4a986f9902"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad2a2520ad81724079d109d4a986f9902">&#9670;&nbsp;</a></span>rotate() <span class="overload">[3/3]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Transform.html">Transform</a>&amp; sf::Transform::rotate </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>angle</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;&#160;</td>
<td class="paramname"><em>center</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Combine the current transform with a rotation. </p>
<p>The center of rotation is provided for convenience as a second argument, so that you can build rotations around arbitrary points more easily (and efficiently) than the usual translate(-center).rotate(angle).translate(center).</p>
<p>This function returns a reference to *this, so that calls can be chained. </p><div class="fragment"><div class="line"><a class="code" href="classsf_1_1Transform.html">sf::Transform</a> transform;</div><div class="line">transform.<a class="code" href="classsf_1_1Transform.html#a3e548c3c9e3fb9d4bd43cf852669e555">rotate</a>(90, <a class="code" href="classsf_1_1Vector2.html">sf::Vector2f</a>(8, 3)).<a class="code" href="classsf_1_1Transform.html#ab54f6c8070cc05e2afcb3145fbf4395a">translate</a>(<a class="code" href="classsf_1_1Vector2.html">sf::Vector2f</a>(50, 20));</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">angle</td><td>Rotation angle, in degrees </td></tr>
<tr><td class="paramname">center</td><td>Center of rotation</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Reference to *this</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Transform.html#ab54f6c8070cc05e2afcb3145fbf4395a" title="Combine the current transform with a translation. ">translate</a>, <a class="el" href="classsf_1_1Transform.html#a3f46af807f69d74120fb836334268671" title="Combine the current transform with a scaling. ">scale</a> </dd></dl>
</div>
</div>
<a id="a3f46af807f69d74120fb836334268671"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3f46af807f69d74120fb836334268671">&#9670;&nbsp;</a></span>scale() <span class="overload">[1/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Transform.html">Transform</a>&amp; sf::Transform::scale </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>scaleX</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>scaleY</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Combine the current transform with a scaling. </p>
<p>This function returns a reference to *this, so that calls can be chained. </p><div class="fragment"><div class="line"><a class="code" href="classsf_1_1Transform.html">sf::Transform</a> transform;</div><div class="line">transform.<a class="code" href="classsf_1_1Transform.html#a3f46af807f69d74120fb836334268671">scale</a>(2, 1).<a class="code" href="classsf_1_1Transform.html#a3e548c3c9e3fb9d4bd43cf852669e555">rotate</a>(45);</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">scaleX</td><td>Scaling factor on the X axis </td></tr>
<tr><td class="paramname">scaleY</td><td>Scaling factor on the Y axis</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Reference to *this</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Transform.html#ab54f6c8070cc05e2afcb3145fbf4395a" title="Combine the current transform with a translation. ">translate</a>, <a class="el" href="classsf_1_1Transform.html#a3e548c3c9e3fb9d4bd43cf852669e555" title="Combine the current transform with a rotation. ">rotate</a> </dd></dl>
</div>
</div>
<a id="a6eaeedd35e289cb17f9bf7f24dc28daa"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6eaeedd35e289cb17f9bf7f24dc28daa">&#9670;&nbsp;</a></span>scale() <span class="overload">[2/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Transform.html">Transform</a>&amp; sf::Transform::scale </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>scaleX</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>scaleY</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>centerX</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>centerY</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Combine the current transform with a scaling. </p>
<p>The center of scaling is provided for convenience as a second argument, so that you can build scaling around arbitrary points more easily (and efficiently) than the usual translate(-center).scale(factors).translate(center).</p>
<p>This function returns a reference to *this, so that calls can be chained. </p><div class="fragment"><div class="line"><a class="code" href="classsf_1_1Transform.html">sf::Transform</a> transform;</div><div class="line">transform.<a class="code" href="classsf_1_1Transform.html#a3f46af807f69d74120fb836334268671">scale</a>(2, 1, 8, 3).<a class="code" href="classsf_1_1Transform.html#a3e548c3c9e3fb9d4bd43cf852669e555">rotate</a>(45);</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">scaleX</td><td>Scaling factor on X axis </td></tr>
<tr><td class="paramname">scaleY</td><td>Scaling factor on Y axis </td></tr>
<tr><td class="paramname">centerX</td><td>X coordinate of the center of scaling </td></tr>
<tr><td class="paramname">centerY</td><td>Y coordinate of the center of scaling</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Reference to *this</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Transform.html#ab54f6c8070cc05e2afcb3145fbf4395a" title="Combine the current transform with a translation. ">translate</a>, <a class="el" href="classsf_1_1Transform.html#a3e548c3c9e3fb9d4bd43cf852669e555" title="Combine the current transform with a rotation. ">rotate</a> </dd></dl>
</div>
</div>
<a id="a3d57622a7ab309925c9d9887c99cc720"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3d57622a7ab309925c9d9887c99cc720">&#9670;&nbsp;</a></span>scale() <span class="overload">[3/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Transform.html">Transform</a>&amp; sf::Transform::scale </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;&#160;</td>
<td class="paramname"><em>factors</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Combine the current transform with a scaling. </p>
<p>This function returns a reference to *this, so that calls can be chained. </p><div class="fragment"><div class="line"><a class="code" href="classsf_1_1Transform.html">sf::Transform</a> transform;</div><div class="line">transform.<a class="code" href="classsf_1_1Transform.html#a3f46af807f69d74120fb836334268671">scale</a>(<a class="code" href="classsf_1_1Vector2.html">sf::Vector2f</a>(2, 1)).<a class="code" href="classsf_1_1Transform.html#a3e548c3c9e3fb9d4bd43cf852669e555">rotate</a>(45);</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">factors</td><td>Scaling factors</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Reference to *this</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Transform.html#ab54f6c8070cc05e2afcb3145fbf4395a" title="Combine the current transform with a translation. ">translate</a>, <a class="el" href="classsf_1_1Transform.html#a3e548c3c9e3fb9d4bd43cf852669e555" title="Combine the current transform with a rotation. ">rotate</a> </dd></dl>
</div>
</div>
<a id="a9198da375173127901f3095e0165ee1b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9198da375173127901f3095e0165ee1b">&#9670;&nbsp;</a></span>scale() <span class="overload">[4/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Transform.html">Transform</a>&amp; sf::Transform::scale </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;&#160;</td>
<td class="paramname"><em>factors</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;&#160;</td>
<td class="paramname"><em>center</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Combine the current transform with a scaling. </p>
<p>The center of scaling is provided for convenience as a second argument, so that you can build scaling around arbitrary points more easily (and efficiently) than the usual translate(-center).scale(factors).translate(center).</p>
<p>This function returns a reference to *this, so that calls can be chained. </p><div class="fragment"><div class="line"><a class="code" href="classsf_1_1Transform.html">sf::Transform</a> transform;</div><div class="line">transform.<a class="code" href="classsf_1_1Transform.html#a3f46af807f69d74120fb836334268671">scale</a>(<a class="code" href="classsf_1_1Vector2.html">sf::Vector2f</a>(2, 1), <a class="code" href="classsf_1_1Vector2.html">sf::Vector2f</a>(8, 3)).<a class="code" href="classsf_1_1Transform.html#a3e548c3c9e3fb9d4bd43cf852669e555">rotate</a>(45);</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">factors</td><td>Scaling factors </td></tr>
<tr><td class="paramname">center</td><td>Center of scaling</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Reference to *this</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Transform.html#ab54f6c8070cc05e2afcb3145fbf4395a" title="Combine the current transform with a translation. ">translate</a>, <a class="el" href="classsf_1_1Transform.html#a3e548c3c9e3fb9d4bd43cf852669e555" title="Combine the current transform with a rotation. ">rotate</a> </dd></dl>
</div>
</div>
<a id="af2e38c3c077d28898686662558b41135"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af2e38c3c077d28898686662558b41135">&#9670;&nbsp;</a></span>transformPoint() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Vector2.html">Vector2f</a> sf::Transform::transformPoint </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>y</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p><a class="el" href="classsf_1_1Transform.html" title="Define a 3x3 transform matrix. ">Transform</a> a 2D point. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">x</td><td>X coordinate of the point to transform </td></tr>
<tr><td class="paramname">y</td><td>Y coordinate of the point to transform</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Transformed point </dd></dl>
</div>
</div>
<a id="ab42a0bb7a252c6d221004f6372ce5fdc"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab42a0bb7a252c6d221004f6372ce5fdc">&#9670;&nbsp;</a></span>transformPoint() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Vector2.html">Vector2f</a> sf::Transform::transformPoint </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;&#160;</td>
<td class="paramname"><em>point</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p><a class="el" href="classsf_1_1Transform.html" title="Define a 3x3 transform matrix. ">Transform</a> a 2D point. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">point</td><td>Point to transform</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Transformed point </dd></dl>
</div>
</div>
<a id="a3824a20505d81a94bc22be1ffee57d3d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a3824a20505d81a94bc22be1ffee57d3d">&#9670;&nbsp;</a></span>transformRect()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Rect.html">FloatRect</a> sf::Transform::transformRect </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Rect.html">FloatRect</a> &amp;&#160;</td>
<td class="paramname"><em>rectangle</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p><a class="el" href="classsf_1_1Transform.html" title="Define a 3x3 transform matrix. ">Transform</a> a rectangle. </p>
<p>Since SFML doesn't provide support for oriented rectangles, the result of this function is always an axis-aligned rectangle. Which means that if the transform contains a rotation, the bounding rectangle of the transformed rectangle is returned.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">rectangle</td><td>Rectangle to transform</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Transformed rectangle </dd></dl>
</div>
</div>
<a id="ab54f6c8070cc05e2afcb3145fbf4395a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab54f6c8070cc05e2afcb3145fbf4395a">&#9670;&nbsp;</a></span>translate() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Transform.html">Transform</a>&amp; sf::Transform::translate </td>
<td>(</td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>x</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float&#160;</td>
<td class="paramname"><em>y</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Combine the current transform with a translation. </p>
<p>This function returns a reference to *this, so that calls can be chained. </p><div class="fragment"><div class="line"><a class="code" href="classsf_1_1Transform.html">sf::Transform</a> transform;</div><div class="line">transform.<a class="code" href="classsf_1_1Transform.html#ab54f6c8070cc05e2afcb3145fbf4395a">translate</a>(100, 200).<a class="code" href="classsf_1_1Transform.html#a3e548c3c9e3fb9d4bd43cf852669e555">rotate</a>(45);</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">x</td><td>Offset to apply on X axis </td></tr>
<tr><td class="paramname">y</td><td>Offset to apply on Y axis</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Reference to *this</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Transform.html#a3e548c3c9e3fb9d4bd43cf852669e555" title="Combine the current transform with a rotation. ">rotate</a>, <a class="el" href="classsf_1_1Transform.html#a3f46af807f69d74120fb836334268671" title="Combine the current transform with a scaling. ">scale</a> </dd></dl>
</div>
</div>
<a id="a452ff6e32d5120fa8c132c1bf0ad83cd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a452ff6e32d5120fa8c132c1bf0ad83cd">&#9670;&nbsp;</a></span>translate() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Transform.html">Transform</a>&amp; sf::Transform::translate </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;&#160;</td>
<td class="paramname"><em>offset</em></td><td>)</td>
<td></td>
</tr>
</table>
</div><div class="memdoc">
<p>Combine the current transform with a translation. </p>
<p>This function returns a reference to *this, so that calls can be chained. </p><div class="fragment"><div class="line"><a class="code" href="classsf_1_1Transform.html">sf::Transform</a> transform;</div><div class="line">transform.<a class="code" href="classsf_1_1Transform.html#ab54f6c8070cc05e2afcb3145fbf4395a">translate</a>(<a class="code" href="classsf_1_1Vector2.html">sf::Vector2f</a>(100, 200)).<a class="code" href="classsf_1_1Transform.html#a3e548c3c9e3fb9d4bd43cf852669e555">rotate</a>(45);</div></div><!-- fragment --><dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">offset</td><td>Translation offset to apply</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Reference to *this</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Transform.html#a3e548c3c9e3fb9d4bd43cf852669e555" title="Combine the current transform with a rotation. ">rotate</a>, <a class="el" href="classsf_1_1Transform.html#a3f46af807f69d74120fb836334268671" title="Combine the current transform with a scaling. ">scale</a> </dd></dl>
</div>
</div>
<h2 class="groupheader">Friends And Related Function Documentation</h2>
<a id="a5eee840ff0b2db9e5f57a87281cc2b01"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5eee840ff0b2db9e5f57a87281cc2b01">&#9670;&nbsp;</a></span>operator!=()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool operator!= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td>
<td class="paramname"><em>left</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td>
<td class="paramname"><em>right</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Overload of binary operator != to compare two transforms. </p>
<p>This call is equivalent to !(left == right).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">left</td><td>Left operand (the first transform) </td></tr>
<tr><td class="paramname">right</td><td>Right operand (the second transform)</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if the transforms are not equal, false otherwise </dd></dl>
</div>
</div>
<a id="a85ea4e5539795f9b2ceb7d4b06736c8f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a85ea4e5539795f9b2ceb7d4b06736c8f">&#9670;&nbsp;</a></span>operator*() <span class="overload">[1/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Transform.html">Transform</a> operator* </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td>
<td class="paramname"><em>left</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td>
<td class="paramname"><em>right</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Overload of binary operator * to combine two transforms. </p>
<p>This call is equivalent to calling Transform(left).combine(right).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">left</td><td>Left operand (the first transform) </td></tr>
<tr><td class="paramname">right</td><td>Right operand (the second transform)</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>New combined transform </dd></dl>
</div>
</div>
<a id="a4eeee49125c3c72c250062eef35ceb75"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4eeee49125c3c72c250062eef35ceb75">&#9670;&nbsp;</a></span>operator*() <span class="overload">[2/2]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Vector2.html">Vector2f</a> operator* </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td>
<td class="paramname"><em>left</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classsf_1_1Vector2.html">Vector2f</a> &amp;&#160;</td>
<td class="paramname"><em>right</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Overload of binary operator * to transform a point. </p>
<p>This call is equivalent to calling left.transformPoint(right).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">left</td><td>Left operand (the transform) </td></tr>
<tr><td class="paramname">right</td><td>Right operand (the point to transform)</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>New transformed point </dd></dl>
</div>
</div>
<a id="a189899674616490f6250953ac581ac30"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a189899674616490f6250953ac581ac30">&#9670;&nbsp;</a></span>operator*=()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classsf_1_1Transform.html">Transform</a> &amp; operator*= </td>
<td>(</td>
<td class="paramtype"><a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td>
<td class="paramname"><em>left</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td>
<td class="paramname"><em>right</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Overload of binary operator *= to combine two transforms. </p>
<p>This call is equivalent to calling left.combine(right).</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">left</td><td>Left operand (the first transform) </td></tr>
<tr><td class="paramname">right</td><td>Right operand (the second transform)</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The combined transform </dd></dl>
</div>
</div>
<a id="aa2de0a3ee2f8af05dbc94bf3b4633b4a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa2de0a3ee2f8af05dbc94bf3b4633b4a">&#9670;&nbsp;</a></span>operator==()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool operator== </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td>
<td class="paramname"><em>left</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classsf_1_1Transform.html">Transform</a> &amp;&#160;</td>
<td class="paramname"><em>right</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">related</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Overload of binary operator == to compare two transforms. </p>
<p>Performs an element-wise comparison of the elements of the left transform with the elements of the right transform.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">left</td><td>Left operand (the first transform) </td></tr>
<tr><td class="paramname">right</td><td>Right operand (the second transform)</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if the transforms are equal, false otherwise </dd></dl>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a id="aa4eb1eecbcb9979d76e2543b337fdb13"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa4eb1eecbcb9979d76e2543b337fdb13">&#9670;&nbsp;</a></span>Identity</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const <a class="el" href="classsf_1_1Transform.html">Transform</a> sf::Transform::Identity</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The identity transform (does nothing) </p>
<p class="definition">Definition at line <a class="el" href="Transform_8hpp_source.html#l00354">354</a> of file <a class="el" href="Transform_8hpp_source.html">Transform.hpp</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="Transform_8hpp_source.html">Transform.hpp</a></li>
</ul>
</div><!-- contents -->
</div>
<div id="footer-container">
<div id="footer">
SFML is licensed under the terms and conditions of the <a href="https://www.sfml-dev.org/license.php">zlib/png license</a>.<br>
Copyright &copy; Laurent Gomila &nbsp;::&nbsp;
Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> &nbsp;::&nbsp;
</div>
</div>
</body>
</html>