Sep 20, 2012 at 12:56 PM
Edited Sep 20, 2012 at 12:58 PM
I am developing for windows mobile platform.
Im creating my BodyFactory.CreateRectangle around my floor line texture that is drawn on the screen. position starts at at vector2(100,400)
But it seems that the BodyFactory.CreateRectangle around this image starts before position vector2(100,400) and ends halfway across my floor line). I have tested it with random sprites falling.
Am i missing a setting. Heres my code using the floor object of my sprite class
Its like my world is slightly out.
floor.origin = Vector2.Zero;
floor.alive = true;
floor.position = new Vector2(100, 400);
floor.farseerRectangle = BodyFactory.CreateRectangle(world, ConvertUnits.ToSimUnits(floor.image.Width), ConvertUnits.ToSimUnits(15), 0.001f);
floor.farseerRectangle.BodyType = BodyType.Static;
floor.farseerRectangle.Position = ConvertUnits.ToSimUnits(floor.position);
floor.farseerRectangle.IsStatic = true;
floor.farseerRectangle.Restitution = 0.15f; //Bounceability
floor.farseerRectangle.Friction = 0.05f;
floor.farseerRectangle.IsSensor = false;
floor.farseerRectangle.Rotation = alpha;