Unity3D 官方文档 NavMesh三个组件的翻译与解释 自动寻路需要知道的细节

版本:unity 5.4.1  语言:C#

 

总起:

最近研究的ARPG游戏中,敌人AI的寻路就使用到了NavMesh,Unity该套组件倒也不复杂:三个组件和一个烘培的Map。我这边不讲基础怎么使用,主要是翻译一下各个组件的属性,说说需要注意的事情。主要参考就是官方文档和自己在Unity中的一些实践。

 

NavMesh中实现了A*算法作为底层的算法,使用NavMesh Agent可以作为角色的目标路径查找代理,而NavMesh Obstacle则是动态的一些障碍物,Off-Mesh Link作为特殊路径点的连接,并且可以与Animator动画组件实现经过特殊路径的动画,比如开门,连接门内门外的路径点,并执行Animator中的开门动画,这样的需求就可以用Off-Mesh Link来实现。

 

寻路三大组件:

NavMesh Agent

    NavMeshAgent用于角色的寻路代理,可以在预先烘培的NavMesh中找到目标的一条路线,并且尽可能的规避其他的Agent和Obstacle。(直接官方贴图拿来用了)



Radius  Radius of the agent, used to calculate collisions between obstacles and other agents.

agent的半径,用于计算该agent和其他agent、obstacle的碰撞。

 

Height  The height clearance the agent needs to pass below an obstacle overhead.

agent的高度,agent可以通过的头顶障碍最小高度。

 

Base offset  Offset of the collision cylinder in relation to the transform pivot point.

agent圆柱碰撞体中心点的偏移值。当Agent创建后,圆柱碰撞体显示过高或过低,用于将其调整到地面。

 

Speed  Maximum movement speed (in world units per second).

agent移动的最大速度(世界空间中以秒单位计算)

 

Angular Speed  Maximum speed of rotation (degrees per second).

agent最大的旋转速度(角度每秒)

 

Acceleration  Maximum acceleration (in world units per second squared).

agent最大的加速度(世界空间单位每秒的平方)

 

Stopping distance  The agent will stop when this close to the goal location.

agent靠近目标时停下的距离

 

Auto Braking  When enabled, the agent will slow down when reaching the destination. You should disable this for behaviors such patrolling, where the agent should move smoothly between multiple points

自动刹车(我总看成baking)

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值