Public Member Functions | Private Attributes | Friends
karto::Vector3< T > Class Template Reference

#include <Geometry.h>

List of all members.

Public Member Functions

Vector2< T > GetAsVector2 () const
const T & GetX () const
const T & GetY () const
const T & GetZ () const
kt_double Length () const
void MakeCeil (const Vector3 &rOther)
void MakeFloor (const Vector3 &rOther)
void Normalize ()
kt_bool operator!= (const Vector3 &rOther) const
const Vector3 operator* (T scalar) const
Vector3operator*= (const Vector3 &rOther)
Vector3operator*= (const T &rValue)
const Vector3 operator+ (const Vector3 &rOther) const
const Vector3 operator+ (kt_double scalar) const
Vector3operator+= (const Vector3 &rOther)
Vector3operator+= (const T &rValue)
const Vector3 operator- (const Vector3 &rOther) const
const Vector3 operator- (kt_double scalar) const
Vector3operator-= (const Vector3 &rOther)
Vector3operator-= (const T &rValue)
Vector3operator/= (const Vector3 &rOther)
Vector3operator/= (const T &rValue)
kt_bool operator< (const Vector3 &rOther) const
Vector3operator= (const Vector3 &rOther)
kt_bool operator== (const Vector3 &rOther) const
const Vector3 operator^ (const Vector3 &rOther) const
void SetX (const T &x)
void SetY (const T &y)
void SetZ (const T &z)
kt_double SquaredLength () const
const String ToString () const
 Vector3 ()
 Vector3 (T x, T y, T z)
 Vector3 (const Vector2< T > &rVector)
 Vector3 (const Vector3 &rOther)

Private Attributes

m_Values [3]

Friends

KARTO_FORCEINLINE std::ostream & operator<< (std::ostream &rStream, const Vector3 &rVector)

Detailed Description

template<typename T>
class karto::Vector3< T >

Represents a 3-dimensional vector (x, y, z)

Definition at line 620 of file Geometry.h.


Constructor & Destructor Documentation

template<typename T>
karto::Vector3< T >::Vector3 ( ) [inline]

Vector at the origin

Definition at line 626 of file Geometry.h.

template<typename T>
karto::Vector3< T >::Vector3 ( x,
y,
z 
) [inline]

Vector at the given location

Parameters:
xx
yy
zz

Definition at line 639 of file Geometry.h.

template<typename T>
karto::Vector3< T >::Vector3 ( const Vector2< T > &  rVector) [inline]

Constructs a 3D vector from the given 2D vector with a z-component of 0

Parameters:
rVector2D vector

Definition at line 650 of file Geometry.h.

template<typename T>
karto::Vector3< T >::Vector3 ( const Vector3< T > &  rOther) [inline]

Copy constructor

Definition at line 660 of file Geometry.h.


Member Function Documentation

template<typename T>
Vector2<T> karto::Vector3< T >::GetAsVector2 ( ) const [inline]

Gets a 2D version of this vector (ignores z-component)

Returns:
2D version of this vector

Definition at line 726 of file Geometry.h.

template<typename T>
const T& karto::Vector3< T >::GetX ( ) const [inline]

Gets the x-component of this vector

Returns:
the x-component

Definition at line 672 of file Geometry.h.

template<typename T>
const T& karto::Vector3< T >::GetY ( ) const [inline]

Gets the y-component of this vector

Returns:
the y-component

Definition at line 690 of file Geometry.h.

template<typename T>
const T& karto::Vector3< T >::GetZ ( ) const [inline]

Gets the z-component of this vector

Returns:
the z-component

Definition at line 708 of file Geometry.h.

template<typename T>
kt_double karto::Vector3< T >::Length ( ) const [inline]

Returns the length of the vector.

Returns:
length of the vector

Definition at line 766 of file Geometry.h.

template<typename T>
void karto::Vector3< T >::MakeCeil ( const Vector3< T > &  rOther) [inline]

Ceiling vector operator

Parameters:
rOthervector

Definition at line 746 of file Geometry.h.

template<typename T>
void karto::Vector3< T >::MakeFloor ( const Vector3< T > &  rOther) [inline]

Floor vector operator

Parameters:
rOthervector

Definition at line 735 of file Geometry.h.

template<typename T>
void karto::Vector3< T >::Normalize ( ) [inline]

Normalize the vector

Definition at line 774 of file Geometry.h.

template<typename T>
kt_bool karto::Vector3< T >::operator!= ( const Vector3< T > &  rOther) const [inline]

Inequality operator

Definition at line 1015 of file Geometry.h.

template<typename T>
const Vector3 karto::Vector3< T >::operator* ( scalar) const [inline]

Scales the vector by the given scalar

Definition at line 850 of file Geometry.h.

template<typename T>
Vector3& karto::Vector3< T >::operator*= ( const Vector3< T > &  rOther) [inline]

In-place component-wise vector multiplication

Parameters:
rOthervector
Returns:
this vector after multiplying each component with the corresponding component in the other vector

