Implementation of Localization for MassSpringRepresentation.
More...
#include <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 either the ID of a node contained within the associated MassSpringRepresentation, or the barycentric coordinates of an element (1D, 2D, or 3D) in that MassSpringRepresentation, and it provides a helper function MassSpringLocalization::calculatePosition to find the position in global coordinates in the current state.
§ MassSpringLocalization()
SurgSim::Physics::MassSpringLocalization::MassSpringLocalization |
( |
std::shared_ptr< Representation > |
representation | ) |
|
|
explicit |
Constructor.
- Parameters
-
representation | The representation to assign to this localization. |
§ doCopy()
std::shared_ptr< Localization > SurgSim::Physics::MassSpringLocalization::doCopy |
( |
| ) |
const |
|
overridevirtual |
§ getLocalNode()
Gets the local node.
- Returns
- Node set for this localization.
§ getLocalPosition()
Gets the local position.
- Returns
- The local position set for this localization.
§ isValidRepresentation()
bool SurgSim::Physics::MassSpringLocalization::isValidRepresentation |
( |
std::shared_ptr< Representation > |
representation | ) |
|
|
overridevirtual |
§ moveClosestTo()
bool SurgSim::Physics::MassSpringLocalization::moveClosestTo |
( |
const Math::Vector3d & |
point, |
|
|
bool * |
hasReachedEnd |
|
) |
| |
|
overridevirtual |
- Parameters
-
point | Move this localization closest to this point |
hasReachedEnd | [out] Flag to set, when the localization reaches the end of the representation. |
- Returns
- Whether the localization was moved or not.
Reimplemented from SurgSim::Physics::Localization.
§ setLocalNode()
void SurgSim::Physics::MassSpringLocalization::setLocalNode |
( |
size_t |
nodeID | ) |
|
Sets the local node.
- Parameters
-
nodeID | Node set for this localization. |
§ setLocalPosition()
Sets the local position.
- Parameters
-
localPosition | The local position to set the localization at. |
The documentation for this class was generated from the following files: