Soft Distance joint

Hi guys,

I was planning to make a soft distance joint between to dynamic bodies (in AS3), but it doesn't show any signs of elasticity, here's my code:

Code:
...
djd.frequencyHz = 4;
djd.dampingRatio = 0.4;
djd.collideConnected = true;

djd.Initialize(wheel01, wheel02, wheel01.GetPosition(), wheel02.GetPosition());
m_world.CreateJoint(djd);
...

*where djd is my joint definition

The joint works fine but it doesn't look like a spring at all, it doesn't act like a soft distance joint.
I'm new to this, what did I do wrong?? 😕

Thanks in advance
Are the bodies colliding?
nope... they can't touch eachother, because there's no elasticity at all 🙁

this my source:

Code:
package
{
   import Box2D.Collision.Shapes.b2CircleShape;
   import Box2D.Collision.Shapes.b2PolygonShape;
   import Box2D.Common.Math.b2Vec2;
   import Box2D.Dynamics.b2Body;
   import Box2D.Dynamics.b2BodyDef;
   import Box2D.Dynamics.b2DebugDraw;
   import Box2D.Dynamics.b2FixtureDef;
   import Box2D.Dynamics.b2World;
   import Box2D.Dynamics.Joints.b2DistanceJointDef;
   import Box2D.Dynamics.Joints.b2PrismaticJoint;
   import Box2D.Dynamics.Joints.b2PrismaticJointDef;
   import Box2D.Dynamics.Joints.b2RevoluteJointDef;
   import flash.display.MovieClip;
   import flash.display.Sprite;
   import flash.events.Event;
   import flash.geom.Point;
   
   /**
    * ...
    * @author ---
    */
   public class Test01 extends MovieClip
   {
      var RATIO:Number = 30.0;
      var m_world:b2World;
      var circ:b2CircleShape;
      var box:b2PolygonShape;
      var bd:b2BodyDef = new b2BodyDef();
      var djd:b2DistanceJointDef = new b2DistanceJointDef();
      var fixtureDef:b2FixtureDef = new b2FixtureDef();
      
      var wheel01:b2Body;
      var wheel02:b2Body;
      
      public function Test01():void
      {
         m_world = new b2World(new b2Vec2(0, 3), false);
         
         var debugDraw:b2DebugDraw = new b2DebugDraw();
         var m_sprite:Sprite = new Sprite();
         addChild(m_sprite);
         debugDraw.SetSprite(m_sprite);
         debugDraw.SetDrawScale(30.0);
         debugDraw.SetFillAlpha(0.3);
         debugDraw.SetLineThickness(1.0);
         debugDraw.SetFlags(b2DebugDraw.e_shapeBit | b2DebugDraw.e_jointBit);
         m_world.SetDebugDraw(debugDraw);
         m_world.DrawDebugData();
         
         drawMachine();
         drawTerrain();
         
         addEventListener(Event.ENTER_FRAME, enterFunction);
      }
      
      private function drawTerrain():void
      {
         bd.type = b2Body.b2_staticBody;
         box = new b2PolygonShape();
         box.SetAsBox(300 / RATIO, 1 / RATIO);
         fixtureDef.shape = box;
         bd.position.Set(300 / RATIO, 400 / RATIO);
         var ground:b2Body = m_world.CreateBody(bd);
         ground.CreateFixture(fixtureDef);
      }
      
      private function drawMachine():void
      {
         var startX:Number = 300;
         var startY:Number = 10;
         
         bd.type = b2Body.b2_dynamicBody;
         
         //WHEELS
         circ = new b2CircleShape( 10 / RATIO );
         fixtureDef.shape = circ;
         fixtureDef.density = 1;
         fixtureDef.friction = 0.4;
         fixtureDef.restitution = 0.3;
         bd.position.Set(startX/RATIO, startY/RATIO);
         wheel01 = m_world.CreateBody(bd);
         wheel01.CreateFixture(fixtureDef);
         
         bd.position.Set(startX /RATIO , startY/RATIO + 30/RATIO);
         wheel02 = m_world.CreateBody(bd);
         wheel02.CreateFixture(fixtureDef);
         
         //JOINTS
         djd.frequencyHz = 4;
         djd.dampingRatio = 0.4;
         djd.collideConnected = true;
         
         djd.Initialize(wheel01, wheel02, wheel01.GetPosition(), wheel02.GetPosition());
         m_world.CreateJoint(djd);
      }
      
      private function enterFunction(e:Event):void
      {
         m_world.Step(1 / 30, 10 , 10);
         m_world.DrawDebugData();
      }
   }
   
}


Does this work fine on your pc ('s) ?? My Box2d version is 2.1; 60 fps and Cs5.5.
Do I have to add something extra to the joint?

Thanks in advance 🙂
Does nobody have the same problem? Distance joints aren't soft 🙁

Original thread: https://box2d.org/forum/viewtopic.php?t=8282