Home Game Development xna – Drawing Shape in DebugView

xna – Drawing Shape in DebugView

0
xna – Drawing Shape in DebugView

[ad_1]

Have you tried the official documentation?

The getting began part reveals the best way to create a fixture:

http://farseerphysics.codeplex.com/documentation

Fixture A fixture attaches (repair) the form to the physique in order that the
centroid of the form turns into the physique’s place. Whenever you progress
the physique, you additionally transfer the form. Once a collision happen to the
form, the power is calculated and utilized to the physique.

Her is the code to create a World with a single physique:

   1:  //Create a World object with zero gravity    
   2:  World world = new World(Vector2.Zero);    
   3:              

   4:  //We create a physique object and make it dynamic (movable)    
   5:  Body myBody = world.CreateBody();    
   6:  myBody.BodySort = BodySort.Dynamic;    
   7:   
   8:  //We create a circle form with a radius of 0.5 meters    
   9:  CircleShape circleShape = new CircleShape(0.5f);    
  10:       
  11:  //We repair the physique and form collectively utilizing a Fixture object    
  12:  Fixture fixture = myBody.CreateFixture(circleShape);

You can even use the fixture manufacturing facility

  Fixture fixture = FixtureManufacturing facility.CreateCircle(_world, 0.5f, 5, new Vector2(10, 0));

You can most likely create a default remodel (that does not remodel something) utilizing:

Transfrom remodel;
remodel.SetIdentity();

Note which you could additionally use the Box2D manuals, since Farseer provides the identical options.

[ad_2]

LEAVE A REPLY

Please enter your comment!
Please enter your name here