C#/XNA port of the Box2D physics engine.

learn more… | top users | synonyms

26
votes
6answers
4k views

Implementing a wrapping wire (like the Worms Ninja Rope) in a 2D physics engine

I've been trying out some rope-physics recently, and I've found that the "standard" solution - making a rope from a series of objects strung together with springs or joints - is unsatisfying. ...
13
votes
2answers
1k views

How can I create a bomb explosion in Farseer that pushes nearby objects away?

I'm trying to create a bomb explosion in Farseer. I created a circle for the bomb. However, if the bomb explodes, the objects (bodies) that are around it should fly away because they're pushed back by ...
9
votes
2answers
1k views

How to implement 2d explosions that will cause damage taking into account covers and distance?

How can I implement a 2D explosion in a way that it will cause less damage to characters that hide behind crates or other cover? Ideally damage will depend on the strength of the cover (e.g. metal ...
9
votes
3answers
3k views

How do you do AI path following within a 2d physics engine like farseer/box2d?

I'm in the process of moving a 2d top down game I've been working on into a proper rigid body physics engine like Farseer. Up until now, I had just hacked together my own physics code where needed. ...
9
votes
3answers
391 views

Why does Farseer 2.x store temporaries as members and not on the stack? (.NET)

UPDATE: This question refers to Farseer 2.x. The newer 3.x doesn't seem to do this. I'm using Farseer Physics Engine quite extensively at the moment, and I've noticed that it seems to store a lot of ...
8
votes
5answers
596 views

What should I do to prevent my monsters from walking off platforms?

I have a question that is driving me crazy because I think it should be fairly easy to find a tutorial on it. I'm currently using XNA and Farseer to create a simple platformer game. I'm about to be ...
8
votes
3answers
952 views

Tiling Physics using Farseer

I'm having a problem with the Farseer Physics Engine, where in a tiled environment, my object will at times interact with corners of others objects, even if they align perfectly. I've read about ...
8
votes
3answers
865 views

Inverted textures

I'm trying to draw textures aligned with this physics body whose coordinate system's origin is at the center of the screen. (XNA)Spritebatch has its default origin set to top-left corner. I got the ...
6
votes
2answers
1k views

How to create a very specific kind of joint in Farseer?

Edit Problem solved (see Drackir's answer). Here's a demo of what I was trying to achieve with this joint. More info about the scenario on this other question. Problem I'm trying to create a ...
6
votes
1answer
711 views

Farseer Physics: Ways to create a Body?

I want to create something similar to this using farsser and Kinect: https://vimeo.com/33500649 This is my implementation until now: http://www.youtube.com/watch?v=GlIvJRhco4U I have the outline ...
5
votes
2answers
589 views

Detect Open Space in Farseer [duplicate]

Possible Duplicate: How do I detect ledges? I'm working on a 2D platformer using XNA and Farseer. I would like the player's character to be able to grab and climb up ledges. Detecting a ...
5
votes
2answers
4k views

XNA C# Platformer - physics engine or tile based?

I would like to get some opinions on whether i should develop my game using a physics engine (farseer physics seems to be the best option) or follow the traditional tile-based method. Quick ...
5
votes
1answer
1k views

Correct way to use Farseer Physics in XNA

I am using Farseer Physics for my 2D sidescroller game and I'm not sure how to proceed with it. I currently have a Sprite class (handles nothing but graphics), a GameObject class (contains specific ...
5
votes
3answers
974 views

Can I swap out Farseer physics fixtures at runtime?

I am working on a 2D side-scroller using Farseer Physics Engine v3.3.1. In order to create a realistic physical skeleton for the player, I am using a method similar to the one explained here (See ...
4
votes
1answer
196 views

How do I make a tile passable in one direction only?

I want that my character can jump through some of the tiles, like Mario does in this video: http://www.youtube.com/watch?v=zIPYzbNrNhc In this video, Mario jumps up through orange platforms, but ...
4
votes
1answer
547 views

Issues with Polygon Fixtures in Farseer

I've been working with the Farseer Physics Engine to try and build a simple 2D, sidescrolling game. Creating basic rectangle blocks worked easily enough, but I discovered when I tried to create some ...
4
votes
3answers
665 views

IndexOutOfRangeException on World.Step after enabling/disabling a Farseer physics body?

Earlier, I posted a question asking how to swap fixtures on the fly in a 2D side-scroller using Farseer Physics Engine. The ultimate goal being that the player's physical body changes when the player ...
4
votes
1answer
455 views

Making a multi-pieced rectangular breakable body with Farseer

Using Farseer 3.3.1 I want to create a rectangular BreakableBody with many pieces. Right now here is my code: Vertices polygon = PolygonTools.CreateRectangle( 2.5f , 1.25f ); List<Vertices> ...
4
votes
1answer
556 views

Farseer engine built for MonoTouch?

Does anyone know where I can find a version of the farseer physics engine compiled for MonoTouch, or do most people just download a windows version from codeplex and attempt to build their own ...
3
votes
1answer
902 views

360+ degree rotation skips back to 0 degrees when using Math.Atan2(y, x)

I'm new to XNA and this is my first actual project, so forgive my noobness. I'm using jointAngle = System.Math.Atan2(RightStick.Y, RightStick.X); in order to set an angle of a joint (farseer) so ...
3
votes
3answers
861 views

Moving a body in a specific direction using XNA with Farseer Physics

I have a custom polygon attached to a body, which looks like this: What I am trying to accomplish is getting the body to move according to wherever the tip of the body is. So far this is what I've ...
3
votes
1answer
151 views

Cant get a Farseer Physics body’s rotation to follow the mouse

Here is what’s in my HandleKeyboard() method that is called from the Game1 Update method. MouseState mState = Mouse.GetState(); // the Vector2 that will hold the angle from the player ...
3
votes
2answers
304 views

How can I determine the contact point of a collision?

I have two Farseer bodies. A static rectangle and a dynamic ball that is flying around. I want to determine where the ball touched the rectangle. I need the exact coordinates of the contact point. ...
3
votes
1answer
532 views

How to restrict paddle movement using Farseer Physics engine 3.2

I am new to using Farseer Physics Engine 3.2(FPE), so please bear with my questions. Also, since FPE 3.2 is based on Box2D, I have been reading Box2D manual and pieces of code scattered in samples to ...
2
votes
2answers
130 views

Is there any quick and easy way to make all bodies visible with Farseer physics engine for XNA?

I just want to be able to see all my bodies on the screen for debugging purposes and i cant think of an easy way, for example i have make some edge fixtures with curved arcs attached and i just want ...
2
votes
3answers
615 views

How do you change a Body's origin in Farseer?

In Farseer 3.3.1 for XNA, how do I change the origin of a Body? For example, when I create a Circle Body, instead of it rotating around its center, I want it to rotate around another specified point. ...
2
votes
2answers
1k views

Farseer - Apply Impulse

I'm new to Farseer and have a simple question. The demos I went through didn't seem to demonstrate what I want. I would like to apply an impulse (not force) to an object at a specific position on that ...
2
votes
1answer
151 views

Farseer: Shooting a ball in a certain angle?

How can I shoot a ball in a certain angle? When I press the Space key, the ball should be shot in a 45 degree angle. How can I do that?
2
votes
1answer
169 views

Getting a uint color array from a portion of a Texture2D

I'm currently using the Farseer tools to create a body from a Texture2D. However, my texture is a spritesheet and I need to get the uint array containing the colors from a portion of the full ...
2
votes
2answers
221 views

Texturing 2D vectorial terrain (or simply masking texture)

I have a procedurally generated terrain, as follows: It is generated and then built using Farseer Physics, however I haven't found a way to create and apply a mask to texture it properly, I have ...
2
votes
2answers
771 views

Farseer: Only allow the collision one time with the object

I have there serveral platforms. I would like to allow the player to collide only one time with the object! Hope you can help me
2
votes
1answer
46 views

Why is BayazitDecomposer inaccessible when upgrading from Farseer 3.3.1 to Farseer 3.5?

I used the following code in Farseer 3.3.1 and it worked correctly, but in Farseer 3.5, I always get an error message in the following line: list = BayazitDecomposer.ConvexPartition(textureVertices); ...
2
votes
2answers
457 views

Farseer Physics: How to create shape from Vertices?

As you can understand from the title, I'm pretty new to game development. I'm doing this for fun. Anyway here's my question. I have this Farseer Physics samples and i've been studying them for a few ...
2
votes
1answer
151 views

Developing an interactive book for Windows-Runtime

My three year old loves playing with the interactive books on our iPad, and I love playing with code and I love my Surface RT... So I thought I'd try and make a basic animated book using WinRT, I've ...
2
votes
1answer
333 views

Implementing a wheeled character controller

I'm trying to implement Boxycraft's character controller in XNA (with Farseer), as Bryan Dysmas did (minus the jumping part, yet). My current implementation seems to sometimes glitch in between two ...
2
votes
1answer
527 views

Odd offset bug in Farseer/XNA/C#

So I'm using Farseer to create an immovable object: [...] private Body body; public Immovable(World world, ContentManager c, String s, int posx, int posy, int w, int h, String user_data) { ...
2
votes
0answers
63 views

How can I combine multiple bodies into one in Farseer? [closed]

I want to create a windmill in Farseer, but I don't know how to combine the 3 windmill sails bodies to one body. During gameplay, the sails could get destroyed. For example, if another body hits one ...
2
votes
1answer
2k views

Farseer Physics collision detection vs intersection detection with sensors

I'm trying to make a game that uses Farseer physics engine as its main collision detection engine. I have a 2d circle body object that has a matching fixture (I used the CreatCircle method. I did not ...
1
vote
1answer
2k views

How do I reset a game level

I have managed to implement a screen state system which I use to access the game. When the the character has collided with an enemy tile the game ends by going to a seperate game over screen. After ...
1
vote
1answer
257 views

Player Movement Systems

I am working on a project were in class my group of students help produce a video game. We are creating a 2D platformer and was trying to make a pixel based system collision witch fell through. Now I ...
1
vote
2answers
1k views

How do I determine which side of the player has collided with an object?

I have some static bodies (platforms) and a dynamic body (the player) in my world. The collision between them works great, but I would like to know which side of the player (rectangle) collides with ...
1
vote
2answers
2k views

Create a body of an irregular 2D sprite in Farseer

I'm trying to create a body of a irregular 2D sprite Farseer 3.3.1. The regular shapes that BodyFactory provides are not that I want. Is there a way that one can create irregular objects? Could it be ...
1
vote
1answer
49 views

A Sensor’s ContactList Keeps Old / Ignores New Contacts, When That Contact Is still

Okay this is a hard one to explain so I’ll try my best. Basically every time my enemy class updates, it runs a SightCone Sensor Contact List test, so this is every single frame it checks for all the ...
1
vote
1answer
96 views

Farseer - Difference between Position, GetLocalVector, and GetWorldVector

I have used Box2D extensively, and am used to just calling body.GetPosition(). But Farseer does not have this. Instead it has a property Position, as well as methods GetLocalVector and GetWorldVector. ...
1
vote
1answer
722 views

Farseer DebugViewXNA: scaling problem

I'm trying to get into Farseer and XNA. Before I do any real graphics, I want to use the Farseer debug view only. The problem ist, that I don't really know which matrix to use and the other thing is ...
1
vote
2answers
600 views

How can I implement a “boost pad” with Farseer/Box2D physics?

I'm trying to implement a boost pad in my XNA game using the Farseer Physics Engine. (This question applies to Box2D too, I would be happy to port working Box2D code to C#.) By "boost pad", I mean an ...
1
vote
1answer
38 views

How can I limit the movement angle of a Farseer joint?

How can I create rectangles in Farseer that behave like the two red rectangles in this video: https://www.youtube.com/watch?v=w0p2y4dRylQ I created an angle joint, but it behaves weird. Should I use ...
1
vote
1answer
73 views

How can I create a seesaw with Farseer Physics Engine?

I want to create a seesaw like in this picture: I created two rectangular bodies, one for the diagonal rectangle and one for the little rectangle in the middle. But I don't know how to connect the ...
1
vote
1answer
88 views

How to apply steering to a physics body correctly when using a physics engine?

I have a top down 2d game that uses a physics engine (Farseer). I'm using the standard steering behaviors to make the AI move around but I'm not sure the correct way to take the so called "steering ...
1
vote
1answer
65 views

How can I measure the velocity of a Farseer body?

I want to know how fast my body(a circle) is moving. How can I do that? How can I measure the velocity of a body? In addition, I want to limit the velocity of a body. For example, I want that a body ...