up

Collision Detection Between Rigid Bodies

Comp259, HW 2

Jeff Feasel

Assignment

Assumptions

Collision Resolution

Simple Implementation

Binned Implementation

Performance

Time per step, as a function of Number of Objects


# balls
Simple Impl.
msec/step
Binned Impl.
msec/step
10
1.1
0.17
20
4.3
0.33
30
10
0.53
40
18
0.72
50
28
0.93
60
44
1.1
70
59
1.4

48 triangles per ball
Box size: 20x20x20
Avg ball diameter:  1.0
The diameter is an average in the un-binned, variable-size case.
In the binned case, all balls have the same diameter.

Time per step, as a function of Triangles per Object


triangles/ball
Simple Impl.
msec/step
Binned Impl.
msec/step
8
15
0.87
48
30
0.88
120
43
0.88
224
58
0.88
360
68
0.90
528
86
0.93
728
93
0.92
960
105
0.97

50 balls
Box size: 40x40x40
Ball diameter: 1.0
The diameter is an average in the un-binned, variable-size case.
In the binned case, all balls have the same diameter.

Note:  The times for the binned implementation remained nearly flat, with some up and down fluctuation.  One would expect the times to increase monotonicly, but the number of triangles I used isn't large enough to put it into this regime.  Even with 960 triangles per ball, the running time is dominated by overhead costs and timing noise.  Beyond 960 triangles per object, the precomputation and startup cost of populating the scene is extremely long, so I didn't test larger values.

Time per step, as a function of Object Size


Relative Diameter
Simple Impl.
msec/step
Binned Impl.
msec/step
0.05
30
0.88
0.10
31
0.66
0.15
32
0.71
0.20
32
0.95
0.25
33
1.5

50 balls
48 triangles per ball
Box size: 40x40x40
Diameter is measured relative to the width of the enclosing box.
The figure given is an average diameter in the un-binned, variable-size case.
In the binned case, all balls have the same diameter.

Note:  As before, the binned implementation is not running in its asymptotic regime so the measurements are mostly noise.  The measurements for the simple implementation increase slightly but consistently.  It was not possible to test larger diameter values because by 0.25 the box's volume was nearly packed and the balls have little freedom to move.

Source Code

Get it here.