
Код AS3:
private function update(event:Event):void {
world.Step(1 / METERS, 10, 10);
world.ClearForces();
world.DrawDebugData();
} //End function
METERS = 30
Добавлено через 1 час 19 минут
у кого нибудь есть код с работающим джоинтом и enableMotor? желательно чтобы с кодом тела (которое крепится)
Добавлено через 1 час 43 минуты
вот так заработало:

Код AS3:
//////////////////////////
//bit 1
//var bodyBit1_:b2Body;
var bodyBit1_1_:b2Body;
var bodyBit1_:b2Body;
bodyDef_ = new b2BodyDef();
// bodyDef_.position.Set((wallThickness_ + 60) / METERS, (_mapBase.stage.stageHeight - wallThickness_ - 30) / METERS);
bodyDef_.position.Set((wallThickness_ + 90) / METERS, (_mapBase.stage.stageHeight - wallThickness_ - 70) / METERS);
bodyDef_.type = b2Body.b2_staticBody;
polygonShape_ = new b2PolygonShape();
polygonShape_.SetAsBox(4 / METERS, 30 / METERS);
bodyBit1_1_ = _mapBase.world.CreateBody(bodyDef_);
fixtureDef_ = new b2FixtureDef();
fixtureDef_.shape = polygonShape_;
bodyBit1_1_.SetUserData("bit 1-");
bodyBit1_1_.CreateFixture(fixtureDef_);
bodyDef_ = new b2BodyDef();
bodyDef_.position.Set((wallThickness_ + 60) / METERS, (_mapBase.stage.stageHeight - wallThickness_ - 48 * 2) / METERS);
bodyDef_.type = b2Body.b2_dynamicBody;
bodyDef_.allowSleep = false;
polygonShape_ = new b2PolygonShape();
polygonShape_.SetAsArray([b2Vec2.Make(-10 / METERS, -10 / METERS), b2Vec2.Make(70 / METERS, 0 / METERS), b2Vec2.Make(-10 / METERS, 10 / METERS)]);
bodyBit1_ = _mapBase.world.CreateBody(bodyDef_);
fixtureDef_ = new b2FixtureDef();
fixtureDef_.density = 0.5
fixtureDef_.friction = 0.5;
fixtureDef_.restitution = 0.5
fixtureDef_.shape = polygonShape_;
bodyBit1_.SetUserData("bit 1");
bodyBit1_.CreateFixture(fixtureDef_);
// bodyBit1_.SetAngle(Math.PI / 6);
//bodyBit1_.SetAngle(Math.PI / 6);
trace(bodyBit1_.GetAngle());
var _jointDef:b2RevoluteJointDef = new b2RevoluteJointDef();
_jointDef.bodyA = bodyBit1_;
_jointDef.bodyB = bodyBit1_1_;
_jointDef.localAnchorA = new b2Vec2(bodyBit1_.GetLocalCenter().x / METERS, bodyBit1_.GetLocalCenter().y / METERS);
_jointDef.localAnchorB = new b2Vec2(0 / METERS, -25 / METERS);
/* _jointDef.lowerAngle = b2Settings.b2_pi / 6; // -90 degrees
_jointDef.upperAngle = 0.25 * b2Settings.b2_pi // 45 degrees
_jointDef.enableLimit = true;*/
// _jointDef.motorSpeed = 20;
_jointDef.maxMotorTorque = 20;
_jointDef.motorSpeed = 20;
_jointDef.enableMotor = true;
var _frontWheelJoint:b2RevoluteJoint = _mapBase.world.CreateJoint(_jointDef) as b2RevoluteJoint;
первоначальный код не работал потому что не было строки _jointDef.motorSpeed = 20 , но я же ее(строку) по нескольку раз сувал в разные места - все равно не работало. вообщем хз.