mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 11:45:36 +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() {
|
||||
btHingeConstraint* constraint { nullptr };
|
||||
glm::vec3 axisInA;
|
||||
float low;
|
||||
float high;
|
||||
float softness;
|
||||
|
@ -113,6 +114,7 @@ void ObjectConstraintHinge::updateHinge() {
|
|||
float maxImpulse;
|
||||
|
||||
withReadLock([&]{
|
||||
axisInA = _axisInA;
|
||||
constraint = static_cast<btHingeConstraint*>(_constraint);
|
||||
low = _low;
|
||||
high = _high;
|
||||
|
@ -132,6 +134,9 @@ void ObjectConstraintHinge::updateHinge() {
|
|||
if (!constraint) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto bulletAxisInA = glmToBullet(axisInA);
|
||||
constraint->setAxis(bulletAxisInA);
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue