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

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

#include <VecMath.hpp>

+ Collaboration diagram for Vector4< T >:

Public Member Functions

 Vector4 ()
 The vector is not initialized! More...
 
 Vector4 (const T *)
 Explicit conversion constructor from an array. More...
 
 Vector4 (const Vector3< T > &)
 Creates an Vector4 with xyz set to the given Vector3, and w set to 1.0. More...
 
 Vector4 (T, T, T)
 Creates an Vector4 with xyz set to the given values, and w set to 1.0. More...
 
 Vector4 (T, T, T, T)
 
Vector4operator= (const Vector3< T > &)
 
Vector4operator= (const T *)
 
void set (T, T, T, T)
 
bool operator== (const Vector4< T > &) const
 
bool operator!= (const Vector4< T > &) const
 
T & operator[] (int)
 
const T & operator[] (int) const
 
 operator T * ()
 
 operator const T * () const
 
void operator+= (const Vector4< T > &)
 
void operator-= (const Vector4< T > &)
 
void operator*= (T)
 
void operator/= (T)
 
Vector4 operator- (const Vector4< T > &) const
 
Vector4 operator+ (const Vector4< T > &) const
 
Vector4 operator- () const
 
Vector4 operator+ () const
 
Vector4 operator* (T) const
 
Vector4 operator/ (T) const
 
dot (const Vector4< T > &) const
 
length () const
 
lengthSquared () const
 
void normalize ()
 
void transfo4d (const Mat4d &)
 
QString toString () const
 

Public Attributes

v [4]
 

Detailed Description

template<class T>
class Vector4< T >

A templatized 4d vector compatible with openGL.

Use Vec4d or Vec4f typdef for vectors of double and float respectively.

Definition at line 34 of file VecMath.hpp.

Constructor & Destructor Documentation

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

The vector is not initialized!

Definition at line 854 of file VecMath.hpp.

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

Explicit conversion constructor from an array.

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

Definition at line 856 of file VecMath.hpp.

template<class T>
Vector4< T >::Vector4 ( const Vector3< T > &  a)
inline

Creates an Vector4 with xyz set to the given Vector3, and w set to 1.0.

Definition at line 861 of file VecMath.hpp.

template<class T>
Vector4< T >::Vector4 ( x,
y,
z 
)
inline

Creates an Vector4 with xyz set to the given values, and w set to 1.0.

Definition at line 866 of file VecMath.hpp.


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