Implementation of Localization for MassSpringRepresentation.
More...
#include <SurgSim/Physics/MassSpringLocalization.h>
Implementation of Localization for MassSpringRepresentation.
MassSpringLocalization tracks the global coordinates of a node contained in an associated MassSpringRepresentation. It is used, for example, as a helper class for filling out the MlcpPhysicsProblem in MassSpringRepresentationContact::doBuild, which constrains the motion of MassSpringRepresentation at a frictionless contact.
MassSpringLocalization stores a pointer to a MassSpringRepresentation in an abstract Representation object. It tracks the ID of a node contained within the associated MassSpringRepresentation, and it provides a helper function MassSpringLocalization::calculatePosition to find the node's position in global coordinates in the current state.
◆ MassSpringLocalization() [1/2]
SurgSim::Physics::MassSpringLocalization::MassSpringLocalization |
( |
| ) |
|
◆ MassSpringLocalization() [2/2]
SurgSim::Physics::MassSpringLocalization::MassSpringLocalization |
( |
std::shared_ptr< Representation > |
representation | ) |
|
|
explicit |
Constructor.
- Parameters
-
representation | The representation to assign to this localization. |
◆ ~MassSpringLocalization()
SurgSim::Physics::MassSpringLocalization::~MassSpringLocalization |
( |
| ) |
|
|
virtual |
◆ doCalculatePosition()
Calculates the global position of this localization.
- Parameters
-
time | Interpolation parameter [0..1] for calcuting position between the previous state (0.0) and current state (1.0). |
- Returns
- The global position of the localization using an interpolation between the previous and current states.
- Note
- The time parameter can useful when dealing with Continuous Collision Detection.
Implements SurgSim::Physics::Localization.
◆ doCalculateVelocity()
Calculates the global velocity of this localization.
- Parameters
-
time | The time in [0..1] at which the velocity should be calculated |
- Returns
- The global velocity of the localization at the requested time
- Note
- time can useful when dealing with CCD
Implements SurgSim::Physics::Localization.
◆ getLocalNode()
const size_t & SurgSim::Physics::MassSpringLocalization::getLocalNode |
( |
| ) |
const |
Gets the local node.
- Returns
- Node set for this localization.
◆ isValidRepresentation()
bool SurgSim::Physics::MassSpringLocalization::isValidRepresentation |
( |
std::shared_ptr< Representation > |
representation | ) |
|
|
overridevirtual |
◆ setLocalNode()
void SurgSim::Physics::MassSpringLocalization::setLocalNode |
( |
size_t |
nodeID | ) |
|
Sets the local node.
- Parameters
-
nodeID | Node set for this localization. |
◆ m_nodeID
size_t SurgSim::Physics::MassSpringLocalization::m_nodeID |
|
private |
Node defining the localization.
The documentation for this class was generated from the following files: