box2d 2.2版本替换为b2PolygonShape SetAsOrientedBox

时间:2013-11-15 10:30:56

标签: box2d

什么是b2PolygonShape SetAsOrientedBox的替代品 对于新的box2d版本。

例如,这个例子的正确代码是什么(在动作脚本中)

var leftAxleContainerShape:b2PolygonShape = new b2PolygonShape();
            leftAxleContainerShape.SetAsOrientedBox(axleContainerWidth/worldScale,axleContainerHeight/worldScale,new b2Vec2(-axleContainerDistance/worldScale,axleContainerDepth/worldScale),axleAngle*degreesToRadians);
            var leftAxleContainerFixture:b2FixtureDef = new b2FixtureDef();
            leftAxleContainerFixture.density=3;
            leftAxleContainerFixture.friction=3;
            leftAxleContainerFixture.restitution=0.3;
            leftAxleContainerFixture.filter.groupIndex=-1;
            leftAxleContainerFixture.shape=leftAxleContainerShape;

0 个答案:

没有答案