Definition at line 884 of file Geometry.h.

template<typename T>
Vector3& karto::Vector3< T >::operator*= ( const T &  rValue) [inline]

In-place vector-scalar multiplication

Definition at line 938 of file Geometry.h.

template<typename T>
const Vector3 karto::Vector3< T >::operator+ ( const Vector3< T > &  rOther) const [inline]

Vector addition

Definition at line 818 of file Geometry.h.

template<typename T>
const Vector3 karto::Vector3< T >::operator+ ( kt_double  scalar) const [inline]

Vector-scalar addition

Definition at line 826 of file Geometry.h.

template<typename T>
Vector3& karto::Vector3< T >::operator+= ( const Vector3< T > &  rOther) [inline]

In-place vector addition

Definition at line 858 of file Geometry.h.

template<typename T>
Vector3& karto::Vector3< T >::operator+= ( const T &  rValue) [inline]

In-place component-wise scalar addition

Parameters:
rValuevalue to add to each component
Returns:
this vector after adding each component with the given value

Definition at line 912 of file Geometry.h.

template<typename T>
const Vector3 karto::Vector3< T >::operator- ( const Vector3< T > &  rOther) const [inline]

Vector subtraction

Definition at line 834 of file Geometry.h.

template<typename T>
const Vector3 karto::Vector3< T >::operator- ( kt_double  scalar) const [inline]

Vector-scalar subtraction

Definition at line 842 of file Geometry.h.

template<typename T>
Vector3& karto::Vector3< T >::operator-= ( const Vector3< T > &  rOther) [inline]

In-place vector subtraction

Definition at line 870 of file Geometry.h.

template<typename T>
Vector3& karto::Vector3< T >::operator-= ( const T &  rValue) [inline]

In-place component-wise scalar subtraction

Parameters:
rValuevalue to subtract from each component
Returns:
this vector after subtracting the given value from each component

Definition at line 926 of file Geometry.h.

template<typename T>
Vector3& karto::Vector3< T >::operator/= ( const Vector3< T > &  rOther) [inline]

In-place component-wise vector division

Parameters:
rOthervector
Returns:
this vector after dividing each component with the corresponding component in the other vector

Definition at line 898 of file Geometry.h.

template<typename T>
Vector3& karto::Vector3< T >::operator/= ( const T &  rValue) [inline]

In-place component-wise vector-scalar division

Parameters:
rValuevalue to divide from each component
Returns:
this vector after dividing each component with the given value

Definition at line 952 of file Geometry.h.

template<typename T>
kt_bool karto::Vector3< T >::operator< ( const Vector3< T > &  rOther) const [inline]

Less than operator

Parameters:
rOtherother vector
Returns:
true if left vector is 'less' than right vector by comparing corresponding x coordinates, then corresponding y coordinates, and then corresponding z coordinates

Definition at line 980 of file Geometry.h.

template<typename T>
Vector3& karto::Vector3< T >::operator= ( const Vector3< T > &  rOther) [inline]

Assignment operator

Definition at line 806 of file Geometry.h.

template<typename T>
kt_bool karto::Vector3< T >::operator== ( const Vector3< T > &  rOther) const [inline]

Equality operator

Definition at line 1007 of file Geometry.h.

template<typename T>
const Vector3 karto::Vector3< T >::operator^ ( const Vector3< T > &  rOther) const [inline]

Vector cross product

Parameters:
rOthervector
Returns:
cross product of this vector and given vector

Definition at line 966 of file Geometry.h.

template<typename T>
void karto::Vector3< T >::SetX ( const T &  x) [inline]

Sets the x-component of this vector

Parameters:
xx-component

Definition at line 681 of file Geometry.h.

template<typename T>
void karto::Vector3< T >::SetY ( const T &  y) [inline]

Sets the y-component of this vector

Parameters:
yy-component

Definition at line 699 of file Geometry.h.

template<typename T>
void karto::Vector3< T >::SetZ ( const T &  z) [inline]

Sets the z-component of this vector

Parameters:
zz-component

Definition at line 717 of file Geometry.h.

template<typename T>
kt_double karto::Vector3< T >::SquaredLength ( ) const [inline]

Returns the square of the length of the vector

Returns:
square of the length of the vector

Definition at line 757 of file Geometry.h.

template<typename T>
const String karto::Vector3< T >::ToString ( ) const [inline]

Returns a string representation of this vector

Returns:
string representation of this vector

Definition at line 791 of file Geometry.h.


Friends And Related Function Documentation

template<typename T>
KARTO_FORCEINLINE std::ostream& operator<< ( std::ostream &  rStream,
const Vector3< T > &  rVector 
) [friend]

Write vector onto output stream

Definition at line 1023 of file Geometry.h.


Member Data Documentation

template<typename T>
T karto::Vector3< T >::m_Values[3] [private]

Definition at line 1030 of file Geometry.h.


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


nav2d_karto
Author(s): Sebastian Kasperski
autogenerated on Thu Aug 27 2015 14:07:26