18 #ifndef BT_SPATIAL_ALGEBRA_H 19 #define BT_SPATIAL_ALGEBRA_H 104 template<
typename SpatialVectorType>
105 void cross(
const SpatialVectorType &b, SpatialVectorType &out)
const 110 template<
typename SpatialVectorType>
111 SpatialVectorType
cross(
const SpatialVectorType &b)
const 113 SpatialVectorType out;
177 template<
typename SpatialVectorType>
179 SpatialVectorType &outVec,
184 outVec.m_topVec =
m_rotMat * inVec.m_topVec;
187 else if(outOp ==
Add)
189 outVec.m_topVec +=
m_rotMat * inVec.m_topVec;
194 outVec.m_topVec -=
m_rotMat * inVec.m_topVec;
200 template<
typename SpatialVectorType>
202 SpatialVectorType &outVec,
207 outVec.m_topVec =
m_rotMat * inVec.m_topVec;
208 outVec.m_bottomVec =
m_rotMat * inVec.m_bottomVec;
210 else if(outOp ==
Add)
212 outVec.m_topVec +=
m_rotMat * inVec.m_topVec;
213 outVec.m_bottomVec +=
m_rotMat * inVec.m_bottomVec;
217 outVec.m_topVec -=
m_rotMat * inVec.m_topVec;
218 outVec.m_bottomVec -=
m_rotMat * inVec.m_bottomVec;
223 template<
typename SpatialVectorType>
225 SpatialVectorType &outVec,
233 else if(outOp ==
Add)
245 template<
typename SpatialVectorType>
247 SpatialVectorType &outVec,
255 else if(outOp ==
Add)
283 else if(outOp ==
Add)
297 template<
typename SpatialVectorType>
300 SpatialVectorType out;
306 template<
typename SpatialVectorType>
317 template<
typename SpatialVectorType>
330 #endif //BT_SPATIAL_ALGEBRA_H
btSpatialForceVector & operator+=(const btSpatialForceVector &vec)
void setValue(const btScalar &_x, const btScalar &_y, const btScalar &_z)
const btVector3 & getLinear() const
These spatial algebra classes are used for btMultiBody, see BulletDynamics/Featherstone.
btSymmetricSpatialDyad & operator -=(const btSymmetricSpatialDyad &mat)
void setValue(const btScalar &ax, const btScalar &ay, const btScalar &az, const btScalar &lx, const btScalar &ly, const btScalar &lz)
btSpatialMotionVector & operator -=(const btSpatialMotionVector &vec)
void addValue(const btScalar &ax, const btScalar &ay, const btScalar &az, const btScalar &lx, const btScalar &ly, const btScalar &lz)
btSpatialForceVector(const btVector3 &angular, const btVector3 &linear)
btSpatialMotionVector operator+(const btSpatialMotionVector &vec) const
btSpatialForceVector operator *(const btScalar &s) const
btSpatialForceVector operator *(const btSpatialMotionVector &vec)
void addLinear(const btVector3 &linear)
void symmetricSpatialOuterProduct(const SpatialVectorType &a, const SpatialVectorType &b, btSymmetricSpatialDyad &out)
btMatrix3x3 outerProduct(const btVector3 &v0, const btVector3 &v1)
btSpatialMotionVector & operator *=(const btScalar &s)
void addLinear(const btVector3 &linear)
btMatrix3x3 transpose() const
Return the transpose of the matrix.
void setValue(const btScalar &ax, const btScalar &ay, const btScalar &az, const btScalar &lx, const btScalar &ly, const btScalar &lz)
void addAngular(const btVector3 &angular)
void addValue(const btScalar &ax, const btScalar &ay, const btScalar &az, const btScalar &lx, const btScalar &ly, const btScalar &lz)
const btVector3 & getLinear() const
void setVector(const btVector3 &angular, const btVector3 &linear)
const btVector3 & getAngular() const
btVector3 cross(const btVector3 &v) const
Return the cross product between this and another vector.
btScalar dot(const btVector3 &v) const
Return the dot product.
btSpatialMotionVector operator *(const btScalar &s) const
void setLinear(const btVector3 &linear)
btSpatialForceVector operator+(const btSpatialForceVector &vec) const
void setAngular(const btVector3 &angular)
void setAngular(const btVector3 &angular)
btVector3 can be used to represent 3D points and vectors.
btSpatialForceVector(const btScalar &ax, const btScalar &ay, const btScalar &az, const btScalar &lx, const btScalar &ly, const btScalar &lz)
void cross(const SpatialVectorType &b, SpatialVectorType &out) const
void setMatrix(const btMatrix3x3 &topLeftMat, const btMatrix3x3 &topRightMat, const btMatrix3x3 &bottomLeftMat)
btScalar dot(const btSpatialForceVector &b) const
SpatialVectorType cross(const SpatialVectorType &b) const
const btVector3 & getAngular() const
btMatrix3x3 m_bottomLeftMat
btSpatialMotionVector operator -() const
void setVector(const btVector3 &angular, const btVector3 &linear)
btSpatialForceVector operator -() const
The btMatrix3x3 class implements a 3x3 rotation matrix, to perform linear algebra in combination with...
void addVector(const btVector3 &angular, const btVector3 &linear)
btSpatialMotionVector & operator+=(const btSpatialMotionVector &vec)
void addVector(const btVector3 &angular, const btVector3 &linear)
btSymmetricSpatialDyad(const btMatrix3x3 &topLeftMat, const btMatrix3x3 &topRightMat, const btMatrix3x3 &bottomLeftMat)
btSpatialForceVector & operator -=(const btSpatialForceVector &vec)
void addAngular(const btVector3 &angular)
void addMatrix(const btMatrix3x3 &topLeftMat, const btMatrix3x3 &topRightMat, const btMatrix3x3 &bottomLeftMat)
void setLinear(const btVector3 &linear)
void setIdentity()
Set the matrix to the identity.
float btScalar
The btScalar type abstracts floating point numbers, to easily switch between double and single floati...
btMatrix3x3 m_topRightMat
btSpatialMotionVector(const btVector3 &angular, const btVector3 &linear)