2 Copyright (C) 2008 Mathias Gottschlag
4 Permission is hereby granted, free of charge, to any person obtaining a copy of
5 this software and associated documentation files (the "Software"), to deal in the
6 Software without restriction, including without limitation the rights to use,
7 copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the
8 Software, and to permit persons to whom the Software is furnished to do so,
9 subject to the following conditions:
11 The above copyright notice and this permission notice shall be included in all
12 copies or substantial portions of the Software.
14 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
15 INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
16 PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
17 HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
18 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
19 SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 * \brief 3-dimensional vector class
35 Vector3D(float x
, float y
, float z
);
39 * \brief Rotates the vector around the y-axis.
40 * \param radians Rotation angle
42 void rotateXZ(float radians
);
44 * \brief Rotates the vector around the x-axis.
45 * \param radians Rotation angle
47 void rotateYZ(float radians
);
49 * \brief Rotates the vector around the z-axis.
50 * \param radians Rotation angle
52 void rotateXY(float radians
);
55 * \brief Rotates the vector.
56 * \param rotation Rotation in euler angles
58 void rotate(Vector3D rotation
);
61 * \brief Returns the rotation of the vector.
63 * If you would rotate the vector 0/0/1 by this rotation, it would have
64 * the same direction as this vector.
66 Vector3D
getRotation(void);
69 * \brief Returns the squared length of the vector
71 float getLengthSq(void);
78 Vector3D
&operator*=(float scale
);
79 Vector3D
operator+(const Vector3D
&v
);
80 Vector3D
operator-(const Vector3D
&v
);
81 Vector3D
operator*(const float scale
);