开发者

Rotate b2Bodies in Box2d without messing up physics simulation

开发者 https://www.devze.com 2023-04-11 17:46 出处:网络
I have made a biped using box2d. The soldier has a gun, which is a b2Body and is attached to the soldier\'s arm using a b2Joint. I want to rotate the gun to point in the direction the soldier shoots w

I have made a biped using box2d. The soldier has a gun, which is a b2Body and is attached to the soldier's arm using a b2Joint. I want to rotate the gun to point in the direction the soldier shoots without messing up the physics simulation. This eliminates SetTransform. I already have the angle. All I need to do is set the rotation. Is t开发者_开发知识库here any way to accomplish this without using motors and rotating the soldier's body parts?

0

精彩评论

暂无评论...
验证码 换一张
取 消