针对碰撞检测的实时性和逼真度较差的缺陷,提出一种新的混合碰撞检测算法。该算法在空间剖分阶段采用八叉树技术有效降低了层次划分树的深度,提高了层次划分树的构建速度,快速剔除了不可能相交的基元对。在精确检测阶段,采用同时向下遍历的方法并结合时空相关性对层次包围盒树的遍历过程进行优化,利用三角形与两面交线的位置关系快速判定两异面三角形的位置关系,并采用元素分配法避免了对公共元素的重复测试和无用的元素对测试,使基元相交测试的效率显著提高。实验结果证明,与经典的Rapid算法相比,该算法有效地减少了碰撞检测的时间开销,提高了碰撞检测的实时性和真实感。
For the poor real-time property and fidelity defects in collision detection,this paper proposes a new hybrid collision detection algorithm. In the stage of space subdivision,the algorithm selects octree technology to reduce the depth of the hierarchy division tree effectively,accelerates the speed of the hierarchy division tree construction,and quickly weeds out the primitive pairs could not be intersected. In precise detection stage,the algorithm optimises the traversal process of hierarchical bounding box tree by adopting the method of simultaneously downward traversal and in conjunction with the spatiotemporal coherence,and uses the relations between triangles and the two-side intersection line to quickly judge the positional relationship between two triangles both with different planes,and uses element distribution method to avoid the repeated testing of common elements and useless test of elements pairs,and these make the efficiency of the primitive pair intersection test improve significantly. Experimental results prove that,compared with the classic Rapid algorithm,this algorithm effectively reduces the time cost of collision detection,and improves the real-time property and fidelity of collision detection.