Implementation of Localization for MassSpringRepresentation.
More...
#include <SurgSim/Physics/MassSpringRepresentationLocalization.h>
Implementation of Localization for MassSpringRepresentation.
MassSpringRepresentationLocalization 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.
MassSpringRepresentationLocalization 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 MassSpringRepresentationLocalization::calculatePosition to find the node's position in global coordinates in the current state.
SurgSim::Physics::MassSpringRepresentationLocalization::MassSpringRepresentationLocalization |
( |
| ) |
|
SurgSim::Physics::MassSpringRepresentationLocalization::MassSpringRepresentationLocalization |
( |
std::shared_ptr< Representation > |
representation | ) |
|
|
explicit |
Constructor.
- Parameters
-
representation | The representation to assign to this localization. |
SurgSim::Physics::MassSpringRepresentationLocalization::~MassSpringRepresentationLocalization |
( |
| ) |
|
|
virtual |
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.
const size_t & SurgSim::Physics::MassSpringRepresentationLocalization::getLocalNode |
( |
| ) |
const |
Gets the local node.
- Returns
- Node set for this localization.
bool SurgSim::Physics::MassSpringRepresentationLocalization::isValidRepresentation |
( |
std::shared_ptr< Representation > |
representation | ) |
|
|
overridevirtual |
void SurgSim::Physics::MassSpringRepresentationLocalization::setLocalNode |
( |
size_t |
nodeID | ) |
|
Sets the local node.
- Parameters
-
nodeID | Node set for this localization. |
size_t SurgSim::Physics::MassSpringRepresentationLocalization::m_nodeID |
|
private |
Node defining the localization.
The documentation for this class was generated from the following files: