Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Education
Step
Commits
2bb30778
Commit
2bb30778
authored
Dec 20, 2014
by
Inge Wallin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move code from world.cc to joint.cc that we forgot before.
parent
56c06d8b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
51 additions
and
43 deletions
+51
-43
TODO
TODO
+7
-0
stepcore/joint.cc
stepcore/joint.cc
+44
-0
stepcore/world.cc
stepcore/world.cc
+0
-43
No files found.
TODO
View file @
2bb30778
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:
...
...
stepcore/joint.cc
View file @
2bb30778
...
...
@@ -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
stepcore/world.cc
View file @
2bb30778
...
...
@@ -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
),
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment