Bounding Volume Hierarchies for Collision Detection
51 At present, there are several well-known BVs such as spheres Liu et al., 2007, Axis Aligned
Bounding Box AABB Zhang and Kim, 2007, Weller et al., 2006, Tu and Yu, 2009, Oriented Bounding Box OBB Chang et al., 2009, Gottschalk et al., 1996, Tu and Yu, 2009, Discrete
Oriented Polytope k-DOP Klosowski et al., 1998, Oriented Convex Polyhedra Bade et al., 2006, and hybrid combination BV Kockara, 2007.
3.2 BVH cost function
This section will describe the overview of hierarchical method that is used in the proposed urban simulation. BVH is proven to be the most efficient method for collision detection
Sulaiman et al., 2009, Chang et al., 2008, Bergen, 2004, Bergen, 1999. Thus, in this research, the hierarchical cost function that has been used by previous researchers will be used. Basic
cost function was first formulated by Weghorst et al., 1984 for hierarchical method in ray tracing and later was applied by Gottschalk et al., 1996 and enhanced by Klosowski et al.,
1998. The calculation of execution time is formulated as follows:
T =
N
v
X C
v
+ N
p
X C
p
+ N
u
X C
u
+ C
o
1 Where
T : total execution time for detecting interference
N
v
: number of BV pairs overlap tests C
v
: time require for testing a pair of bounding-volumes N
p
: numbers of primitive pairs overlap tests C
p
: time require for testing a pair of primitives for interference N
u
: numbers of nodes that need to be updated C
u
: cost of updating each node C
o
: Cost of one-time processing From the formula 1, N
v
shows the number of the BV that is currently overlapped when the objects has come into contact while N
p
shows number of the primitive itself when overlapped. Given of example of two rigid bodies that enclosed with their BVHs. When both
objects come into contact, the system will calculated how much BV between these two rigid bodies has been overlapped and we also measure its C
v
. Next, the system also will store the information of the number of primitive inside the BVs that need to perform intersection test
in order to determine the exact number of primitives that currently overlapping and with the C
p
to measure time require to test each primitive-primitive testing. Meanwhile, N
u
takes into account the numbers of nodes that need to be updated once the intersection has
occurred where each node has a BV and few primitives inside. C
u
is the time taken to update each node while C
o
is for any additional time taken for transformation update or coordinate update of each objects.
The formula shows that the most important factors that determine the performance of collision detection between rigid bodies are the tightness of bounding-volumes and the
simplicity of bounding-volumes. When we have lower number of overlap tests lower N
v
and N
p
per intersection between two rigid bodies for example, the object must be bounded with tight bounding-volumes and will eventually decrease the potential of object
interference hence increase performance. However when we enclosed the objects with simple bounding-volumes lower C
v
and C
p
, it is resulting significant increment of the
www.intechopen.com
Computer Graphics
52 intersection tests between bounding-volumes. Minimizing one value will cause another
value to increase. This is the challenge in all collision detection to find which one is the most important.
4. References