Web Analytics Made Easy - Statcounter
Skip to content

Class SBDTypePhysicalVector6#

template <typename QuantityA, typename QuantityL>

ClassList > SBDTypePhysicalVector6

This template class is used to represent spatial vectors. More...

  • #include <SBDTypePhysicalVector6.hpp>

Public Attributes#

Type Name
SBDTypePhysicalVector3< QuantityA > angular
The part of the spatial vector.
SBDTypePhysicalVector3< QuantityL > linear
The part of the spatial vector.

Public Static Attributes#

Type Name
const SBDTypePhysicalVector6< QuantityA, QuantityL > zero
The zero spatial vector.

Public Functions#

Type Name
SBDTypePhysicalVector6 ()
Constructs the spatial vector [ 0 0 0 ].
SBDTypePhysicalVector6 (QuantityA a, QuantityL l)
Constructs the spatial vector [ a a a l l __l ].
SBDTypePhysicalVector6 (QuantityA ax, QuantityA ay, QuantityA az, QuantityL lx, QuantityL ly, QuantityL lz)
Constructs the spatial vector [ ax ay az lx ly __lz ].
SBDTypePhysicalVector6 (QuantityA a, QuantityL l)
Constructs the spatial vector [ a [0]a [1]a [2]l [0]l [1]l [2] ].
SBDTypePhysicalVector6 (const SBDTypePhysicalVector3< QuantityA > & a, const SBDTypePhysicalVector3< QuantityL > & l)
Constructs the spatial vector [ a __l ].
SBDTypePhysicalVector6 (double a, double l)
Constructs the spatial vector [ a a a l l __l ].
SBDTypePhysicalVector6 (double ax, double ay, double az, double lx, double ly, double lz)
Constructs the spatial vector [ ax ay az lx ly __lz ].
SBDTypePhysicalVector6 (double a, double l)
Constructs the spatial vector [ a __l ].
SBDTypePhysicalVector6 (const SBDTypePhysicalVector6< QuantityA, QuantityL > & u)
Copy constructor.
SBDTypePhysicalVector6< SBQuantity::dimensionless, SBQuantity::dimensionless > getValue () const
Returns a dimensionless spatial vector whose components are equal to those of this spatial vector.
void getValue (double * array) const
Stores the components as doubles in array [0],array [1],array [2],array [3],array [4] andarray [5] (angular, then linear)
void getValue (float * array) const
Stores the components as floats in array [0],array [1],array [2],array [3],array [4] andarray [5] (angular, then linear)
void motionCrossForce (const SBDTypePhysicalVector6< QuantityAB, QuantityLB > & force, SBDTypePhysicalVector6< SBQuantityType< typename SBDQuantityUnitMultiplication< typename QuantityA::UnitType, typename QuantityAB::UnitType >::UnitType >, SBQuantityType< typename SBDQuantityUnitMultiplication< typename QuantityA::UnitType, typename QuantityLB::UnitType >::UnitType > > & vxf) const
Returns the cross product of this spatial vector with spatial vector u .
operator SBDTypePhysicalVector6< QuantityAB, QuantityLB > () const
Converts this spatial vector to a spatial vector with units QuantityB .
bool operator!= (const SBDTypePhysicalVector6< QuantityAB, QuantityLB > & u) const
Returns true if this spatial vector is different from spatial vector u (component-wise)
SBDTypePhysicalVector6< SBQuantityType< typename SBDQuantityUnitMultiplication< typename QuantityA::UnitType, typename QuantityB::UnitType >::UnitType >, SBQuantityType< typename SBDQuantityUnitMultiplication< typename QuantityL::UnitType, typename QuantityB::UnitType >::UnitType > > operator* (QuantityB d) const
Returns the product of this spatial vector with physical quantity d .
SBDTypePhysicalVector6< QuantityA, QuantityL > operator* (double d) const
Returns the product of this spatial vector with double d .
SBDTypePhysicalVector6< SBQuantityType< typename SBDQuantityUnitMultiplication< typename QuantityA::UnitType, typename QuantityAB::UnitType >::UnitType >, SBQuantityType< typename SBDQuantityUnitMultiplication< typename QuantityL::UnitType, typename QuantityLB::UnitType >::UnitType > > operator* (const SBDTypePhysicalVector6< QuantityAB, QuantityLB > & u) const
Returns the component-wise product of this spatial vector with spatial vector u .
SBDTypePhysicalVector6< QuantityA, QuantityL > & operator*= (const Quantity & d)
Multiplies this spatial vector with physical quantity d .
SBDTypePhysicalVector6< QuantityA, QuantityL > operator+ (const SBDTypePhysicalVector6< QuantityA, QuantityL > & u) const
Returns the sum of this spatial vector with spatial vector u .
SBDTypePhysicalVector6< QuantityA, QuantityL > & operator+= (const SBDTypePhysicalVector6< QuantityA, QuantityL > & u)
Adds spatial vector u to this spatial vector.
SBDTypePhysicalVector6< QuantityA, QuantityL > operator- (const SBDTypePhysicalVector6< QuantityA, QuantityL > & u) const
Returns the difference of this spatial vector with spatial vector u .
SBDTypePhysicalVector6< QuantityA, QuantityL > operator- () const
Returns the opposite of this spatial vector.
SBDTypePhysicalVector6< QuantityA, QuantityL > & operator-= (const SBDTypePhysicalVector6< QuantityA, QuantityL > & u)
Subtracts spatial vector u from this spatial vector.
SBDTypePhysicalVector6< SBQuantityType< typename SBDQuantityUnitDivision< typename QuantityA::UnitType, typename QuantityB::UnitType >::UnitType >, SBQuantityType< typename SBDQuantityUnitDivision< typename QuantityL::UnitType, typename QuantityB::UnitType >::UnitType > > operator/ (QuantityB d) const
Returns the division of this spatial vector by physical quantity d .
SBDTypePhysicalVector6< QuantityA, QuantityL > operator/ (double d) const
Returns the division of this spatial vector by double d .
SBDTypePhysicalVector6< QuantityA, QuantityL > & operator/= (Quantity d)
Divides this spatial vector by physical quantity d .
bool operator< (const SBDTypePhysicalVector6< QuantityAB, QuantityLB > & u) const
Returns true if this spatial vector is smaller than spatial vector u (lexicographic comparison)
bool operator<= (const SBDTypePhysicalVector6< QuantityAB, QuantityLB > & u) const
Returns true if this spatial vector is smaller or equal than spatial vector u (lexicographic comparison)
SBDTypePhysicalVector6< QuantityA, QuantityL > & operator= (const SBDTypePhysicalVector6< QuantityA, QuantityL > & u)
Copy assignment.
bool operator== (const SBDTypePhysicalVector6< QuantityAB, QuantityLB > & u) const
Returns true if this spatial vector is equal to spatial vector u (component-wise)
bool operator> (const SBDTypePhysicalVector6< QuantityAB, QuantityLB > & u) const
Returns true if this spatial vector is larger than spatial vector u (lexicographic comparison)
bool operator>= (const SBDTypePhysicalVector6< QuantityAB, QuantityLB > & u) const
Returns true if this spatial vector is larger or equal than spatial vector u (lexicographic comparison)
SBDTypePhysicalVector6< SBQuantityType< typename SBDQuantityUnitMultiplication< typename QuantityA::UnitType, typename QuantityAB::UnitType >::UnitType >, SBQuantityType< typename SBDQuantityUnitMultiplication< typename QuantityA::UnitType, typename QuantityLB::UnitType >::UnitType > > operator^ (const SBDTypePhysicalVector6< QuantityAB, QuantityLB > & force) const
Returns the cross product of this spatial vector with spatial vector u .
SBQuantityType< typename SBDQuantityUnitMultiplication< typename QuantityA::UnitType, typename QuantityAB::UnitType >::UnitType > operator| (const SBDTypePhysicalVector6< QuantityAB, QuantityLB > & u) const
Returns the dot product of this spatial vector with spatial vector u .
void print () const
Prints this spatial vector.
void serialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER) const
Serializes the spatial vector using the provided serializer .
void setValue (const SBDTypePhysicalVector6< SBQuantity::dimensionless, SBQuantity::dimensionless > & u)
Sets the components of this spatial vector equal to those of the dimensionless spatial vector u .
void setZero ()
Sets all components to zero.
void unserialize (SBCSerializer * serializer, const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER)
Unserializes the spatial vector using the provided serializer .
void updateLowerUpper (SBDTypePhysicalVector6< QuantityALower, QuantityLLower > & lower, SBDTypePhysicalVector6< QuantityAUpper, QuantityLUpper > & upper) const
Updates the lower andupper vector bounds with this spatial vector.

