public

Inheritance Graph

graph BT
	_Vec3
	click _Vec3 "classGeometry_1_1__Vec3"

Description

Three-dimensional vector.

[ _Vec3 ]

Classes

   
class Geometry::_Vec3::Comparator

Main

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

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 getX() const
   
const value_t x() const
   
const value_t get(const int & i) const
   
const value_t getY() const
   
const value_t y() const
   
const value_t getZ() const
   
const value_t z() const
   
value_t maxAbsValue() const
template< typename float_t >  
float_t length() const
   
value_t length() const
   
value_t lengthSquared() const
   
value_t dot(const vec3_t & p) const
template< typename float_t >  
float_t distance(const vec3_t & p) const
   
value_t distance(const vec3_t & p) const
   
value_t distanceSquared(const vec3_t & p) const
   
bool isZero() const
   
value_t planeTest(const vec3_t & planePosition, const vec3_t & planeNormal) const
   
value_t planeTest(const vec3_t & planeNormal, const value_t planeDist) const

Modification

   
   
void setValue(const value_t _x, const value_t _y, const value_t _z)
   
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)
   
vec3_t & operator+=(const vec3_t & p)
   
vec3_t & operator-=(const vec3_t & p1)
   
vec3_t & operator*=(const value_t & f)
   
vec3_t & operator/=(const value_t & f)
   
vec3_t & normalize()
   
vec3_t & reflect(const vec3_t & planeNormal)

Creation

   
   
const vec3_t operator+(const vec3_t & p) const
   
const vec3_t operator-(const vec3_t & p) const
   
const vec3_t operator-() const
   
const vec3_t operator*(const value_t & f) const
   
const vec3_t operator*(const vec3_t & p) const
   
const vec3_t operator/(const value_t & f) const
   
const vec3_t operator/(const vec3_t & p) const
   
vec3_t cross(const vec3_t & p) const
   
vec3_t getNormalized() const
   
vec3_t getAbs() const
   
vec3_t getProjection(const vec3_t & planeBase, const vec3_t & planeNormal) const

Comparators

   
   
bool equals(const vec3_t & other, value_t epsilon) const
   
bool operator==(const vec3_t & p) const
   
bool operator!=(const vec3_t & p) const
   
vec3_t pairwiseMin(const vec3_t & a, const vec3_t & b)
   
vec3_t pairwiseMax(const vec3_t & a, const vec3_t & b)

Conversion

   
   
void toArray( value_t * t) const

Serialization

 
 
 

Public Types

   
   
typedef T_ value_t
   
typedef _Vec3 < value_t > vec3_t

Documentation

function
Geometry::_Vec3::_Vec3

public inline
   
   
_Vec3( )

[ctor]

Note: all components are initialized with 0

Defined in Geometry/Vec3.h:59


function
Geometry::_Vec3::_Vec3

public inline
     
     
_Vec3( value_t _x,
  value_t _y,
  value_t _z
)    

[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/Vec3.h:67


function
Geometry::_Vec3::_Vec3

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

[ctor]

Parameters

v
used to initialize the new Vec3

Note: values are converted by casting

Defined in Geometry/Vec3.h:75


function
Geometry::_Vec3::_Vec3

public inline
     
     
_Vec3( const vec3_t & v1,
  const vec3_t & 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/Vec3.h:83


function
Geometry::_Vec3::_Vec3

public inline explicit
     
     
_Vec3( const value_t * v )

[ctor]

Parameters

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

Defined in Geometry/Vec3.h:90


function
Geometry::_Vec3::_Vec3

public inline explicit
     
     
_Vec3( const value_t v )

[ctor]

Parameters

v
used for initialisation of all components

Defined in Geometry/Vec3.h:96


function
Geometry::_Vec3::operator[]

public inline
     
     
value_t & operator[]( uint_fast8_t nr )

array-access operator

Defined in Geometry/Vec3.h:106


function
Geometry::_Vec3::operator[]

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

const array-access operator

Defined in Geometry/Vec3.h:111


function
Geometry::_Vec3::getVec

public const inline
   
   
const value_t * getVec( ) const

Returns

the underlying array of this

Defined in Geometry/Vec3.h:116


function
Geometry::_Vec3::getX

public const inline
   
   
const value_t getX( ) const

Returns

the x component of this

Note: equal to this[0]

Defined in Geometry/Vec3.h:122


function
Geometry::_Vec3::x

public const inline
   
   
const value_t x( ) const

Defined in Geometry/Vec3.h:125


function
Geometry::_Vec3::get

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

Returns

the i-th component of this

Defined in Geometry/Vec3.h:130


function
Geometry::_Vec3::getY

public const inline
   
   
const value_t getY( ) const

Returns

the y component of this

Note: equal to this[1]

Defined in Geometry/Vec3.h:136


function
Geometry::_Vec3::y

public const inline
   
   
const value_t y( ) const

Defined in Geometry/Vec3.h:139


function
Geometry::_Vec3::getZ

public const inline
   
   
const value_t getZ( ) const

Returns

the z component of this

Note: equal to this[2]

Defined in Geometry/Vec3.h:145


function
Geometry::_Vec3::z

public const inline
   
   
const value_t z( ) const

Defined in Geometry/Vec3.h:148


function
Geometry::_Vec3::maxAbsValue

public const inline
   
   
value_t maxAbsValue( ) const

Returns

the maximum absolute value of the components of this

Defined in Geometry/Vec3.h:153


function
Geometry::_Vec3::length

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

Returns

the length of this

Defined in Geometry/Vec3.h:168


function
Geometry::_Vec3::length

public const inline
   
   
value_t length( ) const

Defined in Geometry/Vec3.h:172


function
Geometry::_Vec3::lengthSquared

public const inline
   
   
value_t lengthSquared( ) const

Returns

the quadrated length of this

Defined in Geometry/Vec3.h:177


function
Geometry::_Vec3::dot

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

calculates the dotproduct of this and another Vec3

Parameters

p
the vector to be used for calculation

Returns

the dotproduct of this and p

Defined in Geometry/Vec3.h:184


function
Geometry::_Vec3::distance

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

calculates the distance between this and another Vec3

Parameters

p
the vector to be used for calculation

Returns

the distance between this and p

Defined in Geometry/Vec3.h:192


function
Geometry::_Vec3::distance

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

Defined in Geometry/Vec3.h:196


function
Geometry::_Vec3::distanceSquared

public const inline
     
     
value_t distanceSquared( const vec3_t & p ) const

calculates the squared distance between this and another Vec3

Parameters

p
the vector to be used for calculation

Returns

the squared distance between this and p

Defined in Geometry/Vec3.h:203


function
Geometry::_Vec3::isZero

public const inline
   
   
bool isZero( ) const

Returns

vec == (0,0,0)

Defined in Geometry/Vec3.h:211


function
Geometry::_Vec3::planeTest

public const inline
     
     
value_t planeTest( const vec3_t & planePosition,
  const vec3_t & planeNormal
) const    

Returns

on plane = 0 below plane < 0 above plane > 0

Defined in Geometry/Vec3.h:219


function
Geometry::_Vec3::planeTest

public const inline
     
     
value_t planeTest( const vec3_t & planeNormal,
  const value_t planeDist
) const    

Determine the location of the point relative to the given plane.

Parameters

planeNormal
Normal vector of the plane
planeDist
Distance of the plane to the origin

Returns

Distance of the point to the plane

Defined in Geometry/Vec3.h:230


function
Geometry::_Vec3::setValue

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

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/Vec3.h:243


function
Geometry::_Vec3::setValue

public inline
     
     
void setValue( const value_t t )

sets all components of this

Parameters

t
used to set all components

Defined in Geometry/Vec3.h:251


function
Geometry::_Vec3::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/Vec3.h:257


function
Geometry::_Vec3::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/Vec3.h:264


function
Geometry::_Vec3::x

public inline
     
     
void x( const value_t v )

Defined in Geometry/Vec3.h:267


function
Geometry::_Vec3::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/Vec3.h:274


function
Geometry::_Vec3::y

public inline
     
     
void y( const value_t v )

Defined in Geometry/Vec3.h:277


function
Geometry::_Vec3::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/Vec3.h:284


function
Geometry::_Vec3::z

public inline
     
     
void z( const value_t v )

Defined in Geometry/Vec3.h:287


function
Geometry::_Vec3::operator+=

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

adds another Vec3 to this

Parameters

the
Vec3 to be added

Returns

this

Note: this will be modified

Defined in Geometry/Vec3.h:295


function
Geometry::_Vec3::operator-=

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

subtracts another Vec3 from this

Parameters

the
Vec3 to be substracted

Returns

this

Note: this will be modified

Defined in Geometry/Vec3.h:306


function
Geometry::_Vec3::operator*=

public inline
     
     
vec3_t & 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/Vec3.h:317


function
Geometry::_Vec3::operator/=

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

divides this componentwise by a scalar value

Parameters

f
the scalar

Returns

a new Vec3

Note: this will be modified

Defined in Geometry/Vec3.h:329


function
Geometry::_Vec3::normalize

public inline
   
   
vec3_t & normalize( )

normalizes this

Returns

this

Note: this will be modified

Defined in Geometry/Vec3.h:340


function
Geometry::_Vec3::reflect

public inline
     
     
vec3_t & reflect( const vec3_t & planeNormal )

Change direction as reflected on a plane

Parameters

planeNormal

Defined in Geometry/Vec3.h:358


function
Geometry::_Vec3::operator+

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

adds another Vec3 to this

Parameters

the
Vec3 to be added

Returns

a new Vec3

Note: this remains unchanged

Defined in Geometry/Vec3.h:373


function
Geometry::_Vec3::operator-

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

subtracts another Vec3 from this

Parameters

the
Vec3 to be substracted

Returns

a new Vec3

Note: this remains unchanged

Defined in Geometry/Vec3.h:381


function
Geometry::_Vec3::operator-

public const inline
   
   
const vec3_t operator-( ) const

Returns

a new Vec3 representing the negation of this

Note: this remains unchanged

Defined in Geometry/Vec3.h:387


function
Geometry::_Vec3::operator*

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

multiplies this componentwise with a scalar value

Parameters

f
the scalar

Returns

a new Vec3

Note: this remains unchanged

Defined in Geometry/Vec3.h:395


function
Geometry::_Vec3::operator*

public const inline
     
     
const vec3_t operator*( const vec3_t & p ) const

multiplies this componentwise with another vector

Parameters

p
the other vector

Returns

a new Vec3

Note: this remains unchanged

Defined in Geometry/Vec3.h:403


function
Geometry::_Vec3::operator/

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

divides this componentwise by a scalar value

Parameters

f
the scalar

Returns

a new Vec3

Note: this remains unchanged

Defined in Geometry/Vec3.h:411


function
Geometry::_Vec3::operator/

public const inline
     
     
const vec3_t operator/( const vec3_t & p ) const

divides this componentwise by a another vector

Parameters

p
the other vector

Returns

a new Vec3

Note: this remains unchanged

Defined in Geometry/Vec3.h:419


function
Geometry::_Vec3::cross

public const inline
     
     
vec3_t cross( const vec3_t & p ) const

calculates the crossproduct of this and another Vec3

Parameters

p
the vector to be used for calculation

Returns

a vector standing orthogonal on the plane defined by this and p

Note: the returned vector is a normalvector iff this and p are normalvectors

Defined in Geometry/Vec3.h:426


function
Geometry::_Vec3::getNormalized

public const inline
   
   
vec3_t getNormalized( ) const

returns a normalized copy of this.

Defined in Geometry/Vec3.h:432


function
Geometry::_Vec3::getAbs

public const inline
   
   
vec3_t getAbs( ) const

returns a normalized copy of this.

Defined in Geometry/Vec3.h:438


function
Geometry::_Vec3::getProjection

public const inline
     
     
vec3_t getProjection( const vec3_t & planeBase,
  const vec3_t & planeNormal
) const    

calculates the projection of this on a plane.

Parameters

planeBase
plane base point
planeNormal
planeNormal

Defined in Geometry/Vec3.h:445


function
Geometry::_Vec3::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/Vec3.h:460


function
Geometry::_Vec3::operator==

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

compares this with another Vec3

Parameters

p
the Vec3 this shall be compared to

Returns

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

Defined in Geometry/Vec3.h:467


function
Geometry::_Vec3::operator!=

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

compares this with another Vec3

Parameters

p
the Vec3 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/Vec3.h:474


function
Geometry::_Vec3::pairwiseMin

public static inline
     
     
vec3_t pairwiseMin( const vec3_t & a,
  const vec3_t & b
)    

Defined in Geometry/Vec3.h:478


function
Geometry::_Vec3::pairwiseMax

public static inline
     
     
vec3_t pairwiseMax( const vec3_t & a,
  const vec3_t & b
)    

Defined in Geometry/Vec3.h:482


function
Geometry::_Vec3::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/Vec3.h:494


typedef
Geometry::_Vec3::value_t

public
 
 
typedef T_ value_t

Defined in Geometry/Vec3.h:31


typedef
Geometry::_Vec3::vec3_t

public
 
 
typedef _Vec3 < value_t > vec3_t

Defined in Geometry/Vec3.h:32