summaryrefslogtreecommitdiff
path: root/modules/bullet/slider_joint_bullet.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'modules/bullet/slider_joint_bullet.cpp')
-rw-r--r--modules/bullet/slider_joint_bullet.cpp17
1 files changed, 13 insertions, 4 deletions
diff --git a/modules/bullet/slider_joint_bullet.cpp b/modules/bullet/slider_joint_bullet.cpp
index 2da65677f5..cfcd0b57f6 100644
--- a/modules/bullet/slider_joint_bullet.cpp
+++ b/modules/bullet/slider_joint_bullet.cpp
@@ -35,13 +35,22 @@
#include "bullet_utilities.h"
#include "rigid_body_bullet.h"
-SliderJointBullet::SliderJointBullet(RigidBodyBullet *rbA, RigidBodyBullet *rbB, const Transform &frameInA, const Transform &frameInB)
- : JointBullet() {
+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 {