Detailed Description#

Template parameters:

  • QuantityA The quantity type of the angular part
  • QuantityL The quantity type of the linear part

This template class represents spatial vectors (introduced by Roy Featherstone), i.e. six-dimensional vectors used to describe rigid-body dynamics and articulated-body dynamics. Spatial vectors are physical quantities, and thus use SAMSON's unit system. Because a spatial vector has an angular part and a linear part, which may have different units, spatial vectors are defined by two units, and the SBDTypePhysicalVector6 template class is parameterized by two types: QuantityA and QuantityL.

Most of the time, developers of SAMSON Extensions do not have to use this template, but may directly use some predefined types, e.g. SBVector6 (dimensionless spatial vector), SBForce6 (spatial force), SBVelocity6 (spatial velocity), or SBAcceleration6 (spatial acceleration).

Short name: SBPhysicalVector6

See also: SBDTypePhysicalVector3, SBDTypePhysicalMatrix66

See also: SAMSON's unit system

Public Attributes Documentation#

variable angular#

The part of the spatial vector.

SBDTypePhysicalVector3<QuantityA> angular;


variable linear#

The part of the spatial vector.

SBDTypePhysicalVector3<QuantityL> linear;


Public Static Attributes Documentation#

variable zero#

The zero spatial vector.

SBDTypePhysicalVector6< QuantityA, QuantityL > const zero;


