box2d-How to rotate connected bodie

  ... the Physics Box2D Extension for AndEngine.

box2d-How to rotate connected bodie

Postby Harry » Tue Jan 20, 2015 8:47 am

I have created below hexagon structure in Andengine with Box2D physics engine. I want to rotate whole structure with respect to center when other ball collides with the structure using physics.

I tried weld joint and revolute joint with the bodies but it is not performing proper motion as required. All bodies are attached with weld joint and vertices have revolute joint with center body which is static like,

reference image:
Image

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1. RevoluteJointDef revoluteJointDef1 = new RevoluteJointDef();
  2. revoluteJointDef1.initialize(centerB, movingBody[i], centerB.getWorldCenter());
  3. revoluteJointDef1.enableMotor = true;
  4. revoluteJointDef1.motorSpeed = 0;
  5. revoluteJointDef1.maxMotorTorque = 1f;
  6. this.mPhysicsWorld.createJoint(revoluteJointDef1);
Parsed in 0.011 seconds, using GeSHi 1.0.8.4


Is there any other way like if i can add a big circle disc body and attach balls on top of it which will rotate all bodies ?
Other suggestions
Thanks
Harry
 
Posts: 1
Joined: Tue Jan 20, 2015 8:32 am

Re: box2d-How to rotate connected bodie

Postby axton » Sat Apr 04, 2015 12:41 pm

I want to rotate whole structure with respect to center when other ball collides with the structure using physics.
axton
 
Posts: 1
Joined: Sat Apr 04, 2015 12:39 pm


Return to Physics Box2D

Who is online

Users browsing this forum: No registered users and 6 guests