Part: Add midpoint attachement mode
This adds midpoint attachement mode to Attacher. It works just like method for finding placement of JCS in Assembly.
This commit is contained in:
@@ -81,6 +81,12 @@ Rotation::Rotation(const Vector3d& rotateFrom, const Vector3d& rotateTo)
|
||||
this->setValue(rotateFrom, rotateTo);
|
||||
}
|
||||
|
||||
Rotation Rotation::fromNormalVector(const Vector3d& normal)
|
||||
{
|
||||
// We rotate Z axis to be aligned with the supplied normal vector
|
||||
return Rotation(Vector3d(0, 0, 1), normal);
|
||||
}
|
||||
|
||||
const double* Rotation::getValue() const
|
||||
{
|
||||
return &this->quat[0];
|
||||
|
||||
@@ -49,6 +49,9 @@ public:
|
||||
Rotation(const Rotation& rot) = default;
|
||||
Rotation(Rotation&& rot) = default;
|
||||
~Rotation() = default;
|
||||
|
||||
/// Utility function to create Rotation based on direction / normal vector
|
||||
static Rotation fromNormalVector(const Vector3d& normal);
|
||||
//@}
|
||||
|
||||
/** Methods to get or set rotations. */
|
||||
|
||||
Reference in New Issue
Block a user