mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 04:37:23 +02:00
try to allow axisInA to be adjusted on the fly
This commit is contained in:
parent
25070c3bca
commit
f172730a38
1 changed files with 5 additions and 0 deletions
|
@ -102,6 +102,7 @@ void ObjectConstraintHinge::prepareForPhysicsSimulation() {
|
||||||
|
|
||||||
void ObjectConstraintHinge::updateHinge() {
|
void ObjectConstraintHinge::updateHinge() {
|
||||||
btHingeConstraint* constraint { nullptr };
|
btHingeConstraint* constraint { nullptr };
|
||||||
|
glm::vec3 axisInA;
|
||||||
float low;
|
float low;
|
||||||
float high;
|
float high;
|
||||||
float softness;
|
float softness;
|
||||||
|
@ -113,6 +114,7 @@ void ObjectConstraintHinge::updateHinge() {
|
||||||
float maxImpulse;
|
float maxImpulse;
|
||||||
|
|
||||||
withReadLock([&]{
|
withReadLock([&]{
|
||||||
|
axisInA = _axisInA;
|
||||||
constraint = static_cast<btHingeConstraint*>(_constraint);
|
constraint = static_cast<btHingeConstraint*>(_constraint);
|
||||||
low = _low;
|
low = _low;
|
||||||
high = _high;
|
high = _high;
|
||||||
|
@ -132,6 +134,9 @@ void ObjectConstraintHinge::updateHinge() {
|
||||||
if (!constraint) {
|
if (!constraint) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
auto bulletAxisInA = glmToBullet(axisInA);
|
||||||
|
constraint->setAxis(bulletAxisInA);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue