基于Havok引擎的物理碰撞与检测技术的研究与实现
2021-11-03林海


DOI:10.19850/j.cnki.2096-4706.2021.08.034
摘 要:在Director开发平台下首先对Havok引擎进行初始化,其次设置场景中的重力、模型质量、刚体等各方面的属性,通过Havok引擎模拟真实的物理碰撞。最后对刚体与刚体、刚体与非刚体的碰撞检测进行分析研究,得出结论:基于Havok引擎的物理碰撞与检测技术在Director开发平台下适合游戏开发、模拟复杂的物理现象等虚拟现实的制作。
关键词:刚体;Havok引擎;碰撞检测
中图分类号:TP391.9 文献标识码:A 文章编号:2096-4706(2021)08-0122-03
Research and Implementation of Physical Collision and Detection Technology Based on Havok Engine
LIN Hai
(Zhanjiang Preschool Education College,Zhanjiang 524084,China)
Abstract:Under the Director development platform,the Havok engine is initialized firstly,and then the gravity,model quality,rigid body and other attributes in the scene are set. The Havok engine simulates real physical collisions. Finally,the collision detection between rigid body and rigid body,rigid body and non-rigid body is analyzed and researched,and it is concluded that the physical collision and detection technology based on Havok engine is suitable for virtual reality production such as game development and simulation of complex physical phenomena under the Director development platform.
Keywords:rigid body;Havok engine;collision detection
0 引 言
近年来,碰撞与检测技术[1,2]已经越来越成为三维虚拟现实、机器人、动画仿真等领域研究的热点,在目前成功的商业3D虚拟现实项目中,普遍采用的碰撞检测是BSP树与包装盒相结合的方式。
基于BSP树[3]的碰撞检测主要应用于复杂形态模型的精确的碰撞检测,但它需要很长的预处理时间,因此不适合加载时运算,BSP划分经常会产生比原多边形数多三到四倍的多边形,即使不用保存颜色、法线、uv等物体信息也要增加将近一倍的内存容量。
基于包装盒的碰撞检测[4],主要应用于简单形態或者可以视其为简单形态的模型碰撞检测。采用一个正方体或者球型体包裹住3D物体对象整体来代表物体,用于描述区域,之后根据描述区域的位置与距离等信息来检测是否发生碰撞。
碰撞检测技术[5]已成为计算几何、计算机动画、仿真机器人、CAD/CAM、3D游戏开发、物理仿真等领域中的一个热点问题,而日趋复杂的虚拟环境的真实感和实时性对碰撞检测提出了更高的要求,比如,虚拟人物在场景中可以自由移动,当遇到一定高度内的障碍物能够走上去,而过高的障碍物则不能行走,遇到较小的斜坡可以走上去,陡坡过大则把人挡住,无法继续行走。……
