Documentation of SFML 2.6.1

Warning: this page refers to an old version of SFML. Click here to switch to the latest version.
Loading...
Searching...
No Matches
Vector3.hpp
1
2//
3// SFML - Simple and Fast Multimedia Library
4// Copyright (C) 2007-2023 Laurent Gomila (laurent@sfml-dev.org)
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_VECTOR3_HPP
26#define SFML_VECTOR3_HPP
27
28
29namespace sf
30{
36template <typename T>
38{
39public:
40
48
57 Vector3(T X, T Y, T Z);
58
70 template <typename U>
71 explicit Vector3(const Vector3<U>& vector);
72
74 // Member data
76 T x;
77 T y;
78 T z;
79};
80
90template <typename T>
91Vector3<T> operator -(const Vector3<T>& left);
92
106template <typename T>
107Vector3<T>& operator +=(Vector3<T>& left, const Vector3<T>& right);
108
122template <typename T>
123Vector3<T>& operator -=(Vector3<T>& left, const Vector3<T>& right);
124
135template <typename T>
136Vector3<T> operator +(const Vector3<T>& left, const Vector3<T>& right);
137
148template <typename T>
149Vector3<T> operator -(const Vector3<T>& left, const Vector3<T>& right);
150
161template <typename T>
162Vector3<T> operator *(const Vector3<T>& left, T right);
163
174template <typename T>
175Vector3<T> operator *(T left, const Vector3<T>& right);
176
190template <typename T>
191Vector3<T>& operator *=(Vector3<T>& left, T right);
192
203template <typename T>
204Vector3<T> operator /(const Vector3<T>& left, T right);
205
219template <typename T>
220Vector3<T>& operator /=(Vector3<T>& left, T right);
221
234template <typename T>
235bool operator ==(const Vector3<T>& left, const Vector3<T>& right);
236
249template <typename T>
250bool operator !=(const Vector3<T>& left, const Vector3<T>& right);
251
252#include <SFML/System/Vector3.inl>
253
254// Define the most common types
255typedef Vector3<int> Vector3i;
257
258} // namespace sf
259
260
261#endif // SFML_VECTOR3_HPP
262
263
Utility template class for manipulating 3-dimensional vectors.
Definition Vector3.hpp:38
T z
Z coordinate of the vector.
Definition Vector3.hpp:78
T x
X coordinate of the vector.
Definition Vector3.hpp:76
T y
Y coordinate of the vector.
Definition Vector3.hpp:77
Vector3(T X, T Y, T Z)
Construct the vector from its coordinates.
Vector3(const Vector3< U > &vector)
Construct the vector from another type of vector.
Vector3()
Default constructor.