人工智能AI 在Unity中的实现

Unity GameAI-(6)Obstacle Avoidan

2016-12-07  本文已影响179人  Levi_Wan

动态避障 Dynamic Obstacle Avoidance

Paste_Image.png Paste_Image.png

Check for collision(碰撞检测)

Paste_Image.png Paste_Image.png Paste_Image.png Paste_Image.png

计算碰撞的操控力

Calculating the Avoidance Force

Paste_Image.png Paste_Image.png

Avoidance force calculation. The dashed orange line shows the path the character will take to avoid the obstacle.

应用操控力

Paste_Image.png

碰撞检测的改进

Paste_Image.png Paste_Image.png Paste_Image.png Paste_Image.png

解决方案

Paste_Image.png

检测速度,当速度为0时,不对它添加操控力。
如果有速度,这根据这个速度的模和最大速度之间的比例进行控制。
dynamic_length的长度为0-1.

上一篇 下一篇

猜你喜欢

热点阅读