摘要
在虚拟仿真过程中,准确高效的完成模型空间碰撞检测是一项技术难点。针对不断复杂化的虚拟场景,提出了一种融合包围盒智能算法。考虑到虚拟场景的变换特性,使包围盒对场景内模型具有良好的适应性,利用模型在xyz坐标平面的投影倾角和紧密度来确定使用AABB或者OBB。AABB包围盒在矢量方向存在厚度,为避免三角面片计算时对效率产生影响,设计了一种无厚度优化AABB包围盒,用以快速排除非相交模型。OBB包围盒具有更好的方向优势,但是OBB包围盒容易产生方向倾斜,于是对OBB包围盒的分布问题进行优化。为防止存在结构差异的AABB与OBB结合后拉低遍历速度,设计了双层二叉树结构来降低遍历深度。碰撞检测过程可转换为包围盒内部模型采样特征点的寻优,于是引入粒子群算法进行迭代。通过仿真,得到算法的帧计算时间为0.025ms,帧更新占比为2.481%,每帧树节点为317,碰撞检测的平均时间为15.69ms。结果表明算法显著压缩了空间和时间消耗,有效提高了虚拟场景碰撞检测的效率,同时具有良好的检测准确性。
In the process of virtual simulation, the accurate and efficient completion of model space is a technical difficulty. Aiming at the increasingly complex virtual scene, this paper proposes an intelligent algorithm of merging bounding box. Considering the transformation characteristics of virtual scene, the bounding box has good adaptability to the model in the scene, and AABB or OBB was determined by the projection angle and compactness of the model in XYZ coordinate plane. AABB bounding box has thickness in vector direction. In order to avoid the influence of triangular patch calculation on efficiency, a thickness free optimized AABB bounding box was designed to quickly exclude non intersecting models. OBB bounding box has better direction advantage, but OBB bounding box is easy to produce direction tilt, so the distribution of OBB bounding box was optimized. In order to prevent the structure difference AABB and OBB combine to slow down the traversal speed, a double-layer binary tree structure was designed to reduce the traversal depth. The process of collision detection can be transformed into the optimization of the sampling feature points of the inner model of the bounding box, so the particle swarm optimization algorithm was introduced for iteration. The simulation experiment result shows that the frame calculation time of the algorithm is 0.025 ms, the frame update ratio is 2.481%, each frame tree node is 317, and the average collision detection time is 15.69 ms. The results indicate that the algorithm significantly reduces the space and time consumption, effectively improves the efficiency of virtual scene collision detection, and has good detection accuracy.
作者
惠学武
孟祥宇
HUI Xue-wu;MENG Xiang-yu(PLA Dalian Naval Academy,Liaoning Dalian 116013,China)
出处
《计算机仿真》
北大核心
2021年第7期209-213,共5页
Computer Simulation
关键词
虚拟场景
包围盒策略
双层二叉树
粒子群优化
碰撞检测
Virtual scene
Bounding box strategy
Bi level binary tree
Particle swarm optimization(PSO)
Collision detection