Public Functions Documentation#

function SBDTypePhysicalVector6 [1/9]#

Constructs the spatial vector [ 0 0 0 ].

inline SBDTypePhysicalVector6::SBDTypePhysicalVector6 () 


function SBDTypePhysicalVector6 [2/9]#

Constructs the spatial vector [ a a a l l __l ].

inline explicit SBDTypePhysicalVector6::SBDTypePhysicalVector6 (
    QuantityA a,
    QuantityL l
) 


function SBDTypePhysicalVector6 [3/9]#

Constructs the spatial vector [ ax ay az lx ly __lz ].

inline SBDTypePhysicalVector6::SBDTypePhysicalVector6 (
    QuantityA ax,
    QuantityA ay,
    QuantityA az,
    QuantityL lx,
    QuantityL ly,
    QuantityL lz
) 


function SBDTypePhysicalVector6 [4/9]#

Constructs the spatial vector [ a [0]a [1]a [2]l [0]l [1]l [2] ].

inline SBDTypePhysicalVector6::SBDTypePhysicalVector6 (
    QuantityA a,
    QuantityL l
) 


function SBDTypePhysicalVector6 [5/9]#

Constructs the spatial vector [ a __l ].

inline SBDTypePhysicalVector6::SBDTypePhysicalVector6 (
    const SBDTypePhysicalVector3 < QuantityA > & a,
    const SBDTypePhysicalVector3 < QuantityL > & l
) 


function SBDTypePhysicalVector6 [6/9]#

