29 lines
792 B
C++
29 lines
792 B
C++
#include "CylindricalJoint.h"
|
|
#include "System.h"
|
|
#include "DirectionCosineConstraintIJ.h"
|
|
#include "TranslationConstraintIJ.h"
|
|
#include "CREATE.h"
|
|
|
|
using namespace MbD;
|
|
|
|
CylindricalJoint::CylindricalJoint() {
|
|
}
|
|
|
|
CylindricalJoint::CylindricalJoint(const char* str) : Joint(str) {
|
|
}
|
|
|
|
void MbD::CylindricalJoint::initializeGlobally()
|
|
{
|
|
if (constraints->empty())
|
|
{
|
|
addConstraint(CREATE<TranslationConstraintIJ>::ConstraintWith(frmI, frmJ, 0));
|
|
addConstraint(CREATE<TranslationConstraintIJ>::ConstraintWith(frmI, frmJ, 1));
|
|
addConstraint(CREATE<DirectionCosineConstraintIJ>::ConstraintWith(frmI, frmJ, 2, 0));
|
|
addConstraint(CREATE<DirectionCosineConstraintIJ>::ConstraintWith(frmI, frmJ, 2, 1));
|
|
System::getInstance().hasChanged = true;
|
|
}
|
|
else {
|
|
Joint::initializeGlobally();
|
|
}
|
|
}
|