Documentation of SFML 1.6

Warning: this page refers to an old version of SFML. Click here to switch to the latest version.
Vector3.hpp
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_VECTOR3_HPP
26 #define SFML_VECTOR3_HPP
27 
28 
29 namespace sf
30 {
36 template <typename T>
37 class Vector3
38 {
39 public :
40 
45  Vector3();
46 
55  Vector3(T X, T Y, T Z);
56 
58  // Member data
60  T x;
61  T y;
62  T z;
63 };
64 
73 template <typename T>
74 Vector3<T> operator -(const Vector3<T>& V);
75 
85 template <typename T>
86 Vector3<T>& operator +=(Vector3<T>& V1, const Vector3<T>& V2);
87 
97 template <typename T>
98 Vector3<T>& operator -=(Vector3<T>& V1, const Vector3<T>& V2);
99 
109 template <typename T>
110 Vector3<T> operator +(const Vector3<T>& V1, const Vector3<T>& V2);
111 
121 template <typename T>
122 Vector3<T> operator -(const Vector3<T>& V1, const Vector3<T>& V2);
123 
133 template <typename T>
134 Vector3<T> operator *(const Vector3<T>& V, T X);
135 
145 template <typename T>
146 Vector3<T> operator *(T X, const Vector3<T>& V);
147 
157 template <typename T>
158 Vector3<T>& operator *=(Vector3<T>& V, T X);
159 
169 template <typename T>
170 Vector3<T> operator /(const Vector3<T>& V, T X);
171 
181 template <typename T>
182 Vector3<T>& operator /=(Vector3<T>& V, T X);
183 
193 template <typename T>
194 bool operator ==(const Vector3<T>& V1, const Vector3<T>& V2);
195 
205 template <typename T>
206 bool operator !=(const Vector3<T>& V1, const Vector3<T>& V2);
207 
208 #include <SFML/System/Vector3.inl>
209 
210 // Define the most common types
211 typedef Vector3<int> Vector3i;
212 typedef Vector3<float> Vector3f;
213 
214 } // namespace sf
215 
216 
217 #endif // SFML_VECTOR3_HPP