c# - Farseer physics (Box2D) - Fixture rotation around point -


i'm having bit of trouble rotating fixture in farseer physics engine (using xna). basically, have fixture, set such:

 private void setupphysics(world gworld, vector2 position)     {         body = new body(gworld);         body.bodytype = bodytype.dynamic;         carfixture = fixturefactory.attachrectangle(convertunits.tosimunits(21f), convertunits.tosimunits(35f), 5f, convertunits.tosimunits(position), body);         carfixture.restitution = 4f;         carfixture.friction = 5f;         carfixture.body.angulardamping = 1f;          carfixture.body.lineardamping = 1f;     } 

which rotate using code

carfixture.body.rotation -= 0.01f; 

which works fine. problem is, rotates around top left corner of rectangle, , need rotate round center. how go rotating fixture around it's center? (i apologize stupidity - i'm new farseer / box2d , have no doubt major cause of problem, i've been searching internet few hours , have found nothing.)

solved myself - turned out body rotating around center, texture attached rotating around corner


Comments

Popular posts from this blog

c++ - Is it possible to compile a VST on linux? -

java - Output of Eclipse is rubbish -

jquery - Confused with JSON data and normal data in Django ajax request -