I have run into an issue I just don't understand. I am making a prismatic joint but I get an error on "jointDef.motorForce = X.X"
Gets me:
ReferenceError: Error #1056: Cannot create property motorForce on Box2D.Dynamics.Joints.b2PrismaticJointDef.
If I comment out the motorForce line the swf works. I have tried changing the value, etc. What am I doing wrong?
Code:
var worldAxis:b2Vec2 = new b2Vec2(1.0, 0.0);
jointDef = new b2PrismaticJointDef();
jointDef.Initialize(FRAME, WHEEL1, new b2Vec2(WHEEL1.GetPosition().x, WHEEL1.GetPosition().y), worldAxis);
jointDef.lowerTranslation = -1.0;
jointDef.upperTranslation = 1.0;
jointDef.enableLimit = true;
jointDef.motorForce = 0.5;
jointDef.motorSpeed = 0.0;
jointDef.enableMotor = true;
m_world.CreateJoint(jointDef) as b2PrismaticJointDef;
jointDef = new b2PrismaticJointDef();
jointDef.Initialize(FRAME, WHEEL1, new b2Vec2(WHEEL1.GetPosition().x, WHEEL1.GetPosition().y), worldAxis);
jointDef.lowerTranslation = -1.0;
jointDef.upperTranslation = 1.0;
jointDef.enableLimit = true;
jointDef.motorForce = 0.5;
jointDef.motorSpeed = 0.0;
jointDef.enableMotor = true;
m_world.CreateJoint(jointDef) as b2PrismaticJointDef;
Gets me:
ReferenceError: Error #1056: Cannot create property motorForce on Box2D.Dynamics.Joints.b2PrismaticJointDef.
If I comment out the motorForce line the swf works. I have tried changing the value, etc. What am I doing wrong?