计算机与现代化 ›› 2011, Vol. 1 ›› Issue (1): 20-5.doi: 10.3969/j.issn.1006-2475.2011.01.006

• 算法分析与设计 • 上一篇    下一篇

一种基于八叉树与流水线技术的快速碰撞检测算法

李 山,赵 伟,李 菲   

  1. 吉林农业大学信息技术学院,吉林 长春 130118
  • 收稿日期:2010-09-29 修回日期:1900-01-01 出版日期:2011-01-20 发布日期:2011-01-20

An Algorithm of Rapid Collision Detection Based on Octree and Pipeline

LI Shan, ZHAO Wei, LI Fei   

  1. School of Information Technology, Jilin Agricultural University, Changchun 130118, China
  • Received:2010-09-29 Revised:1900-01-01 Online:2011-01-20 Published:2011-01-20

摘要:

针对存在大量运动物体的虚拟环境,提出一种基于空间八叉树剖分与流水线技术的并行碰撞检测算法。通过八叉树剖分,把虚拟空间剖分成一系列的子空间,然后只对同一空间中的结点进行碰撞检测。对空间内的每个物体构建包围盒树,同一空间中的任意两棵包围盒树遍历构成任务树,把任务树中的任务分配给不同的进程进行碰撞检测,并采用流水线与多线程技术,实现物体的并行碰撞检测。实验结果表明,与现有普通的基于八叉树的碰撞检测算法相比,碰撞检测效率得到明显提高。

关键词: 八叉树, 碰撞检测, 流水线, 多线程技术, 方向包围盒

Abstract:

In view of that virtual environment, where there are massive moving objects, a parallel collision detection algorithm based on octree space division and pipeline is presented. The virtual environment is divided into a series of subspaces by octree division. Then it carries on the collision detection between the nodes in the same subspace. The bounding volumes trees are established for every object in the same subspace. The task trees are established by traversing the bounding trees. The tasks are assigned different processors to deal with. Pipelining and multithreads are adopted, parallel collision detection is realized. Experiment results show that comparing with conventional collision detection based on octree, the efficiency of the algorithm is greatly improved.

Key words: octree, collision detection, pipelining, multithreading, OBB(Oriented Bounding Box)