Skip to content

Commit 274b394

Browse files
maxime-tournierhtalbot
authored andcommitted
FIX: wrong quaternion multiplication order in
MechanicalObject::applyRotation for rigid types. (closes https://www.sofa-framework.org/forum/topic/error-in-rigidrigidmapping-v15-09/) Former-commit-id: 25eaf8a5eea5041bc2dbb03e5f9ccfe9ba67000c
1 parent 51be4cc commit 274b394

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

modules/SofaBaseMechanics/MechanicalObject.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ void MechanicalObject<defaulttype::Rigid3dTypes>::applyRotation (const defaultty
132132
for (unsigned int i = 0; i < x.size(); i++)
133133
{
134134
x[i].getCenter() = q.rotate(x[i].getCenter());
135-
x[i].getOrientation() *= q;
135+
x[i].getOrientation() = q * x[i].getOrientation();
136136
}
137137
}
138138

@@ -394,7 +394,7 @@ void MechanicalObject<defaulttype::Rigid3fTypes>::applyRotation (const defaultty
394394
for (unsigned int i = 0; i < x.size(); i++)
395395
{
396396
x[i].getCenter() = q.rotate(x[i].getCenter());
397-
x[i].getOrientation() *= q;
397+
x[i].getOrientation() = q * x[i].getOrientation();
398398
}
399399
}
400400

0 commit comments

Comments
 (0)