zoukankan      html  css  js  c++  java
  • Navigation and Pathfinding

    Navigation and Pathfinding

    术语:

      1)NavMesh 

      2)NavMesh Agent

      3)Off-Mesh Link

      4)NavMesh Obstacle

       

       A common algorithm to find the path is A* (pronounced “A star”), which is what Unity uses.

       Unity is using reciprocal velocity obstacles (RVO) to predict and prevent collisions.

      对于开放式场景,轨迹线不适用,NaviMesh此时就派上用场了。Unity的导航系统在已有的Mesh基础上生成一个新的FloorMesh,也叫NaviMesh。通过(menu: Window > Navigation)可以打开Navigation编辑器。

      

      

      Navigation Static:是否根据此网格生成Navimesh。

      OffMeshLink Generator:是否生成从此网格出发的Link。

      Navigation Layer:层。

      Bake页中包含更多内容。

      

      Radius: The Radius determines how close a navigating character can get to a wall and consequently the width of the narrowest gap between two walls that can it can squeeze through. 

      Height:efers to the height of the “ceiling” above the navmesh surface - an area may not be reachable simply because there is not enough headroom for the character

      Max Slope:parameter sets the threshold of steepness where a ramp becomes a wall

      Step Height: the maximum height of bump or step in the floor surface that is ignored by the character (any step greater than this height results in a disconnected walkable area rather than a continuation of the same area).

    Off-mesh link

    1、Manually create Off-Mesh Link.

      

      添加Off-mesh Link的步骤:

      1. First create two cylinders: Game Object > 3D Object > cylinder.
      2. You can scale the cylinders to (0.1, 0.5, 0.1) to make it easier to work with them.
      3. Move the first cylinder at the edge of the top platform, close to the NavMesh
         surface.
      4. Place the second cylinder on the ground, close to the NavMesh, at the location where the link should land.
      5. Select the cylinder on the left and add an Off-Mesh Link component to it. Choose Add Component from the inspector and choose Navigation > Off Mesh Link.
      6. Assign the leftmost cylinder in the Start field and rightmost cylinder in the End field.

    参考:https://docs.unity3d.com/Manual/nav-CreateOffMeshLink.html

    2、Building Off-Mesh Link Automatically.

      

      

      1、Drop-Down link generation is controlled by the Drop Height parameter. The parameter controls what is the highest drop that will be connected, setting the value to 0 will disable the generation.  

      2、Jump-Across link generation is controlled by the Jump Distance parameter. The parameter controls what is the furthest distance that will be connected. Setting the value to 0 will disable the generation.

    参考:https://docs.unity3d.com/Manual/nav-BuildingOffMeshLinksAutomatically.html

    Enabling a Character to Navigate

      

      

    更多资料参考:~/Unity/Editor/Data/Documentation/html/en/Manual/Navigation.html

      

  • 相关阅读:
    Vue.js 样式绑定
    Vue.js 监听属性
    【BZOJ2438】[中山市选2011]杀人游戏 Tarjan
    【BZOJ2150】部落战争 最小流
    【BZOJ4247】挂饰 背包
    【BZOJ2794】[Poi2012]Cloakroom 离线+背包
    【BZOJ1731】[Usaco2005 dec]Layout 排队布局 差分约束
    【BZOJ1058】[ZJOI2007]报表统计 STL
    【BZOJ1449/2895】[JSOI2009]球队收益/球队预算 最小费用最大流
    【BZOJ1280】Emmy卖猪pigs 最大流
  • 原文地址:https://www.cnblogs.com/tekkaman/p/4179408.html
Copyright © 2011-2022 走看看