我想按照當前所面向的方向對我的對象施加一個力,這裏是我的代碼,但是當我嘗試做時,它會拋出錯誤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