我想按照当前所面向的方向对我的对象施加一个力,这里是我的代码,但是当我尝试做时,它会抛出错误force * t
,我在做什么错误?box2d在特定方向上施加力
b2Transform t;
t.Set(b2Vec2(0, 0), spaceCraft->GetAngle());
b2Vec2 force = b2Vec2(0, 2.5f);
spaceCraft->ApplyForce(force * t, spaceCraft->GetPosition());
的http://计算器.com/questions/9164146/simple-gun-in-cocos2dbox2d-game – iforce2d 2012-03-08 22:27:06
Thanks @ iforce2d that worked! – Chris 2012-03-12 22:45:56
@ iforce2d请将此作为答案写下,以便我可以接受 – Chris 2012-03-18 10:04:08