Looking at the Wiki articles on collision detection & callbacks, it justifies ghosts as being more efficient collision detection, since ghosts keep track of their own collision pairs.
But looking at the code and forum examples, the code for iterating over all contacts is much cleaner than that for ghost objects. Is the benefit that with ghosts, you will only be iterating a small subset of the total contacts, because it's only those in contact with the ghost?
If you wanted to run that code for all ghosts in the world, and you didn't know which objects were ghosts, you'd have to iterate every object to find them in the fist place. Is that still going to be more efficient?
Thanks.
What is the advantage of ghost collision detection?
-
- Posts: 74
- Joined: Thu Feb 10, 2011 8:27 pm
-
- Posts: 171
- Joined: Sun Jan 17, 2010 4:47 am
Re: What is the advantage of ghost collision detection?
Yes, the advantage is that you are iterating over a sub-set rather than everything in the world.
This thread talks about the different ways to get contact information and the intended ways to get it based on what you are doing. It brings out ghost objects and manual manifold iteration and is generally informative if you haven't read it yet. This specific post in that thread is particularly informative.
This implies you don't have access to the ghost object at the time you start processing. If that is the case then you have a valid point. However that doesn't have to be the case. I for example store my ghost objects separating outside the world for when I need to start processing them.SynapticBytes wrote:If you wanted to run that code for all ghosts in the world, and you didn't know which objects were ghosts, you'd have to iterate every object to find them in the fist place. Is that still going to be more efficient?
This thread talks about the different ways to get contact information and the intended ways to get it based on what you are doing. It brings out ghost objects and manual manifold iteration and is generally informative if you haven't read it yet. This specific post in that thread is particularly informative.
-
- Posts: 74
- Joined: Thu Feb 10, 2011 8:27 pm
Re: What is the advantage of ghost collision detection?
Thanks again,
It's nice to see someone responding to posts on the forum
I guess my original question was comparing the scenario where I was just allowing the user to say "check all ghost objects for me" without have the ghosts managed separately. I'll check out the threads you linked. It's sometime hard searching for stuff here, as the search function seems to be case sensitive, and I haven't found a way to search case-insensitive.
It's nice to see someone responding to posts on the forum

I guess my original question was comparing the scenario where I was just allowing the user to say "check all ghost objects for me" without have the ghosts managed separately. I'll check out the threads you linked. It's sometime hard searching for stuff here, as the search function seems to be case sensitive, and I haven't found a way to search case-insensitive.
-
- Posts: 171
- Joined: Sun Jan 17, 2010 4:47 am
Re: What is the advantage of ghost collision detection?
When searching for things on the forum it's best to just use google. It gives more relevant search results, as well as things that can be tangentially related that could shed some light. Just prefix your search in the search bar with "site:bulletphysics.org/Bullet/phpBB3", that'll make it search just the bullet forums.
-
- Posts: 74
- Joined: Thu Feb 10, 2011 8:27 pm
Re: What is the advantage of ghost collision detection?
Yeah probably should. The pain with bullet google if you don't include the the site filter is the 100's of duplicate references to the api's for everybody that's reimplemented the library 
