The original question Link
In this project, I use SWIFT++ to detect collision among objects. It's very convient to use, and can detect allcollisions among many objects. Following is something need to note:
Notes | SWIFT++ |
---|---|
① | It only support watertight models
|
② | Deactivation is not necessary (where cost me a lot of time to find)
|
③ | Add_Convex_Object function support fix/move and scale attritubes
|
I use four obj modesl, read their vertices and faces and give them to Add_Convex_Object
. These models are:
Names | Vertice # | Face # |
---|---|---|
Ball | 162
| 320
|
Box | 8
| 12
|
HighRes Ball | 804
| 1600
|
Lion | 5000
| 9996
|
Below is the running results. The first one record frames, the second one record collision detection times in one second, both with varying different models and objects number.
Observations | |
---|---|
① | both the running and collision detection time satisfy a quadratic curve regards to object number
|
② | rendering is more time consuming than collision detection
|
③ | The complexity of object has little influence on collision detection, since swift++ may use surrounding area to simplify
|
Observations | |
---|---|
① | detection times decrease along with scale increase in a linear manner
|
② | collision times increase exponentially along with scale increase
|
I adopt the bounding sphere algorithm and generate collision detection times (per second)-- object number and collision times -- object number graph.
© 2011–12 Dinghuang Ji