English 中文(简体)
Farseer Physics XNA Geom Tripping
原标题:

I have an issue similar to http://farseerphysics.codeplex.com/Thread/View.aspx?ThreadId=72364

I have a rectangle player geom, and many rectangle tile geoms lined up next to each other.

Occasionally when the player geom is crossing between them he seems to clip onto the corners of the tile geom and as a result rotate over.

Even when switching the moment of inertia to infinity which prevents rotation, the player geom "hops" when it clips the edge.

Here is a screenshot of the geoms tripping image http://notspike.com/PrototypeG/trip.png

Is there any fix for this? I ve tried the Farseer forums but it seems pretty inactive

Here is a link to a video using a circle geom for the player

http://www.notspike.com/PrototypeG/trip.avi

最佳回答

I would suggest that you avoid the use of small tiles placed next to each other for the level s collision geometry. For example, although visually it s clear that you re using tiles, the "floor" from the video would best be described as a long contiguous rectangle. That way, you don t have this problem at all ... floating point math is already imprecise enough and tiling collision geometry is just asking for that to go wrong :-)

问题回答

I ve had this happen before when my shapes are small enough or the movements are fast enough for the interval between physics calculation "ticks" to be enough to allow the objects to overlap before the collision detection kicks in.





相关问题
copying a texture in xna into another texture

I am loading a Texture2D that contains multiple sprite textures. I would like to pull the individual textures out when I load the initial Texture to store into separate Texture2D objects, but can t ...

XNA Antialias question!

I ve got problems with XNA and antialiasing. I can activate it using graphics.PreferMultiSampling = true; graphics.ApplyChanges(); however - it s only 2x antialiasing. Even if I set ...

Take screen shot in XNA

How can I take a screen shot of the screen in XNA? Is it possible without System.Drawing.Graphics.CopyFromScreen or Win32API? If it s not possible, Is there any way to draw a System.Drawing.Bitmap to ...

XNA .Fbx textures

I m using the standard .fbx importer with custom shaders in XNA. The .fbx model is UV wrapped properly and is textured appropriately when I use BasicEffect. However when I use my custom effect I have ...

Can t install XNA

I m trying to install XNA. When the installation starts I got an error that says "XNA GSE 1.0 refresh requires Visual C# 2005 express edition sp1..." I use Windows 7 and I have Visual Studio 2008 &...

Is there a 3D equivalant to clamp in XNA?

I m building a 3D game but i only plan on using a 2D perspective thus not taking the z axis into the equasion, i want to be able to limit the movement of one of my models so it doesn t move out of the ...

Fetching the vertices from the backbuffer (HLSL) on XNA

Hello and sorry for the obscure title :} I`ll try to explain the best i can. First of all, i am new to HLSL but i understand about the pipeline and stuff that are from the fairy world. What i`m ...

Simple XNA 2d physics library

Working on a 2D project and wanted some recommendations on a simple 2d physics library for use in C# with the XNA framework. I was looking at Farseer or physics2d. Anyone have any other suggestions? ...

热门标签