Stellarium  0.16.1
List of all members | Public Member Functions | Public Attributes
Vector3< T > Class Template Reference

A templatized 3d vector compatible with openGL. More...

#include <VecMath.hpp>

+ Collaboration diagram for Vector3< T >:

Public Member Functions

 Vector3 ()
 The vector is not initialized! More...
 
 Vector3 (T)
 Sets all components of the vector to the same value. More...
 
 Vector3 (const T *)
 Explicit conversion constructor from an array (copies values) More...
 
 Vector3 (T, T, T)
 
Vector3operator= (const T *)
 Assignment from array. More...
 
void set (T, T, T)
 
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 More...
 
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
 
dot (const Vector3< T > &) const
 
Vector3 operator^ (const Vector3< T > &) const
 
latitude () const
 
longitude () const
 
angle (const Vector3< T > &) const
 
angleNormalized (const Vector3< T > &) const
 
length () const
 
lengthSquared () const
 
void normalize ()
 
void transfo4d (const Mat4d &)
 
void transfo4d (const Mat4f &)
 
Vec3f toVec3f () const
 
Vec3d toVec3d () const
 
QString toString () const
 
QString toStringLonLat () const
 

Public Attributes

v [3]
 

Detailed Description

template<class T>
class Vector3< T >

A templatized 3d vector compatible with openGL.

Use Vec3d or Vec3f typdef for vectors of double and float respectively.

Definition at line 33 of file VecMath.hpp.

Constructor & Destructor Documentation

template<class T >
Vector3< T >::Vector3 ( )
inline

The vector is not initialized!

Definition at line 628 of file VecMath.hpp.

template<class T>
Vector3< T >::Vector3 ( x)
inline

Sets all components of the vector to the same value.

Definition at line 640 of file VecMath.hpp.

template<class T>
Vector3< T >::Vector3 ( const T *  x)
inlineexplicit

Explicit conversion constructor from an array (copies values)

Warning
Does not check array size, make sure it has at least 3 elements

Definition at line 645 of file VecMath.hpp.

Member Function Documentation

template<class T>
bool Vector3< T >::fuzzyEquals ( const Vector3< T > &  a,
epsilon = std::numeric_limits<T>::epsilon() 
) const
inline

allows for a fuzzy comparison using some epsilon value

Definition at line 689 of file VecMath.hpp.

template<class T>
Vector3< T > & Vector3< T >::operator= ( const T *  a)
inline

Assignment from array.

Warning
Does not check array size, make sure it has at least 2 elements

Definition at line 667 of file VecMath.hpp.


The documentation for this class was generated from the following file: