Actually somehow I stumbled across the idea to limit all of my collision detecting to using the bounding rectangles and I created a new dummy class that I add to the scene and use it to detect the rectangular collisions for any given object. The problem that is now occurring is handling the collision detection for many objects becomes far too expensive a task to be handled in a single thread. This is my first experience trying to use QThread, or any type of threading for that matter, so I'm a little confused as to where and how I would send the collision detecting tasks to different threads.
Currently I have all of my collision detecting taking place in the advance(step=0) function for any of the graphicsobjects. By doing so, when the advance(step=1) call is made, the graphicsobjects can simply perform the proper task based on their current situation. Thus there should be no issue with threading out the collision detection for each object into different threads, but I'm unclear where I should put the threading code.
Should the threading be declared as its own class and then the object and scene that need to be processed for some kind of detection be passed into that class?
Or should the thread be declared within each graphicsobject and called when that object attempts to detect any collision that is occurring.
Also, would I still want to declare a main thread? It seems as though the answer would be no, as I would not want the main thread getting ahead of the collision processing and starting up the advance(step=1) processing while some of the collision detection processing is still occurring.
Thanks!
Bookmarks