Position motor does not reach target angle

Hey there,

I am making a motorized hinge mechanism with Havok and I am trying to use PhysicsConstraintMotorType.POSITION:

However I don’t understand what is happening when I use setAxisMotorTarget: the hinge does not want to rotate outside of a small angle domain, even when asked to do full turns :thinking:

Any idea what I am doing wrong here?

cc @Cedric

1 Like

Hi @CrashMaster , not really familiar with Havok, but this seems to work (full turns) :

motorJoint.setAxisMotorType(BABYLON.PhysicsConstraintAxis.ANGULAR_Y, BABYLON.PhysicsConstraintMotorType.VELOCITY);

1 Like

This one changes the speed of the motor instead of setting a target angle, which would require more logic to control the target angle. It can become a workaround if the position motor can’t work for me :+1:

I tried to set limits but I could not get what I wanted. I guess I’m missing something here https://playground.babylonjs.com/?inspectorv2=true#5KKGOT#21

Any idea @eoin ?

1 Like

Interestingly, it only works when using the Z axis for the motor :thinking:

X axis and Y axis both have limited motion

2 Likes

What a spooky bug. Have a fix, just running through verification. Thanks for the report; it’ll be fixed in the next WASM update.

4 Likes

Thank you for looking into it :slight_smile: Looking forward to the next version!

When can we expect the next wasm update :eyes: ? I see there is a PR on the havok repo:

cc @docEdub

2 Likes

Looks like it has been merged and released :ok_hand: Thanks a lot!

1 Like