public

Inheritance Graph

graph BT
	_Vec4
	click _Vec4 "classGeometry_1_1__Vec4"

Description

Four-dimensional vector.

[ _Vec4 ]

Classes

   
class Geometry::_Vec4::Comparator

Main

   
   
  _Vec4()
   
  _Vec4( value_t _x, value_t _y, value_t _z, value_t _w)
template< class other_t >  
  _Vec4(const _Vec4 < other_t > & v)
   
  _Vec4(const _Vec4 & v1, const _Vec4 & v2, value_t blend)
   
  _Vec4(const value_t * v)
   
  _Vec4(const vec3_t & v3, value_t _w)

Information

   
   
value_t & operator[](uint_fast8_t nr)
   
const value_t & operator[](uint_fast8_t nr) const
   
const value_t * getVec() const
   
const value_t get(const int & i) const
   
const value_t getX() const
   
const value_t x() const
   
const value_t getY() const
   
const value_t y() const
   
const value_t getZ() const
   
const value_t z() const
   
const value_t getW() const
   
const value_t w() const
   
vec3_t xyz() const
template< typename float_t >  
float_t length() const
   
value_t length() const
   
value_t lengthSquared() const
   
value_t dot(const _Vec4 & p) const
template< typename float_t >  
float_t distance(const _Vec4 & p) const
   
value_t distance(const _Vec4 & p) const
   
bool isZero() const

Modification

   
   
void setValue(const value_t _x, const value_t _y, const value_t _z, const value_t _w)
   
void setValue(const value_t t)
   
void setValue(const value_t * v)
   
void setX(const value_t _x)
   
void x(const value_t v)
   
void setY(const value_t _y)
   
void y(const value_t v)
   
void setZ(const value_t _z)
   
void z(const value_t v)
   
void setW(const value_t _w)
   
void w(const value_t v)
   
_Vec4 & operator+=(const _Vec4 & p)
   
_Vec4 & operator-=(const _Vec4 & p1)
   
_Vec4 & operator*=(const value_t & f)
   
_Vec4 & operator/=(const value_t & f)
   
_Vec4 & normalize()

Creation

   
   
const _Vec4 operator+(const _Vec4 & p) const
   
const _Vec4 operator-(const _Vec4 & p) const
   
const _Vec4 operator-() const
   
const _Vec4 operator*(const value_t & f) const
   
const _Vec4 operator/(const value_t & f) const
   
_Vec4 getNormalized() const

Comparators

   
   
bool equals(const vec3_t & other, value_t epsilon) const
   
bool operator==(const _Vec4 & p) const
   
bool operator!=(const _Vec4 & p) const

Conversion

   
   
void toArray( value_t * t) const

Serialization

 
 
 

Public Types

   
   
typedef T_ value_t
   
typedef _Vec3 < value_t > vec3_t

Documentation

function
Geometry::_Vec4::_Vec4

public inline
   
   
_Vec4( )

[ctor]

Note: all components are initialized with 0

Defined in Geometry/Vec4.h:61


function
Geometry::_Vec4::_Vec4

public inline
     
     
_Vec4( value_t _x,
  value_t _y,
  value_t _z,
  value_t _w
)    

[ctor]

Parameters

x
used to initialize the first component
y
used to initialize the second component
z
used to initialize the third component

Defined in Geometry/Vec4.h:69


function
Geometry::_Vec4::_Vec4

public inline explicit
     
template< class other_t >    
_Vec4( const _Vec4 < other_t > & v )

[ctor]

Parameters

v
used to initialize the new Vec4

Note: values are converted by casting

Defined in Geometry/Vec4.h:77


function
Geometry::_Vec4::_Vec4

public inline
     
     
_Vec4( const _Vec4 & v1,
  const _Vec4 & v2,
  value_t blend
)    

[ctor] interpolation between v1 and sv2, according to the factor blend

Parameters

v1v2
vectors to be interpolated
blend
blendingfactor (should be between 0 and 1)

Defined in Geometry/Vec4.h:86


function
Geometry::_Vec4::_Vec4

public inline explicit
     
     
_Vec4( const value_t * v )

[ctor]

Parameters

v
the first four entries of v are used for for initialisation

Defined in Geometry/Vec4.h:93


function
Geometry::_Vec4::_Vec4

public inline
     
     
_Vec4( const vec3_t & v3,
  value_t _w
)    

[ctor]

Parameters

v
the first three entries of v are used for for initialisation

Defined in Geometry/Vec4.h:99


function
Geometry::_Vec4::operator[]

public inline
     
     
value_t & operator[]( uint_fast8_t nr )

array-access operator

Defined in Geometry/Vec4.h:109


function
Geometry::_Vec4::operator[]

public const inline
     
     
const value_t & operator[]( uint_fast8_t nr ) const

const array-access operator

Defined in Geometry/Vec4.h:114


function
Geometry::_Vec4::getVec

public const inline
   
   
const value_t * getVec( ) const

Returns

the underlying array of this

Defined in Geometry/Vec4.h:119


function
Geometry::_Vec4::get

public const inline
     
     
const value_t get( const int & i ) const

Returns

the i-th component of this

Defined in Geometry/Vec4.h:124


function
Geometry::_Vec4::getX

public const inline
   
   
const value_t getX( ) const

Returns

the x component of this

Note: equal to this[0]

Defined in Geometry/Vec4.h:130


function
Geometry::_Vec4::x

public const inline
   
   
const value_t x( ) const

Defined in Geometry/Vec4.h:133


function
Geometry::_Vec4::getY

public const inline
   
   
const value_t getY( ) const

Returns

the y component of this

Note: equal to this[1]

Defined in Geometry/Vec4.h:139


function
Geometry::_Vec4::y

public const inline
   
   
const value_t y( ) const

Defined in Geometry/Vec4.h:142


function
Geometry::_Vec4::getZ

public const inline
   
   
const value_t getZ( ) const

Returns

the z component of this

Note: equal to this[2]

Defined in Geometry/Vec4.h:148


function
Geometry::_Vec4::z

public const inline
   
   
const value_t z( ) const

Defined in Geometry/Vec4.h:151


function
Geometry::_Vec4::getW

public const inline
   
   
const value_t getW( ) const

Returns

the z component of this

Note: equal to this[3]

Defined in Geometry/Vec4.h:157


function
Geometry::_Vec4::w

public const inline
   
   
const value_t w( ) const

Defined in Geometry/Vec4.h:160


function
Geometry::_Vec4::xyz

public const inline
   
   
vec3_t xyz( ) const

Returns

Vec3(x,y,z)

Defined in Geometry/Vec4.h:165


function
Geometry::_Vec4::length

public const inline
   
template< typename float_t >  
float_t length( ) const

Returns

the length of this

Defined in Geometry/Vec4.h:171


function
Geometry::_Vec4::length

public const inline
   
   
value_t length( ) const

Defined in Geometry/Vec4.h:175


function
Geometry::_Vec4::lengthSquared

public const inline
   
   
value_t lengthSquared( ) const

Returns

the quadrated length of this

Defined in Geometry/Vec4.h:180


function
Geometry::_Vec4::dot

public const inline
     
     
value_t dot( const _Vec4 & p ) const

calculates the dotproduct of this and another Vec4

Parameters

p
the vector to be used for calculation

Returns

the dotproduct of this and p

Defined in Geometry/Vec4.h:187


function
Geometry::_Vec4::distance

public const inline
     
template< typename float_t >    
float_t distance( const _Vec4 & p ) const

calculates the distance between this and another Vec4

Parameters

p
the vector to be used for calculation

Returns

the distance between this and p

Defined in Geometry/Vec4.h:195


function
Geometry::_Vec4::distance

public const inline
     
     
value_t distance( const _Vec4 & p ) const

Defined in Geometry/Vec4.h:198


function
Geometry::_Vec4::isZero

public const inline
   
   
bool isZero( ) const

Returns

vec == (0,0,0,0)

Defined in Geometry/Vec4.h:203


function
Geometry::_Vec4::setValue

public inline
     
     
void setValue( const value_t _x,
  const value_t _y,
  const value_t _z,
  const value_t _w
)    

sets the components of this

Parameters

_x
used to set the first component
_y
used to set the second component
_z
used to set the third component

Defined in Geometry/Vec4.h:216


function
Geometry::_Vec4::setValue

public inline
     
     
void setValue( const value_t t )

sets all components of this

Parameters

t
used to set all components

Defined in Geometry/Vec4.h:225


function
Geometry::_Vec4::setValue

public inline
     
     
void setValue( const value_t * v )

sets the components of this

Parameters

v
the first three values of v are used to set the components of this

Defined in Geometry/Vec4.h:231


function
Geometry::_Vec4::setX

public inline
     
     
void setX( const value_t _x )

sets the x component

Parameters

x
the value the x component of this is set to

Note: equal to this[0]=x

Defined in Geometry/Vec4.h:238


function
Geometry::_Vec4::x

public inline
     
     
void x( const value_t v )

Defined in Geometry/Vec4.h:241


function
Geometry::_Vec4::setY

public inline
     
     
void setY( const value_t _y )

sets the y component

Parameters

y
the value the y component of this is set to

Note: equal to this[1]=y

Defined in Geometry/Vec4.h:248


function
Geometry::_Vec4::y

public inline
     
     
void y( const value_t v )

Defined in Geometry/Vec4.h:251


function
Geometry::_Vec4::setZ

public inline
     
     
void setZ( const value_t _z )

sets the z component

Parameters

z
the value the z component of this is set to

Note: equal to this[2]=z

Defined in Geometry/Vec4.h:258


function
Geometry::_Vec4::z

public inline
     
     
void z( const value_t v )

Defined in Geometry/Vec4.h:261


function
Geometry::_Vec4::setW

public inline
     
     
void setW( const value_t _w )

sets the z component

Parameters

z
the value the z component of this is set to

Note: equal to this[2]=z

Defined in Geometry/Vec4.h:268


function
Geometry::_Vec4::w

public inline
     
     
void w( const value_t v )

Defined in Geometry/Vec4.h:271


function
Geometry::_Vec4::operator+=

public inline
     
     
_Vec4 & operator+=( const _Vec4 & p )

adds another Vec4 to this

Parameters

the
Vec4 to be added

Returns

this

Note: this will be modified

Defined in Geometry/Vec4.h:279


function
Geometry::_Vec4::operator-=

public inline
     
     
_Vec4 & operator-=( const _Vec4 & p1 )

subtracts another Vec4 from this

Parameters

the
Vec4 to be substracted

Returns

this

Note: this will be modified

Defined in Geometry/Vec4.h:291


function
Geometry::_Vec4::operator*=

public inline
     
     
_Vec4 & operator*=( const value_t & f )

multiplies this componentwise with a scalar value

Parameters

f
the scalar

Returns

this

Note: this will be modified

Defined in Geometry/Vec4.h:303


function
Geometry::_Vec4::operator/=

public inline
     
     
_Vec4 & operator/=( const value_t & f )

divides this componentwise by a scalar value

Parameters

f
the scalar

Returns

a new Vec4

Note: this will be modified

Defined in Geometry/Vec4.h:316


function
Geometry::_Vec4::normalize

public inline
   
   
_Vec4 & normalize( )

normalizes this

Returns

this

Note: this will be modified

Defined in Geometry/Vec4.h:328


function
Geometry::_Vec4::operator+

public const inline
     
     
const _Vec4 operator+( const _Vec4 & p ) const

adds another Vec4 to this

Parameters

the
Vec4 to be added

Returns

a new Vec4

Note: this remains unchanged

Defined in Geometry/Vec4.h:354


function
Geometry::_Vec4::operator-

public const inline
     
     
const _Vec4 operator-( const _Vec4 & p ) const

subtracts another Vec4 from this

Parameters

the
Vec4 to be substracted

Returns

a new Vec4

Note: this remains unchanged

Defined in Geometry/Vec4.h:362


function
Geometry::_Vec4::operator-

public const inline
   
   
const _Vec4 operator-( ) const

Returns

a new Vec4 representing the negation of this

Note: this remains unchanged

Defined in Geometry/Vec4.h:368


function
Geometry::_Vec4::operator*

public const inline
     
     
const _Vec4 operator*( const value_t & f ) const

multiplies this componentwise with a scalar value

Parameters

f
the scalar

Returns

a new Vec4

Note: this remains unchanged

Defined in Geometry/Vec4.h:376


function
Geometry::_Vec4::operator/

public const inline
     
     
const _Vec4 operator/( const value_t & f ) const

divides this componentwise by a scalar value

Parameters

f
the scalar

Returns

a new Vec4

Note: this remains unchanged

Defined in Geometry/Vec4.h:385


function
Geometry::_Vec4::getNormalized

public const inline
   
   
_Vec4 getNormalized( ) const

returns a normalized copy of this.

Defined in Geometry/Vec4.h:391


function
Geometry::_Vec4::equals

public const inline
     
     
bool equals( const vec3_t & other,
  value_t epsilon
) const    

compares this with other componentwise

Parameters

other
the object to compare with
epsilon
the maximum allowed difference between the component pairs

Returns

true iff any the absolute difference between any pai of components is larger than epsilon

Defined in Geometry/Vec4.h:405


function
Geometry::_Vec4::operator==

public const inline
     
     
bool operator==( const _Vec4 & p ) const

compares this with another Vec4

Parameters

p
the Vec4 this shall be compared to

Returns

true iff all components of this are equal to the corresponding ones in p

Defined in Geometry/Vec4.h:412


function
Geometry::_Vec4::operator!=

public const inline
     
     
bool operator!=( const _Vec4 & p ) const

compares this with another Vec4

Parameters

p
the Vec4 this shall be compared to

Returns

true iff at least one component of this is not equal to the corresponding one in p

Defined in Geometry/Vec4.h:419


function
Geometry::_Vec4::toArray

public const inline
     
     
void toArray( value_t * t ) const

copies the components of this into the first three values of an array

Parameters

the
arra in which the components shall be copied

Defined in Geometry/Vec4.h:435


typedef
Geometry::_Vec4::value_t

public
 
 
typedef T_ value_t

Defined in Geometry/Vec4.h:31


typedef
Geometry::_Vec4::vec3_t

public
 
 
typedef _Vec3 < value_t > vec3_t

Defined in Geometry/Vec4.h:32