Constructs the spatial vector [ a a a l l __l ].

inline explicit SBDTypePhysicalVector6::SBDTypePhysicalVector6 (
    double a,
    double l
) 


function SBDTypePhysicalVector6 [7/9]#

Constructs the spatial vector [ ax ay az lx ly __lz ].

inline SBDTypePhysicalVector6::SBDTypePhysicalVector6 (
    double ax,
    double ay,
    double az,
    double lx,
    double ly,
    double lz
) 


function SBDTypePhysicalVector6 [8/9]#

Constructs the spatial vector [ a __l ].

inline SBDTypePhysicalVector6::SBDTypePhysicalVector6 (
    double a,
    double l
) 


function SBDTypePhysicalVector6 [9/9]#

Copy constructor.

inline SBDTypePhysicalVector6::SBDTypePhysicalVector6 (
    const SBDTypePhysicalVector6 < QuantityA, QuantityL > & u
) 


function getValue [1/3]#

Returns a dimensionless spatial vector whose components are equal to those of this spatial vector.

inline SBDTypePhysicalVector6 < SBQuantity::dimensionless , SBQuantity::dimensionless > SBDTypePhysicalVector6::getValue () const


function getValue [2/3]#

Stores the components as doubles in array [0],array [1],array [2],array [3],array [4] andarray [5] (angular, then linear)

inline void SBDTypePhysicalVector6::getValue (
    double * array
) const


function getValue [3/3]#

Stores the components as floats in array [0],array [1],array [2],array [3],array [4] andarray [5] (angular, then linear)

inline void SBDTypePhysicalVector6::getValue (
    float * array
) const


function motionCrossForce#

Returns the cross product of this spatial vector with spatial vector u .

template<typename QuantityAB, typename QuantityLB>
inline void SBDTypePhysicalVector6::motionCrossForce (
    const SBDTypePhysicalVector6 < QuantityAB, QuantityLB > & force,
    SBDTypePhysicalVector6 < SBQuantityType< typename SBDQuantityUnitMultiplication< typename QuantityA::UnitType, typename QuantityAB::UnitType >::UnitType >, SBQuantityType< typename SBDQuantityUnitMultiplication< typename QuantityA::UnitType, typename QuantityLB::UnitType >::UnitType > > & vxf
) const

Parameters:

  • force The force
  • vxf The resulting cross product between this spatial vector and the force

This function returns the cross product of this spatial vector with spatial vector u. As with the cross product operator, this function is only useful when this spatial vector is a motion and force is a force.


function operator SBDTypePhysicalVector6< QuantityAB, QuantityLB >#

Converts this spatial vector to a spatial vector with units QuantityB .

template<typename QuantityAB, typename QuantityLB>
inline SBDTypePhysicalVector6::operator SBDTypePhysicalVector6< QuantityAB, QuantityLB > () const


function operator!=#

Returns true if this spatial vector is different from spatial vector u (component-wise)

template<typename QuantityAB, typename QuantityLB>
inline bool SBDTypePhysicalVector6::operator!= (
    const SBDTypePhysicalVector6 < QuantityAB, QuantityLB > & u
) const


function operator*#

Returns the product of this spatial vector with physical quantity d .

template<typename QuantityB>
inline SBDTypePhysicalVector6 < SBQuantityType< typename SBDQuantityUnitMultiplication< typename QuantityA::UnitType, typename QuantityB::UnitType >::UnitType >, SBQuantityType< typename SBDQuantityUnitMultiplication< typename QuantityL::UnitType, typename QuantityB::UnitType >::UnitType > > SBDTypePhysicalVector6::operator* (
    QuantityB d
) const


function operator*#

Returns the product of this spatial vector with double d .

inline SBDTypePhysicalVector6 < QuantityA, QuantityL > SBDTypePhysicalVector6::operator* (
    double d
) const


function operator*#

