SGVec2< T > Class Template Reference

2D Vector Class More...

#include <SGVec2.hxx>

List of all members.

Public Member Functions

 SGVec2 (void)
 Default constructor.
 SGVec2 (T x, T y)
 Constructor. Initialize by the given values.
 SGVec2 (const T *d)
 Constructor.
const T & operator() (unsigned i) const
 Access by index, the index is unchecked.
T & operator() (unsigned i)
 Access by index, the index is unchecked.
const T & operator[] (unsigned i) const
 Access raw data by index, the index is unchecked.
T & operator[] (unsigned i)
 Access raw data by index, the index is unchecked.
const T & x (void) const
 Access the x component.
T & x (void)
 Access the x component.
const T & y (void) const
 Access the y component.
T & y (void)
 Access the y component.
const T(& data (void) const)[2]
 Access raw data.
T(& data (void))[2]
 Access raw data.
SGVec2operator+= (const SGVec2 &v)
 Inplace addition.
SGVec2operator-= (const SGVec2 &v)
 Inplace subtraction.
template<typename S >
SGVec2operator*= (S s)
 Inplace scalar multiplication.
template<typename S >
SGVec2operator/= (S s)
 Inplace scalar multiplication by 1/s.

Static Public Member Functions

static SGVec2 zeros (void)
 Return an all zero vector.
static SGVec2 e1 (void)
 Return unit vectors.

Detailed Description

template<typename T>
class SGVec2< T >

2D Vector Class

Definition at line 28 of file SGVec2.hxx.


Constructor & Destructor Documentation

template<typename T>
SGVec2< T >::SGVec2 ( void   )  [inline]

Default constructor.

Does not initialize at all. If you need them zero initialized, use SGVec2::zeros()

Initialize with nans in the debug build, that will guarantee to have a fast uninitialized default constructor in the release but shows up uninitialized values in the debug build very fast ...

Definition at line 34 of file SGVec2.hxx.

template<typename T>
SGVec2< T >::SGVec2 ( const T *  d  )  [inline, explicit]

Constructor.

Initialize by the content of a plain array, make sure it has at least 2 elements

Definition at line 49 of file SGVec2.hxx.


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

Generated on 23 Feb 2010 for SimGear by  doxygen 1.6.1