Loading...
Searching...
No Matches
SBDTypePhysicalVector6< QuantityA, QuantityL > Class Template Reference

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

Useful functions

static const SBDTypePhysicalVector6< QuantityA, QuantityL > zero
 The zero spatial vector.
 
SBDTypePhysicalVector3< QuantityA > angular
 The part of the spatial vector.
 
SBDTypePhysicalVector3< QuantityL > linear
 The part of the spatial vector.
 
void setZero ()
 Sets all components to zero.
 
template<typename QuantityAB , typename QuantityLB >
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.
 
void print () const
 Prints this spatial vector.
 
template<typename QuantityALower , typename QuantityAUpper , typename QuantityLLower , typename QuantityLUpper >
void updateLowerUpper (SBDTypePhysicalVector6< QuantityALower, QuantityLLower > &lower, SBDTypePhysicalVector6< QuantityAUpper, QuantityLUpper > &upper) const
 Updates the lower and upper vector bounds with this spatial vector.
 

Constructors

 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[3], QuantityL l[3])
 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[3], double l[3])
 Constructs the spatial vector [ a l ].
 
 SBDTypePhysicalVector6 (const SBDTypePhysicalVector6< QuantityA, QuantityL > &u)
 Copy constructor.
 

Serialization

void serialize (SBCSerializer *serializer, const SBVersionNumber &sdkVersionNumber=SB_SDK_VERSION_NUMBER) const
 Serializes the spatial vector using the provided serializer.
 
void unserialize (SBCSerializer *serializer, const SBVersionNumber &sdkVersionNumber=SB_SDK_VERSION_NUMBER)
 Unserializes the spatial vector using the provided serializer.
 

Accessors

SBDTypePhysicalVector6< SBQuantity::dimensionless, SBQuantity::dimensionlessgetValue () 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] and array[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] and array[5] (angular, then linear)
 
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.
 

Operators

SBDTypePhysicalVector6< QuantityA, QuantityL > & operator= (const SBDTypePhysicalVector6< QuantityA, QuantityL > &u)
 Copy assignment.
 
template<typename QuantityAB , typename QuantityLB >
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.
 
template<typename QuantityAB , typename QuantityLB >
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.
 
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) const
 Returns the difference of this spatial vector with spatial vector u.
 
template<typename QuantityB >
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.
 
template<typename Quantity >
SBDTypePhysicalVector6< QuantityA, QuantityL > & operator*= (const Quantity &d)
 Multiplies this spatial vector with physical quantity d.
 
template<typename QuantityAB , typename QuantityLB >
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.
 
template<typename QuantityB >
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.
 
template<typename Quantity >
SBDTypePhysicalVector6< QuantityA, QuantityL > & operator/= (Quantity d)
 Divides this spatial vector by physical quantity d.
 
SBDTypePhysicalVector6< QuantityA, QuantityL > operator- () const
 Returns the opposite of this spatial vector.
 
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)
 Subtracts spatial vector u from this spatial vector.
 
template<typename QuantityAB , typename QuantityLB >
 operator SBDTypePhysicalVector6< QuantityAB, QuantityLB > () const
 Converts this spatial vector to a spatial vector with units QuantityB.
 
template<typename QuantityAB , typename QuantityLB >
bool operator== (const SBDTypePhysicalVector6< QuantityAB, QuantityLB > &u) const
 Returns true if this spatial vector is equal to spatial vector u (component-wise)
 
template<typename QuantityAB , typename QuantityLB >
bool operator!= (const SBDTypePhysicalVector6< QuantityAB, QuantityLB > &u) const
 Returns true if this spatial vector is different from spatial vector u (component-wise)
 
template<typename QuantityAB , typename QuantityLB >
bool operator< (const SBDTypePhysicalVector6< QuantityAB, QuantityLB > &u) const
 Returns true if this spatial vector is smaller than spatial vector u (lexicographic comparison)
 
template<typename QuantityAB , typename QuantityLB >
bool operator> (const SBDTypePhysicalVector6< QuantityAB, QuantityLB > &u) const
 Returns true if this spatial vector is larger than spatial vector u (lexicographic comparison)
 
template<typename QuantityAB , typename QuantityLB >
bool operator<= (const SBDTypePhysicalVector6< QuantityAB, QuantityLB > &u) const
 Returns true if this spatial vector is smaller or equal than spatial vector u (lexicographic comparison)
 
template<typename QuantityAB , typename QuantityLB >
bool operator>= (const SBDTypePhysicalVector6< QuantityAB, QuantityLB > &u) const
 Returns true if this spatial vector is larger or equal than spatial vector u (lexicographic comparison)
 

Detailed Description

template<typename QuantityA, typename QuantityL>
class SBDTypePhysicalVector6< QuantityA, QuantityL >
Template Parameters
QuantityAThe quantity type of the angular part
QuantityLThe 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
SAMSON's unit system

Member Function Documentation

◆ motionCrossForce()

template<typename QuantityA , typename QuantityL >
template<typename QuantityAB , typename QuantityLB >
void SBDTypePhysicalVector6< QuantityA, QuantityL >::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
inline
Parameters
forceThe force
vxfThe 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.

◆ operator*()

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

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.

◆ operator*=()

template<typename QuantityA , typename QuantityL >
template<typename Quantity >
SBDTypePhysicalVector6< QuantityA, QuantityL > & SBDTypePhysicalVector6< QuantityA, QuantityL >::operator*= ( const Quantity &  d)
inline
Parameters
dA dimensionless physical quantity or a numeric type (i.e. int, float, double, etc)

◆ operator/=()

template<typename QuantityA , typename QuantityL >
template<typename Quantity >
SBDTypePhysicalVector6< QuantityA, QuantityL > & SBDTypePhysicalVector6< QuantityA, QuantityL >::operator/= ( Quantity  d)
inline
Parameters
dA dimensionless physical quantity or a numeric type (i.e. int, float, double, etc)

◆ updateLowerUpper()

template<typename QuantityA , typename QuantityL >
template<typename QuantityALower , typename QuantityAUpper , typename QuantityLLower , typename QuantityLUpper >
void SBDTypePhysicalVector6< QuantityA, QuantityL >::updateLowerUpper ( SBDTypePhysicalVector6< QuantityALower, QuantityLLower > &  lower,
SBDTypePhysicalVector6< QuantityAUpper, QuantityLUpper > &  upper 
) const
inline
Parameters
lowerThe lower bound
upperThe upper bound

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