I was made aware of a serious issue with detecting collisions between TGeom’s recently. While it did not affect anyone who was using the engine and letting the TPhysicsSimulator run and manage collisions and dynamics, anyone who wished to use Farseer.BMX’s collision routines separately by calling TGeom.CollideWithGeometry() ran into issues. The code has since been fixed and updated. Please update your Farseer.BMX module so you can continue using it without this annoying bug.
Download: Farseer.BMX v1.1
What if I made customizations to the Farseer.BMX code already?
Well thankfully, the bug was isolated to only one file, and in particular one method. If you wish to keep your custom build of Farseer but want to fix the issue then simply download this new version and take the Collisions/Geom.bmx file from it and place it in your corresponding Farseer.BMX directory.
If you happened to make changes to the Geom.bmx file itself, then simply search for the method ‘CollideWithGeometry()’ in the new version and place it in your current version. For those that simply want the code that’s changed (since this is a small change) I pasted it below:
Method CollideWithGeometry:Int(geometry:TGeom) For Local i:Int = 0 To worldVertices.Count() step 1 vert = worldVertices.vecArray[i] If geometry.Collide(vert) Then Return True End If Next For Local i:Int = 0 To geometry.worldVertices.Count() step 1 vert = geometry.worldVertices.vecArray[i] If Self.Collide(vert) Then Return True End If Next Return False End Method
This was a minor update that I thought was critical to getting out there for those that may be experiencing problems, so there aren’t any ‘extras’. Documentation is still a WIP.