@@ -185,7 +185,8 @@ void renderUniversalJoint(UniversalJoint &uj)
185185
186186void renderSliderJoint (SliderJoint &joint)
187187{
188- MiniGL::drawCylinder (joint.m_jointInfo .col (7 ) - joint.m_jointInfo .col (11 ), joint.m_jointInfo .col (7 ) + joint.m_jointInfo .col (11 ), jointColor, 0 .05f );
188+ MiniGL::drawSphere (joint.m_jointInfo .col (6 ), 0 .1f , jointColor);
189+ MiniGL::drawCylinder (joint.m_jointInfo .col (7 ) - joint.m_jointInfo .col (8 ), joint.m_jointInfo .col (7 ) + joint.m_jointInfo .col (8 ), jointColor, 0 .05f );
189190}
190191
191192void renderTargetAngleMotorHingeJoint (TargetAngleMotorHingeJoint &hj)
@@ -313,9 +314,9 @@ void createBodyModel()
313314 Eigen::Quaternionf (1 .0f , 0 .0f , 0 .0f , 0 .0f ));
314315
315316 // dynamic body
316- rb[3 *i+ 2 ] = new RigidBody ();
317- rb[3 *i+ 2 ]->initBody (1 .0f ,
318- Eigen::Vector3f (startX, startY- 0 .25f , 4 .0f ),
317+ rb[3 * i + 2 ] = new RigidBody ();
318+ rb[3 * i + 2 ]->initBody (1 .0f ,
319+ Eigen::Vector3f (startX, startY - 0 .25f , 4 .0f ),
319320 computeInertiaTensorBox (1 .0f , width, height, depth),
320321 Eigen::Quaternionf (1 .0f , 0 .0f , 0 .0f , 0 .0f ));
321322
@@ -346,7 +347,7 @@ void createBodyModel()
346347 ((TargetAngleMotorHingeJoint*)model.getConstraints ()[model.getConstraints ().size () - 1 ])->setMaxAngularMomentumPerStep (0 .5f );
347348 model.addTargetVelocityMotorHingeJoint (13 , 14 , Eigen::Vector3f (0 .0f , jointY, 3 .0f ), Eigen::Vector3f (0 .0f , 1 .0f , 0 .0f ));
348349 ((TargetVelocityMotorHingeJoint*)model.getConstraints ()[model.getConstraints ().size () - 1 ])->setMaxAngularMomentumPerStep (25 .0f );
349-
350+
350351 model.addSliderJoint (15 , 16 , Eigen::Vector3f (4 .0f , jointY, 1 .0f ), Eigen::Vector3f (1 .0f , 0 .0f , 0 .0f ));
351352 model.addBallJoint (16 , 17 , Eigen::Vector3f (4 .25f , jointY, 3 .0f ));
352353}
0 commit comments