Simulate physics while locking dynamic body (+sample movie)

I've been trying to find out how to make a "hinge" (not sure what I should call it) to simulate collision with other dynamic bodies while itself being immovable.

The hinge is supposed to simulate collision and rotate-able, but immovable.
So far, I:
- initialize the hinge and put it to sleep first
- make it draggable and rotatable
- on mouseUp, set it back to sleep

It went well, but I could not find a solution for collision checking. I want it to stay immovable while still able to check collision when other bodies are coming.

Can anyone please help? Thanks in advance.

Link to the movie: http://megaswf.com/view/14f25cf410243de ... da3c5.html
if you are using 2.1 you could use a kenomatic body.

kenomatic bodies can push other objects out of the way, but do not get moved by any physics forces.

so you could control the movement of the kenomatic body using your own code and not have to worry about the effects of physics forces on it.
Ouchh!
I was starting with older version of Box2D...

Thanks for the info, I'll check out the new Box2D right away 😀
Is there anyway I can achieve the same result with the old engine?
That a 'yes' with a 'but'. It's not supported in 2.02, but you can either hack the crap out of it so static bodies move (what I did), or treat it like a dynamic body, but add calls each time step to botch the body into an exact placement with SetXForm, it it's not already.
Thanks for the replies, but I'm still stuck with the same problem

Code:
private function CreateHinge2(px:Number, py:Number, pr:Number, pw:Number, ph:Number):void
      {
         var x = px / Globals.m2p;
         var y = py / Globals.m2p;
         var r = pr / 2 / Globals.m2p;
         var w = pw / 2 / Globals.m2p;
         var h = ph / 2 / Globals.m2p;
         
         trace("1");
         
         // BOX
         var boxBody:b2BodyDef = new b2BodyDef();
         boxBody.position.Set(x, y);
         boxBody.type = b2Body.b2_staticBody;
         var boxShp:b2PolygonShape = new b2PolygonShape();
         var shapeVert:Array = new Array();
         shapeVert[0] = new b2Vec2(0.5 * w, -0.5 * h);
         shapeVert[1] = new b2Vec2(0.5 * w, 0.5 * h);
         shapeVert[2] = new b2Vec2(-1 * w, 0.5 * h);
         shapeVert[3] = new b2Vec2(-1 * w, -0.5 * h);         
         boxShp.SetAsArray(shapeVert, 4);
         var my_boxfixt:b2FixtureDef = new b2FixtureDef();
         my_boxfixt.density = 0.5;
         my_boxfixt.shape = boxShp;      
         trace("2");
         
         // CIRCLE         
         var circleBody:b2BodyDef = new b2BodyDef();
         circleBody.position.Set(x, y);
         circleBody.type = b2Body.b2_staticBody;
         var circleShp:b2CircleShape = new b2CircleShape(r);         
         var my_cirfixt:b2FixtureDef = new b2FixtureDef();
         my_cirfixt.density = 0.5;
         my_cirfixt.shape = circleShp;
         
         trace("3");
         var boxWorldBody:b2Body = Globals.world.CreateBody(boxBody);
         boxWorldBody.CreateFixture(my_boxfixt);
         var circleWorldBody:b2Body = Globals.world.CreateBody(circleBody);
         circleWorldBody.CreateFixture(my_cirfixt);   
         
         trace("4");
         revJoint.Initialize(circleWorldBody, boxWorldBody, circleWorldBody.GetWorldCenter());
         revJoint.enableLimit = true;
         revJoint.maxMotorTorque = 1.0
         revJoint.motorSpeed = 0.3;
         revJoint.enableMotor = true;
         var theJoint:b2RevoluteJoint = Globals.world.CreateJoint(revJoint) as b2RevoluteJoint;
         
         /*revJoint.Initialize(circleBody, boxBody, circleBody.GetWorldCenter());
         revJoint.lowerAngle = -0.5 * 180;
         revJoint.upperAngle = 0.25 * 180;
         revJoint.enableLimit = true;
         revJoint.maxMotorTorque = 1.0;
         revJoint.motorSpeed = 0.0;
         revJoint.enableMotor = true;
         var theJoint:b2RevoluteJoint = LevelVars.world.CreateJoint(revJoint) as b2RevoluteJoint;*/
      }


OK, so what I'm trying to achieve here is:
- a box that joint with a circle that I can pull and rotate
- the circle should stay still, but I can drag and rotate the box freely, with the circle as the center
- but the circle and box must not react from other physical forces (other objects)

I thought revolute Joint should be the answer, but now I think there's either something with my head or my code.

The problem when I used box2D 2.01..
I can achieve what I wanted when I pull the box, but the body reacted when other objects collide with it. Now I'm confused how to ask my question and wondering if I have made myself clear or not 😢

Somebody please help me resolve this? I've got to finish this whole game by tonight.. 😮
Thank you in advance
picture?

if the circle does not move, maybe it could be static. but im not sure thats what you mean.

Original thread: https://box2d.org/forum/viewtopic.php?t=4993