aboutsummaryrefslogtreecommitdiff
path: root/modules/bullet/slider_joint_bullet.cpp
diff options
context:
space:
mode:
authorRémi Verschelde2017-12-11 10:35:09 +0100
committerGitHub2017-12-11 10:35:09 +0100
commitdfb3634c3462adb3d9f0bf1e2e7b4261c3313b80 (patch)
tree5686d27865e80aab6d60abc2e8e34fc2138a38a9 /modules/bullet/slider_joint_bullet.cpp
parent237be766d4b0247d7ded0a9b85da12a989c561c8 (diff)
parentb546cd50a36a809ba8beb8da1126d41c3b19294b (diff)
downloadgodot-dfb3634c3462adb3d9f0bf1e2e7b4261c3313b80.tar.gz
godot-dfb3634c3462adb3d9f0bf1e2e7b4261c3313b80.tar.zst
godot-dfb3634c3462adb3d9f0bf1e2e7b4261c3313b80.zip
Merge pull request #13836 from AndreaCatania/scale
Fixed bullet scale on get_transform and joints
Diffstat (limited to 'modules/bullet/slider_joint_bullet.cpp')
-rw-r--r--modules/bullet/slider_joint_bullet.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/modules/bullet/slider_joint_bullet.cpp b/modules/bullet/slider_joint_bullet.cpp
index f1d60679e..cfcd0b57f 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 {