summaryrefslogtreecommitdiffstats
path: root/modules/bullet/slider_joint_bullet.cpp
diff options
context:
space:
mode:
authorAndreaCatania <info@andreacatania.com>2017-12-09 01:22:36 +0100
committerAndreaCatania <info@andreacatania.com>2017-12-09 01:22:36 +0100
commit32408f3bfd60aa382a38e3f37fd56bda1dd428ed (patch)
treeffc9b12906623bf1fd6ccf539630475cabe62291 /modules/bullet/slider_joint_bullet.cpp
parent5cfc98cace7d40bc36bb8ebd381aa10de7586891 (diff)
downloadredot-engine-32408f3bfd60aa382a38e3f37fd56bda1dd428ed.tar.gz
Fixed joint scale
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 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 {