【3D技术宅公社】XR数字艺术论坛  XR技术讨论 XR互动电影 定格动画

 找回密码
 立即注册

QQ登录

只需一步,快速开始

调查问卷
论坛即将给大家带来全新的技术服务,面向三围图形学、游戏、动画的全新服务论坛升级为UTF8版本后,中文用户名和用户密码中有中文的都无法登陆,请发邮件到324007255(at)QQ.com联系手动修改密码

3D技术论坛将以计算机图形学为核心,面向教育 推出国内的三维教育引擎该项目在持续研发当中,感谢大家的关注。

查看: 5464|回复: 0

NavMeshAgent 自动寻路控制组件

[复制链接]
发表于 2014-1-15 10:22:34 | 显示全部楼层 |阅读模式
本帖最后由 夜行的猫仔 于 2014-1-15 10:30 编辑

NavMeshAgentNamespace: UnityEngine
Parent class: Behaviour


Description
Navigation mesh agent.

This component is attached to a mobile character in the game to allow it to navigate the scene using the NavMesh. See the NavMesh and Pathfinding section of the manual for further details.
用于游戏角色移动过程中的自动导航。查看NavMesh 和 Pathfinding 了解更多细节。

Variables
acceleration
The maximum acceleration of an agent as it follows a path, given in units / sec^2.
angularSpeed
Maximum turning speed in (deg/s) while following a path.
autoBraking
Should the agent brake automatically to avoid overshooting the destination point?
autoRepath
Should the agent attempt to acquire a new path if the existing path becomes invalid?
autoTraverseOffMeshLink
Should the agent move via OffMeshLinks automatically?
avoidancePriority
The avoidance priority level.
baseOffset
The relative vertical displacement of the owning GameObject.
currentOffMeshLinkData
The current OffMeshLinkData.
desiredVelocity
指的是导航网格代理的期望速度,与其当前速度不是等价的. (Read Only)
destination
导航的目的地.
hasPath
Does the agent currently have a path? (Read Only)
height
The height of the agent for purposes of passing under obstacles, etc.
isOnOffMeshLink
导航网格代理当前的位置是否位于OffMeshLink? (Read Only)
isPathStale
Is the current path stale. (Read Only)
nextOffMeshLinkData
The next OffMeshLinkData on the current path.
nextPosition
顾名思义,也就是下一个位置,在Update函数中打印这个属性,你会发现打印出的结果与这个导航网格代理周游过的路径一致
obstacleAvoidanceType
The level of quality of avoidance.
path
Property to get and set the current path.
pathPending
Is a path in the process of being computed but not yet ready? (Read Only)
pathStatus
The status of the current path (complete, partial or invalid).
radius
The avoidance radius for the agent.
remainingDistance
导航网格代理离目的地还剩的距离,如果其值为0,那么代理已经到达了目的地了. (Read Only)
speed
Maximum movement speed when following a path.
steeringTarget
这个属性是相当重要的,它指的是导航网格代理在导航网格中周游时所经过的拐点. (Read Only)
stoppingDistance
Stop within this distance from the target position.
updatePosition
Should the agent update the transform position?
updateRotation
Should the agent update the transform orientation?
velocity
导航网格代理周游时的实时速度,非常重要.
walkableMask
Specifies which NavMesh layers are passable (bitfield). Changing walkableMask will make the path stale (see isPathStale)

Functions
ActivateCurrentOffMeshLink
当activated为true激活OffMeshLink.
CalculatePath
Calculate a path to a specified point and store the resulting path.
CompleteOffMeshLink
让导航网格代理完成在OffMeshLink上的周游.
FindClosestEdge
Locate the closest NavMesh edge.
GetLayerCost
Gets the cost for crossing ground of a particular type.
Move
让导航网格代理朝向量v的世界坐标系方向平移v的长度
Raycast
Trace a straight path towards a target postion in the NavMesh without moving the agent.
ResetPath
Clears the current path.
Resume
恢复寻路状态,此时角色会在上一次执行了Stop函数停下来后恢复当时的状态,目的地为上一次的目的地
SamplePathPosition
Sample a position along the current path.
SetDestination
设置目的地,与nma.destination = v一样,这个函数在设置目的地成功后返回true,否则返回false,就只比调用属性多了一个返回值.
SetLayerCost
Sets the cost for traversing over geometry of the layer type.
SetPath
Assign a new path to this agent.
Stop
让导航网格代理停暂停寻路,但此寻路状态可以靠
Resume
函数恢复到寻路状态,并且目的地也与上次一样.
Warp
Warps agent to the provided position.



手机版|小黑屋|3D数字艺术论坛 ( 沪ICP备14023054号 )

GMT+8, 2024-4-27 20:40

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表