Loading...
Searching...
No Matches
Vector2.hpp
Go to the documentation of this file.
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2009 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_VECTOR2_HPP
26#define SFML_VECTOR2_HPP
27
28
29namespace sf
30{
36template <typename T>
38{
39public :
40
46
54 Vector2(T X, T Y);
55
57 // Member data
59 T x;
60 T y;
61};
62
71template <typename T>
73
83template <typename T>
85
95template <typename T>
97
107template <typename T>
109
119template <typename T>
121
131template <typename T>
133
143template <typename T>
145
155template <typename T>
157
167template <typename T>
169
179template <typename T>
181
191template <typename T>
192bool operator ==(const Vector2<T>& V1, const Vector2<T>& V2);
193
203template <typename T>
204bool operator !=(const Vector2<T>& V1, const Vector2<T>& V2);
205
206#include <SFML/System/Vector2.inl>
207
208// Define the most common types
211
212} // namespace sf
213
214
215#endif // SFML_VECTOR2_HPP
Vector2 is an utility class for manipulating 2 dimensional vectors.
Definition Vector2.hpp:38
Vector2()
Default constructor.
Vector2(T X, T Y)
Construct the vector from its coordinates.
bool operator==(const Vector2< T > &V1, const Vector2< T > &V2)
Operator == overload ; compares the equality of two vectors.
Color operator*(const Color &Color1, const Color &Color2)
Operator * overload to modulate two colors.
Vector2< T > & operator/=(Vector2< T > &V, T X)
Operator /= overload ; divide-assign a vector by a scalar value.
Color operator+(const Color &Color1, const Color &Color2)
Operator + overload to add two colors.
Vector2< T > operator-(const Vector2< T > &V)
Operator - overload ; returns the opposite of a vector.
Vector2< T > & operator*=(Vector2< T > &V, T X)
Operator *= overload ; multiply-assign a vector by a scalar value.
Vector2< T > operator/(const Vector2< T > &V, T X)
Operator / overload ; divide a vector by a scalar value.
Vector2< int > Vector2i
Definition Vector2.hpp:209
Vector2< T > & operator+=(Vector2< T > &V1, const Vector2< T > &V2)
Operator += overload ; add two vectors and assign to the first op.
Vector2< float > Vector2f
Definition Vector2.hpp:210
bool operator!=(const Vector2< T > &V1, const Vector2< T > &V2)
Operator != overload ; compares the difference of two vectors.
Vector2< T > & operator-=(Vector2< T > &V1, const Vector2< T > &V2)
Operator -= overload ; subtract two vectors and assign to the first op.