Simple and Fast Multimedia Library
Documentation for SFML 2.0
Initializing search
SFML
Home
Learn
Tutorials
Documentation
Download
Community
Development
Donate
Simple and Fast Multimedia Library
Home
Learn
Tutorials
Documentation
Documentation
SFML 3.1.0
SFML 3.0.2
SFML 3.0.1
SFML 3.0.0
SFML 2.6.2
SFML 2.6.1
SFML 2.6.0
SFML 2.5.1
SFML 2.5.0
SFML 2.4.2
SFML 2.4.1
SFML 2.4.0
SFML 2.3.2
SFML 2.3.1
SFML 2.3
SFML 2.2
SFML 2.1
SFML 2.0
SFML 1.6
Download
Community
Development
Warning
This page refers to an old version of SFML.
Click here to switch to the latest version.
Main Page
Topics
Namespaces
Classes
Files
File List
File Members
Loading...
Searching...
No Matches
SFML
include
SFML
Graphics
Transform.hpp
Go to the documentation of this file.
1
2
//
3
// SFML - Simple and Fast Multimedia Library
4
// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
5
//
6
// This software is provided 'as-is', without any express or implied warranty.
7
// In no event will the authors be held liable for any damages arising from the use of this software.
8
//
9
// Permission is granted to anyone to use this software for any purpose,
10
// including commercial applications, and to alter it and redistribute it freely,
11
// subject to the following restrictions:
12
//
13
// 1. The origin of this software must not be misrepresented;
14
// you must not claim that you wrote the original software.
15
// If you use this software in a product, an acknowledgment
16
// in the product documentation would be appreciated but is not required.
17
//
18
// 2. Altered source versions must be plainly marked as such,
19
// and must not be misrepresented as being the original software.
20
//
21
// 3. This notice may not be removed or altered from any source distribution.
22
//
24
25
#ifndef SFML_TRANSFORM_HPP
26
#define SFML_TRANSFORM_HPP
27
29
// Headers
31
#include <
SFML/Graphics/Export.hpp
>
32
#include <
SFML/Graphics/Rect.hpp
>
33
#include <
SFML/System/Vector2.hpp
>
34
35
36
namespace
sf
37
{
42
class
SFML_GRAPHICS_API
Transform
43
{
44
public :
45
52
Transform
();
53
68
Transform
(
float
a00,
float
a01,
float
a02,
69
float
a10,
float
a11,
float
a12,
70
float
a20,
float
a21,
float
a22);
71
87
const
float
*
getMatrix
()
const
;
88
98
Transform
getInverse
()
const
;
99
109
Vector2f
transformPoint
(
float
x,
float
y)
const
;
110
119
Vector2f
transformPoint
(
const
Vector2f
& point)
const
;
120
135
FloatRect
transformRect
(
const
FloatRect
& rectangle)
const
;
136
149
Transform
&
combine
(
const
Transform
& transform);
150
169
Transform
&
translate
(
float
x,
float
y);
170
188
Transform
&
translate
(
const
Vector2f
& offset);
189
207
Transform
&
rotate
(
float
angle);
208
233
Transform
&
rotate
(
float
angle,
float
centerX,
float
centerY);
234
258
Transform
&
rotate
(
float
angle,
const
Vector2f
& center);
259
278
Transform
&
scale
(
float
scaleX,
float
scaleY);
279
305
Transform
&
scale
(
float
scaleX,
float
scaleY,
float
centerX,
float
centerY);
306
324
Transform
&
scale
(
const
Vector2f
& factors);
325
349
Transform
&
scale
(
const
Vector2f
& factors,
const
Vector2f
& center);
350
352
// Static member data
354
static
const
Transform
Identity
;
355
356
private
:
357
359
// Member data
361
float
m_matrix[16];
362
};
363
376
SFML_GRAPHICS_API
Transform
operator *
(
const
Transform
& left,
const
Transform
& right);
377
390
SFML_GRAPHICS_API
Transform
&
operator *=
(
Transform
& left,
const
Transform
& right);
391
404
SFML_GRAPHICS_API
Vector2f
operator *
(
const
Transform
& left,
const
Vector2f
& right);
405
406
}
// namespace sf
407
408
409
#endif
// SFML_TRANSFORM_HPP
410
411
Export.hpp
SFML_GRAPHICS_API
#define SFML_GRAPHICS_API
Definition
Graphics/Export.hpp:43
Rect.hpp
Vector2.hpp
sf::Color::operator*
Color operator*(const Color &left, const Color &right)
Overload of the binary * operator.
sf::Color::operator*=
Color & operator*=(Color &left, const Color &right)
Overload of the binary *= operator.
sf::Transform::translate
Transform & translate(float x, float y)
Combine the current transform with a translation.
sf::Transform::rotate
Transform & rotate(float angle, const Vector2f ¢er)
Combine the current transform with a rotation.
sf::Transform::getInverse
Transform getInverse() const
Return the inverse of the transform.
sf::Transform::scale
Transform & scale(const Vector2f &factors)
Combine the current transform with a scaling.
sf::Transform::translate
Transform & translate(const Vector2f &offset)
Combine the current transform with a translation.
sf::Transform::transformRect
FloatRect transformRect(const FloatRect &rectangle) const
Transform a rectangle.
sf::Transform::scale
Transform & scale(const Vector2f &factors, const Vector2f ¢er)
Combine the current transform with a scaling.
sf::Transform::Transform
Transform(float a00, float a01, float a02, float a10, float a11, float a12, float a20, float a21, float a22)
Construct a transform from a 3x3 matrix.
sf::Transform::scale
Transform & scale(float scaleX, float scaleY)
Combine the current transform with a scaling.
sf::Transform::Identity
static const Transform Identity
The identity transform (does nothing).
Definition
Transform.hpp:354
sf::Transform::transformPoint
Vector2f transformPoint(const Vector2f &point) const
Transform a 2D point.
sf::Transform::getMatrix
const float * getMatrix() const
Return the transform as a 4x4 matrix.
sf::Transform::Transform
Transform()
Default constructor.
sf::Transform::rotate
Transform & rotate(float angle)
Combine the current transform with a rotation.
sf::Transform::rotate
Transform & rotate(float angle, float centerX, float centerY)
Combine the current transform with a rotation.
sf::Transform::combine
Transform & combine(const Transform &transform)
Combine the current transform with another one.
sf::Transform::scale
Transform & scale(float scaleX, float scaleY, float centerX, float centerY)
Combine the current transform with a scaling.
sf::Transform::transformPoint
Vector2f transformPoint(float x, float y) const
Transform a 2D point.
sf
Definition
Listener.hpp:36
sf::Vector2f
Vector2< float > Vector2f
Definition
Vector2.hpp:255
sf::FloatRect
Rect< float > FloatRect
Definition
Rect.hpp:191
Back to top