38 lines
1.2 KiB
C++
38 lines
1.2 KiB
C++
/***************************************************************************
|
|
* Copyright (c) 2023 Ondsel, Inc. *
|
|
* *
|
|
* This file is part of OndselSolver. *
|
|
* *
|
|
* See LICENSE file for details about copyright. *
|
|
***************************************************************************/
|
|
|
|
#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) : InLineJoint(str)
|
|
{
|
|
}
|
|
|
|
void CylindricalJoint::initializeGlobally()
|
|
{
|
|
if (constraints->empty())
|
|
{
|
|
createInLineConstraints();
|
|
addConstraint(CREATE<DirectionCosineConstraintIJ>::ConstraintWith(frmI, frmJ, 2, 0));
|
|
addConstraint(CREATE<DirectionCosineConstraintIJ>::ConstraintWith(frmI, frmJ, 2, 1));
|
|
this->root()->hasChanged = true;
|
|
}
|
|
else {
|
|
InLineJoint::initializeGlobally();
|
|
}
|
|
}
|