Returns the component-wise product of this spatial vector with spatial vector u .

template<typename QuantityAB, typename QuantityLB>
inline SBDTypePhysicalVector6 < SBQuantityType< typename SBDQuantityUnitMultiplication< typename QuantityA::UnitType, typename QuantityAB::UnitType >::UnitType >, SBQuantityType< typename SBDQuantityUnitMultiplication< typename QuantityL::UnitType, typename QuantityLB::UnitType >::UnitType > > SBDTypePhysicalVector6::operator* (
    const SBDTypePhysicalVector6 < QuantityAB, QuantityLB > & u
) const

This operator returns the component-wise product of this spatial vector with spatial vector u, i.e. a spatial vector in which each component is the product of the corresponding components in this spatial vector and spatial vector u.


function operator*=#

Multiplies this spatial vector with physical quantity d .

template<typename Quantity>
inline SBDTypePhysicalVector6 < QuantityA, QuantityL > & SBDTypePhysicalVector6::operator*= (
    const Quantity & d
) 

Parameters:

  • d A dimensionless physical quantity or a numeric type (i.e. int, float, double, etc)

function operator+#

Returns the sum of this spatial vector with spatial vector u .

inline SBDTypePhysicalVector6 < QuantityA, QuantityL > SBDTypePhysicalVector6::operator+ (
    const SBDTypePhysicalVector6 < QuantityA, QuantityL > & u
) const


function operator+=#

Adds spatial vector u to this spatial vector.

inline SBDTypePhysicalVector6 < QuantityA, QuantityL > & SBDTypePhysicalVector6::operator+= (
    const SBDTypePhysicalVector6 < QuantityA, QuantityL > & u
) 


function operator-#

Returns the difference of this spatial vector with spatial vector u .

inline SBDTypePhysicalVector6 < QuantityA, QuantityL > SBDTypePhysicalVector6::operator- (
    const SBDTypePhysicalVector6 < QuantityA, QuantityL > & u
) const


function operator-#

Returns the opposite of this spatial vector.

inline SBDTypePhysicalVector6 < QuantityA, QuantityL > SBDTypePhysicalVector6::operator- () const


function operator-=#

Subtracts spatial vector u from this spatial vector.

inline SBDTypePhysicalVector6 < QuantityA, QuantityL > & SBDTypePhysicalVector6::operator-= (
    const SBDTypePhysicalVector6 < QuantityA, QuantityL > & u
) 


function operator/#

Returns the division of this spatial vector by physical quantity d .

template<typename QuantityB>
inline SBDTypePhysicalVector6 < SBQuantityType< typename SBDQuantityUnitDivision< typename QuantityA::UnitType, typename QuantityB::UnitType >::UnitType >, SBQuantityType< typename SBDQuantityUnitDivision< typename QuantityL::UnitType, typename QuantityB::UnitType >::UnitType > > SBDTypePhysicalVector6::operator/ (
    QuantityB d
) const


function operator/#

Returns the division of this spatial vector by double d .

inline SBDTypePhysicalVector6 < QuantityA, QuantityL > SBDTypePhysicalVector6::operator/ (
    double d
) const


function operator/=#

Divides this spatial vector by physical quantity d .

template<typename Quantity>
inline SBDTypePhysicalVector6 < QuantityA, QuantityL > & SBDTypePhysicalVector6::operator/= (
    Quantity d
) 

Parameters:

  • d A dimensionless physical quantity or a numeric type (i.e. int, float, double, etc)

function operator<#

Returns true if this spatial vector is smaller than spatial vector u (lexicographic comparison)

template<typename QuantityAB, typename QuantityLB>
inline bool SBDTypePhysicalVector6::operator< (
    const SBDTypePhysicalVector6 < QuantityAB, QuantityLB > & u
) const


function operator<=#

Returns true if this spatial vector is smaller or equal than spatial vector u (lexicographic comparison)

