Public Member Functions | Private Member Functions | List of all members
SurgSim::Physics::RigidConstraintFixedRotationVector Class Reference

RigidRepresentationBase fixed rotation vector constraint. More...

#include <SurgSim/Physics/RigidConstraintFixedRotationVector.h>

Inheritance diagram for SurgSim::Physics::RigidConstraintFixedRotationVector:
SurgSim::Physics::ConstraintImplementation

Public Member Functions

 RigidConstraintFixedRotationVector ()
 Constructor. More...
 
virtual ~RigidConstraintFixedRotationVector ()
 Destructor. More...
 
SurgSim::Physics::ConstraintType getConstraintType () const override
 Gets the constraint type for this ConstraintImplementation. More...
 
- Public Member Functions inherited from SurgSim::Physics::ConstraintImplementation
 ConstraintImplementation ()
 Constructor. More...
 
virtual ~ConstraintImplementation ()
 Destructor. More...
 
size_t getNumDof () const
 Gets the number of degree of freedom for this implementation. More...
 
void build (double dt, const ConstraintData &data, const std::shared_ptr< Localization > &localization, MlcpPhysicsProblem *mlcp, size_t indexOfRepresentation, size_t indexOfConstraint, ConstraintSideSign sign)
 Builds the subset of an Mlcp physics problem associated to this implementation. More...
 

Private Member Functions

size_t doGetNumDof () const override
 Does get number of degree of freedom. More...
 
void doBuild (double dt, const ConstraintData &data, const std::shared_ptr< Localization > &localization, MlcpPhysicsProblem *mlcp, size_t indexOfRepresentation, size_t indexOfConstraint, ConstraintSideSign sign) override
 

Additional Inherited Members

- Static Public Member Functions inherited from SurgSim::Physics::ConstraintImplementation
static ConstraintImplementationFactorygetFactory ()
 
- Protected Attributes inherited from SurgSim::Physics::ConstraintImplementation
Eigen::SparseVector< double, Eigen::RowMajor, ptrdiff_t > m_newH
 Preallocated variable for derived implementations of doBuild. More...
 

Detailed Description

RigidRepresentationBase fixed rotation vector constraint.

This implementation simply fixes the rotational dof of the constraint, effectively controlling the other representation orientation.

Constructor & Destructor Documentation

§ RigidConstraintFixedRotationVector()

SurgSim::Physics::RigidConstraintFixedRotationVector::RigidConstraintFixedRotationVector ( )

Constructor.

§ ~RigidConstraintFixedRotationVector()

SurgSim::Physics::RigidConstraintFixedRotationVector::~RigidConstraintFixedRotationVector ( )
virtual

Destructor.

Member Function Documentation

§ doBuild()

void SurgSim::Physics::RigidConstraintFixedRotationVector::doBuild ( double  dt,
const ConstraintData data,
const std::shared_ptr< Localization > &  localization,
MlcpPhysicsProblem mlcp,
size_t  indexOfRepresentation,
size_t  indexOfConstraint,
ConstraintSideSign  sign 
)
overrideprivatevirtual
Note
This is only setting the mlcp->b violation to the rigid representation current rotation vector. It means that the rigid won't receive any forces back, it simply will control the other representation's orientation in this constraint.
The rotation vector constraint violation being calculated based on a quaternion interpolation (slerp), and this type of interpolation being highly non-linear, the classical way of using the implementation one after the other one won't work. Therefore, the RotationVectorConstraint will use the vector mlcp->b to retrieve both representation's rotation vector, then calculate the proper slerp and set the violation back in mlcp->b

Implements SurgSim::Physics::ConstraintImplementation.

§ doGetNumDof()

size_t SurgSim::Physics::RigidConstraintFixedRotationVector::doGetNumDof ( ) const
overrideprivatevirtual

Does get number of degree of freedom.

Returns
The number of degree of freedom associated to this implementation

Implements SurgSim::Physics::ConstraintImplementation.

§ getConstraintType()

SurgSim::Physics::ConstraintType SurgSim::Physics::RigidConstraintFixedRotationVector::getConstraintType ( ) const
overridevirtual

Gets the constraint type for this ConstraintImplementation.

Returns
The constraint type corresponding to this constraint implementation

Implements SurgSim::Physics::ConstraintImplementation.


The documentation for this class was generated from the following files: