diff options
Diffstat (limited to 'modules/bullet/slider_joint_bullet.cpp')
-rw-r--r-- | modules/bullet/slider_joint_bullet.cpp | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/modules/bullet/slider_joint_bullet.cpp b/modules/bullet/slider_joint_bullet.cpp index f1d60679ec..cfcd0b57f6 100644 --- a/modules/bullet/slider_joint_bullet.cpp +++ b/modules/bullet/slider_joint_bullet.cpp @@ -37,11 +37,20 @@ SliderJointBullet::SliderJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB) : JointBullet() { + + Transform scaled_AFrame(frameInA.scaled(rbA->get_body_scale())); + scaled_AFrame.basis.rotref_posscale_decomposition(scaled_AFrame.basis); + btTransform btFrameA; - G_TO_B(frameInA, btFrameA); + G_TO_B(scaled_AFrame, btFrameA); + if (rbB) { + + Transform scaled_BFrame(frameInB.scaled(rbB->get_body_scale())); + scaled_BFrame.basis.rotref_posscale_decomposition(scaled_BFrame.basis); + btTransform btFrameB; - G_TO_B(frameInB, btFrameB); + G_TO_B(scaled_BFrame, btFrameB); sliderConstraint = bulletnew(btSliderConstraint(*rbA->get_bt_rigid_body(), *rbB->get_bt_rigid_body(), btFrameA, btFrameB, true)); } else { |