Stellarium
23.4
|
A templatized 3d vector compatible with OpenGL. More...
#include <VecMath.hpp>
Public Member Functions | |
Vector3 (T x=0) | |
The vector is not initialized! More... | |
Vector3 (const T *) | |
Explicit conversion constructor from an array (copies values) More... | |
Vector3 (T, T, T) | |
Vector3 (QString s) | |
Constructor from a comma-separated QString like "2,4,6" or "2.1,4.2,6.3". | |
Vector3 (QStringList s) | |
Constructor from a QStringList like { "2", "4", "6" } or { "2.1", "4.2", "6.3" }. | |
Vector3 (QColor c) | |
Constructor from a QColor. | |
void | set (T, T, T) |
Vector3 | setFromHtmlColor (QString s) |
Assign from HTML color The Vec3i type will have values 0...255 Vec3f and Vec3d will have [0...[1. | |
bool | operator== (const Vector3< T > &) const |
bool | operator!= (const Vector3< T > &) const |
bool | fuzzyEquals (const Vector3< T > &, T epsilon=std::numeric_limits< T >::epsilon()) const |
allows for a fuzzy comparison using some epsilon value | |
T & | operator[] (int) |
const T & | operator[] (int) const |
operator const T * () const | |
operator T* () | |
const T * | data () const |
T * | data () |
void | operator+= (const Vector3< T > &) |
void | operator-= (const Vector3< T > &) |
void | operator*= (T) |
void | operator/= (T) |
Vector3 | operator- (const Vector3< T > &) const |
Vector3 | operator+ (const Vector3< T > &) const |
Vector3 | operator- () const |
Vector3 | operator+ () const |
Vector3 | operator* (T) const |
Vector3 | operator/ (T) const |
T | dot (const Vector3< T > &) const |
Vector3 | operator^ (const Vector3< T > &) const |
T | latitude () const |
T | longitude () const |
T | angle (const Vector3< T > &) const |
T | angleNormalized (const Vector3< T > &) const |
T | length () const =delete |
T | lengthSquared () const =delete |
T | norm () const |
Norm of the vector, also known as length. | |
T | normSquared () const |
Square of the norm of the vector, same as dot product with itself. | |
void | normalize () |
void | transfo4d (const Mat4d &) |
void | transfo4d (const Mat4f &) |
Vec3f | toVec3f () const |
Vec3d | toVec3d () const |
QString | toString () const |
Formatted string with brackets. | |
QString | toStr () const |
Compact comma-separated string without brackets and spaces. More... | |
QString | toStringLonLat () const |
QString | toHtmlColor () const |
Convert a Vec3i/Vec3f/Vec3d to HTML color notation. In case of Vec3i, components are 0...255, else 0...1. | |
QColor | toQColor () const |
Convert to a QColor. | |
QVector3D | toQVector () const |
Convert to a QVector3D. | |
Static Public Member Functions | |
static Vector3< T > | fromBracketedString (QString s) |
converters to be registered in StelCore (may not work!) | |
static Vector3< T > | fromQVector3D (QVector3D v) |
convert from a QVector3D | |
Data Fields | |
T | v [3] |
A templatized 3d vector compatible with OpenGL.
Use Vec3i for integer and Vec3d or Vec3f typedef for vectors of double and float respectively.
The vector is not initialized!
Sets all components of the vector to the same value
Explicit conversion constructor from an array (copies values)
QString Vector3< T >::toStr | ( | ) | const |
Compact comma-separated string without brackets and spaces.
The result can be restored into a Vector2 by the Vector3(QString s) constructors.