Commit 2bb30778 authored by Inge Wallin's avatar Inge Wallin

Move code from world.cc to joint.cc that we forgot before.

parent 56c06d8b
0. Urgent / Important
* Go through all the STEPCORE_META_OBJECT calls and see how they need to be
changed after the big refactor.
- This means actually understanding STEPCORE_META_OBJECT, which seems to be
undocumented...
1. StepCore.
* implement compile flags:
......
......@@ -27,4 +27,48 @@ STEPCORE_META_OBJECT(Joint, QT_TRANSLATE_NOOP("ObjectClass", "Joint"), QT_TR_NOO
MetaObject::ABSTRACT,,)
void ConstraintsInfo::setDimension(int newVariablesCount, int newConstraintsCount, int newContactsCount)
{
// std::cerr << " ConstraintsInfo::setDimension("
// << newVariablesCount <<","<< newConstraintsCount <<"," << newContactsCount << ")\n";
int totalConstraintsCount = newConstraintsCount+newContactsCount;
jacobian.resize(totalConstraintsCount, newVariablesCount);
jacobianDerivative.resize(totalConstraintsCount, newVariablesCount);
inverseMass.resize(newVariablesCount);
force.resize(newVariablesCount);
value.resize(totalConstraintsCount);
derivative.resize(totalConstraintsCount);
if (totalConstraintsCount>0)
{
derivative.setZero();
value.setZero();
}
forceMin.resize(totalConstraintsCount);
forceMax.resize(totalConstraintsCount);
contactsCount = newContactsCount;
constraintsCount = newConstraintsCount;
variablesCount = newVariablesCount;
}
void ConstraintsInfo::clear()
{
jacobian.setZero();
jacobianDerivative.setZero();
if(inverseMass.size()>0)
{
inverseMass.setZero();
}
if(forceMin.size()>0)
{
forceMin.fill(-HUGE_VAL);
forceMax.fill(HUGE_VAL);
}
collisionFlag = false;
}
} // namespace StepCore
......@@ -37,49 +37,6 @@ STEPCORE_META_OBJECT(World, QT_TRANSLATE_NOOP("ObjectClass", "World"), QT_TR_NOO
STEPCORE_PROPERTY_RW (bool, errorsCalculation, QT_TR_NOOP("errorsCalculation"), STEPCORE_UNITS_NULL,
QT_TR_NOOP("Enable global error calculation"), errorsCalculation, setErrorsCalculation))
void ConstraintsInfo::setDimension(int newVariablesCount, int newConstraintsCount, int newContactsCount)
{
// std::cerr << " ConstraintsInfo::setDimension("
// << newVariablesCount <<","<< newConstraintsCount <<"," << newContactsCount << ")\n";
int totalConstraintsCount = newConstraintsCount+newContactsCount;
jacobian.resize(totalConstraintsCount, newVariablesCount);
jacobianDerivative.resize(totalConstraintsCount, newVariablesCount);
inverseMass.resize(newVariablesCount);
force.resize(newVariablesCount);
value.resize(totalConstraintsCount);
derivative.resize(totalConstraintsCount);
if (totalConstraintsCount>0)
{
derivative.setZero();
value.setZero();
}
forceMin.resize(totalConstraintsCount);
forceMax.resize(totalConstraintsCount);
contactsCount = newContactsCount;
constraintsCount = newConstraintsCount;
variablesCount = newVariablesCount;
}
void ConstraintsInfo::clear()
{
jacobian.setZero();
jacobianDerivative.setZero();
if(inverseMass.size()>0)
{
inverseMass.setZero();
}
if(forceMin.size()>0)
{
forceMin.fill(-HUGE_VAL);
forceMax.fill(HUGE_VAL);
}
collisionFlag = false;
}
World::World()
: _time(0), _timeScale(1), _errorsCalculation(false),
_solver(NULL), _collisionSolver(NULL), _constraintSolver(NULL),
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment