Search code examples
cocos2d-xcocos2d-x-3.0

How to create a cocos2d-x's PhysicsBody that does not rotate


I'm using cocos2dx to write a simple game. I wanted to use cocos2dx's physics engine but I don't need any object to rotate from it's initial direction. It turns out I can't find a way to do it. I tried to put a static physics body and attaching other bodies to it with a PhysicsJoinMotor or PhysicsJointGear with o avail. Any ideas on how to accomplish this?


Solution

  • body->setRotationEnable(true);