template<typename QuantityAB, typename QuantityLB>
inline bool SBDTypePhysicalVector6::operator<= (
    const SBDTypePhysicalVector6 < QuantityAB, QuantityLB > & u
) const


function operator=#

Copy assignment.

inline SBDTypePhysicalVector6 < QuantityA, QuantityL > & SBDTypePhysicalVector6::operator= (
    const SBDTypePhysicalVector6 < QuantityA, QuantityL > & u
) 


function operator==#

Returns true if this spatial vector is equal to spatial vector u (component-wise)

template<typename QuantityAB, typename QuantityLB>
inline bool SBDTypePhysicalVector6::operator== (
    const SBDTypePhysicalVector6 < QuantityAB, QuantityLB > & u
) const


function operator>#

Returns true if this spatial vector is larger than spatial vector u (lexicographic comparison)

template<typename QuantityAB, typename QuantityLB>
inline bool SBDTypePhysicalVector6::operator> (
    const SBDTypePhysicalVector6 < QuantityAB, QuantityLB > & u
) const


function operator>=#

Returns true if this spatial vector is larger or equal than spatial vector u (lexicographic comparison)

template<typename QuantityAB, typename QuantityLB>
inline bool SBDTypePhysicalVector6::operator>= (
    const SBDTypePhysicalVector6 < QuantityAB, QuantityLB > & u
) const


function operator^#

Returns the cross product of this spatial vector with spatial vector u .

template<typename QuantityAB, typename QuantityLB>
inline SBDTypePhysicalVector6 < SBQuantityType< typename SBDQuantityUnitMultiplication< typename QuantityA::UnitType, typename QuantityAB::UnitType >::UnitType >, SBQuantityType< typename SBDQuantityUnitMultiplication< typename QuantityA::UnitType, typename QuantityLB::UnitType >::UnitType > > SBDTypePhysicalVector6::operator^ (
    const SBDTypePhysicalVector6 < QuantityAB, QuantityLB > & force
) const


function operator|#

Returns the dot product of this spatial vector with spatial vector u .

template<typename QuantityAB, typename QuantityLB>
inline SBQuantityType< typename SBDQuantityUnitMultiplication< typename QuantityA::UnitType, typename QuantityAB::UnitType >::UnitType > SBDTypePhysicalVector6::operator| (
    const SBDTypePhysicalVector6 < QuantityAB, QuantityLB > & u
) const


function print#

Prints this spatial vector.

inline void SBDTypePhysicalVector6::print () const


function serialize#

Serializes the spatial vector using the provided serializer .

inline void SBDTypePhysicalVector6::serialize (
    SBCSerializer * serializer,
    const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
) const


function setValue#

Sets the components of this spatial vector equal to those of the dimensionless spatial vector u .

inline void SBDTypePhysicalVector6::setValue (
    const SBDTypePhysicalVector6 < SBQuantity::dimensionless , SBQuantity::dimensionless > & u
) 


function setZero#

Sets all components to zero.

inline void SBDTypePhysicalVector6::setZero () 


function unserialize#

Unserializes the spatial vector using the provided serializer .

inline void SBDTypePhysicalVector6::unserialize (
    SBCSerializer * serializer,
    const SBVersionNumber & sdkVersionNumber=SB_SDK_VERSION_NUMBER
) 


function updateLowerUpper#

Updates the lower andupper vector bounds with this spatial vector.

template<typename QuantityALower, typename QuantityAUpper, typename QuantityLLower, typename QuantityLUpper>
inline void SBDTypePhysicalVector6::updateLowerUpper (
    SBDTypePhysicalVector6 < QuantityALower, QuantityLLower > & lower,
    SBDTypePhysicalVector6 < QuantityAUpper, QuantityLUpper > & upper
) const

Parameters:

  • lower The lower bound
  • upper The upper bound

If necessary, this function updates the lower and upper bounds to ensure that they contain this spatial vector.