Create a ground of collison

Dec 29, 2009 at 5:05 AM

My problem is I want the dynamic box I have to collide with the floor much in the same way a box would collide with any static box in farseer physics, but I also need this floor to be infinite on the horizontal axis. So is there a way I can define a sort of floor or boundary at the X position that would represent the ground and the dynamic box would collide with it and never move past it?

One method I already tried was to make a flat platform for the floor, not infinite, just a regular ol' plank. but to make it act like an infinite floor it followed underneath where ever the dynamic box went. However this method gave weird results and the collision was very weird between the two boxes I think because the floor was actually moving.

Jan 3, 2010 at 1:28 AM

Moving the floor could work. You can create a geometry that is wider than the screen and move it to be under the player. You would have to hack it until it works correctly, the method really depends on your game.

Using the SAT narrow phase collider, you should be able to create a very long geometry. You could create several long geometries and only activate the one that beneath the player.