Warning, file /education/step/stepcore/joint.cc was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*
0002     SPDX-FileCopyrightText: 2007 Vladimir Kuznetsov <ks.vladimir@gmail.com>
0003     SPDX-FileCopyrightText: 2014 Inge Wallin <inge@lysator.liu.se>
0004 
0005     SPDX-License-Identifier: GPL-2.0-or-later
0006 */
0007 
0008 #include "joint.h"
0009 
0010 
0011 namespace StepCore
0012 {
0013 
0014 STEPCORE_META_OBJECT(Joint, QT_TRANSLATE_NOOP("ObjectClass", "Joint"), QT_TRANSLATE_NOOP("ObjectDescription", "Joint"),
0015              MetaObject::ABSTRACT,,)
0016 
0017 
0018 void ConstraintsInfo::setDimension(int newVariablesCount, int newConstraintsCount, int newContactsCount)
0019 {
0020 //     std::cerr << "   ConstraintsInfo::setDimension("
0021 //       << newVariablesCount <<","<< newConstraintsCount <<"," << newContactsCount << ")\n";
0022     
0023     int totalConstraintsCount = newConstraintsCount+newContactsCount;
0024 
0025     jacobian.resize(totalConstraintsCount, newVariablesCount);
0026     jacobianDerivative.resize(totalConstraintsCount, newVariablesCount);
0027     inverseMass.resize(newVariablesCount);
0028     force.resize(newVariablesCount);
0029     value.resize(totalConstraintsCount);
0030     derivative.resize(totalConstraintsCount);
0031     if (totalConstraintsCount>0)
0032     {
0033       derivative.setZero();
0034       value.setZero();
0035     }
0036     forceMin.resize(totalConstraintsCount);
0037     forceMax.resize(totalConstraintsCount);
0038     
0039     contactsCount = newContactsCount;
0040     constraintsCount = newConstraintsCount;
0041     variablesCount = newVariablesCount;
0042 }
0043 
0044 void ConstraintsInfo::clear()
0045 {
0046     jacobian.setZero();
0047     jacobianDerivative.setZero();
0048     if(inverseMass.size()>0)
0049     {
0050       inverseMass.setZero();
0051     }
0052     if(forceMin.size()>0)
0053     {
0054       forceMin.fill(-HUGE_VAL);
0055       forceMax.fill(HUGE_VAL);
0056     }
0057 
0058     collisionFlag = false;
0059 }
0060 
0061 } // namespace StepCore