This project has moved. For the latest updates, please go here.

Using Broadphase alone

Topics: Developer Forum, User Forum
Dec 16, 2010 at 8:59 AM
Edited Dec 16, 2010 at 12:50 PM


We want a fast circular collision system for our game, so we figured we would just try to use Farseer's Broadphase alone. This has proved to be difficult, as I cannot seem to get the tree to update correctly... The pairs update and call the collision delegates nothing will move in the tree even when using the move AABB fuction..., and how to do it. Alternatively, is there a way to disable collision responses in the full physics engine? We just want to test of one circle is touching another, and brute force distance checks are too expensive as we wish to have a great number of circles.

Any help would be appreciated.

Dec 16, 2010 at 12:45 PM

If you ONLY need collision detection Circle to Circle and no real physics then it might be better to implement a Quadtree ( and when they collide check if the circles collide.

Dec 16, 2010 at 12:49 PM

Thats why we have been trying to get the dynamic tree from farseer to work independently.
It also would then give us collsion callbacks when there are potencial pairs and then we can just do a circle check in the callback delegete...

I figured why reinvent the wheel when there is a very optimized dynamic tree so nearby ;)

Dec 16, 2010 at 3:51 PM

Setting IsSensor on all objects will disable the physics system. Contacts are still detected, but not solved.

The DynamicTree class can be used for many things - in this case we use it as a broadphase. The broadphase itself can also be implemented without the rest of the engine. I would recommend you take a look at the DynamicTreeTest in the Testbed as it uses the DynamicTree manually.