GFX
  • Docs
  • API
Search Results for

    Show / Hide Table of Contents
    • Genesis.Core
      • AssetManager
      • DirectionalLight
      • Game
      • GameElement
      • GameEventHandler
      • IGameBehavior
      • Input
      • Input.Keys
      • Layer
      • Light
      • Light2D
      • PointLight
      • Scene
      • Scene2D
      • Scene3D
      • SceneEventHandler
      • SceneSizeEvenHandler
      • Storage
      • Utils
      • Window
      • Window.WindowEventHandler
      • WindowUtilities
      • WindowUtilities.POINT
      • WindowUtilities.RECT
    • Genesis.Core.Behaviors
      • AnimationBehavior
      • CameraFlags
      • CharacterController2D
      • ControllerPreset
      • MoveDirection
      • MovementFlags
      • SpriteMovementController
    • Genesis.Core.Behaviors.Physics2D
      • BoxCollider
      • BoxRigidBody
      • BoxTrigger2D
      • BufferedSpriteCollider
      • PhysicsBox2D
      • PhysicsPolygon2D
      • Rigidbody2D
    • Genesis.Core.Behaviors.Physics3D
      • BoxCollider
      • BoxRigidBody
      • BoxTrigger
      • CapsuleCollider
      • CapsuleRigidBody
      • CompoundMeshCollider
      • ConvexHullBehavior
      • ConvexHullCollider
      • MeshCollider
      • QubeConvexHull
      • SphereCollider
      • SphereRigidBody
      • SphereTrigger
      • StaticMeshBehavior
    • Genesis.Core.Behaviors._3D
      • Stance
      • ThirdpersonCharacterController
    • Genesis.Core.GameElements
      • BufferedSprite
      • CameraElement
      • Element3D
      • Empty
      • FindPathAsynchResult
      • GridCell
      • Model
      • NavMesh
      • Obstacle
      • ParticleBuffers
      • ParticleDeffinition
      • ParticleEmitter
      • Qube
      • RectElement
      • Skybox
      • Sphere
      • Sprite
      • SpriteShapeDeffinition
      • Terrain2D
      • Terrain3D
      • TerrainData
      • Waypoint
    • Genesis.Graphics
      • Animation
      • AnimationCallback
      • AnimationCallback.AnimationEvent
      • Camera
      • CameraType
      • Face
      • Font
      • Framebuffer
      • Frustum
      • Glyphe
      • IRenderDevice
      • InstancedElement
      • InstancedMesh
      • Material
      • MaterialBuffer
      • Mesh
      • PerspectiveCamera
      • RenderInstanceContainer
      • RenderSettings
      • Shader
      • ShaderProgram
      • SpriteSheet
      • TexCoords
      • Texture
      • Viewport
    • Genesis.Graphics.Animation3D
      • Animation
      • Animator
      • AssimpNodeData
      • Bone
      • KeyPosition
      • KeyRotation
      • KeyScale
      • ModelMesh
      • boneinfo
      • vertex
    • Genesis.Graphics.Physics
      • BulletDebugRenderer
    • Genesis.Graphics.RenderDevice
      • GLRenderer
      • LegacyRenerer
    • Genesis.Graphics.Shaders.OpenGL
      • AnimatedModelShader
      • BasicShader
      • BorderCircleShader
      • DiffuseLightning
      • DiffuseNormalLightning
      • DiffuseNormalShader
      • DiffuseShader
      • DiffuseSolidShader
      • Element3DShader
      • FXScreenSpaceShadowShader
      • InstanceShader2D
      • InstancedShader
      • Light2DShader
      • LightmapShader
      • MVPRectShader
      • MVPShader
      • MVPSolidShader
      • ParticleShader
      • ScreenShader
      • SkyboxShader
      • SolidShapeShader
      • SpecularShader
      • SpriteShader
      • TerrainShader
      • WireframeShader
    • Genesis.Graphics.Shapes
      • BufferedSpriteShape
      • CircleShape
      • FrameShape
      • GlypheShape
      • Light2DShape
      • LineShape
      • PlaneShape
      • QubeShape
      • RectShape
      • Shape
      • SphereShape
      • SpriteShape
    • Genesis.Math
      • Matrix4x4
      • NoisePoint
      • PerlinNoise
      • Rect
      • Vec3
    • Genesis.Physics
      • Aabb
      • ColliderBehavior2D
      • ColliderBehavior3D
      • CollisionGroup
      • CollisionGroupExtensions
      • HitResult
      • HitResult2D
      • MatrixSet
      • MouseRay2
      • PhysicHandler
      • PhysicHandlerEvent
      • PhysicPropeterys
      • PhysicsBehavior
      • PhysicsBehaviorEvent
      • PhysicsHandler2D
      • PhysicsHandler3D
      • Ray2D
      • Raycast
      • Raycast2D
      • RigidBodyBehavior2D
      • RigidBodyBehavior3D
      • TriggerBehavior2D
      • TriggerBehavior3D
    • Genesis.UI
      • Button
      • Canvas
      • GridView
      • ImageButton
      • Label
      • ListItem
      • ListItemBehavior
      • ListSelector
      • ListSelectorBehavior
      • Panel
      • ProgressBar
      • UIEvent
      • UIParseHandler
      • UIParser
      • Widget
      • WidgetAnchor
    • Genesis.UI.Items
      • GridViewImageIcon
      • IItem

    Class NavMesh

    Represents a navigation mesh for pathfinding.

    Inheritance
    object
    GameElement
    NavMesh
    Inherited Members
    GameElement.Init(Game, IRenderDevice)
    GameElement.OnUpdate(Game, IRenderDevice)
    GameElement.OnDestroy(Game)
    GameElement.AddBehavior<T>(T)
    GameElement.AddBehavior(IGameBehavior)
    GameElement.GetBehavior<T>()
    GameElement.GetBehaviors<T>()
    GameElement.AddChild(GameElement)
    GameElement.GetInstance(GameElement)
    GameElement.HasTag(string)
    GameElement.Name
    GameElement.Tag
    GameElement.Rotation
    GameElement.Size
    GameElement.Behaviors
    GameElement.Scene
    GameElement.Enabled
    GameElement.Propertys
    GameElement.Children
    GameElement.Parent
    GameElement.UUID
    GameElement.CastShadows
    object.ToString()
    object.Equals(object)
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    Namespace: Genesis.Core.GameElements
    Assembly: Genesis.dll
    Syntax
    public class NavMesh : GameElement

    Constructors

    NavMesh(string, Vec3, int, int, float)

    Initializes a new instance of the NavMesh class.

    Declaration
    public NavMesh(string name, Vec3 location, int cellsX, int cellsY, float cellSize)
    Parameters
    Type Name Description
    string name
    Vec3 location

    The location of the navigation mesh.

    int cellsX

    The number of cells in the X direction.

    int cellsY

    The number of cells in the Y direction.

    float cellSize

    The size of each cell in the grid.

    Properties

    CellHeight

    The height of each cell in the grid.

    Declaration
    public float CellHeight { get; set; }
    Property Value
    Type Description
    float

    CellWidth

    The width of each cell in the grid.

    Declaration
    public float CellWidth { get; set; }
    Property Value
    Type Description
    float

    CellsX

    The number of cells in the X direction.

    Declaration
    public int CellsX { get; set; }
    Property Value
    Type Description
    int

    CellsY

    The number of cells in the Y direction.

    Declaration
    public int CellsY { get; set; }
    Property Value
    Type Description
    int

    Debug

    Gets or sets the value if debug mode is used

    Declaration
    public bool Debug { get; set; }
    Property Value
    Type Description
    bool

    Location

    The location of the navigation mesh in 3D space.

    Declaration
    public Vec3 Location { get; set; }
    Property Value
    Type Description
    Vec3

    StraightCost

    The cost of moving straight from one cell to another.

    Declaration
    public int StraightCost { get; set; }
    Property Value
    Type Description
    int

    UseDiagonal

    Declaration
    public bool UseDiagonal { get; set; }
    Property Value
    Type Description
    bool

    Methods

    AddObstacle(int, int)

    Adds an obstacle to the navigation mesh.

    Declaration
    public void AddObstacle(int column, int row)
    Parameters
    Type Name Description
    int column

    The column index of the cell where the obstacle is located.

    int row

    The row index of the cell where the obstacle is located.

    BuildGrid()

    Builds the grid of cells for the navigation mesh.

    Declaration
    public void BuildGrid()

    DrawGrid(IRenderDevice)

    Draws the grid cells of the navigation mesh.

    Declaration
    public void DrawGrid(IRenderDevice renderer)
    Parameters
    Type Name Description
    IRenderDevice renderer

    The renderer used to draw the grid cells.

    DrawPath(IRenderDevice, Waypoint)

    Draws the path on the navigation mesh.

    Declaration
    public void DrawPath(IRenderDevice renderer, Waypoint end)
    Parameters
    Type Name Description
    IRenderDevice renderer

    The renderer used to draw the path.

    Waypoint end

    The destination waypoint of the path.

    FindPath(int, int, int, int)

    Finds a path from the starting cell to the ending cell on the navigation mesh.

    Declaration
    public Waypoint FindPath(int sCol, int sRow, int eCol, int eRow)
    Parameters
    Type Name Description
    int sCol

    The column index of the starting cell.

    int sRow

    The row index of the starting cell.

    int eCol

    The column index of the ending cell.

    int eRow

    The row index of the ending cell.

    Returns
    Type Description
    Waypoint

    The destination waypoint of the path if found, otherwise null.

    FindPathAsync(int, int, int, int, FindPathAsynchResult)

    Finds a path from the starting cell to the ending cell on the navigation mesh.

    Declaration
    public void FindPathAsync(int sCol, int sRow, int eCol, int eRow, FindPathAsynchResult callback)
    Parameters
    Type Name Description
    int sCol

    The column index of the starting cell.

    int sRow

    The row index of the starting cell.

    int eCol

    The column index of the ending cell.

    int eRow

    The row index of the ending cell.

    FindPathAsynchResult callback

    GetGridCell(int, int)

    Get the gird cell at the given location

    Declaration
    public GridCell GetGridCell(int col, int row)
    Parameters
    Type Name Description
    int col

    The column index

    int row

    The row index

    Returns
    Type Description
    GridCell

    GetGridCellFromCoordinates(int, int)

    Get the gridd cell from coordinats (workarround)

    Declaration
    public GridCell GetGridCellFromCoordinates(int x, int y)
    Parameters
    Type Name Description
    int x
    int y
    Returns
    Type Description
    GridCell

    GetGridCellFromCoordinatesParallel(int, int)

    Declaration
    public GridCell GetGridCellFromCoordinatesParallel(int x, int y)
    Parameters
    Type Name Description
    int x
    int y
    Returns
    Type Description
    GridCell

    GetIndicesFromGridCell(GridCell)

    Declaration
    public int[] GetIndicesFromGridCell(GridCell cell)
    Parameters
    Type Name Description
    GridCell cell
    Returns
    Type Description
    int[]

    HasObstacle(GridCell)

    Checks if there is an obstacle at the specified grid cell.

    Declaration
    public bool HasObstacle(GridCell cell)
    Parameters
    Type Name Description
    GridCell cell

    The grid cell to check for obstacles.

    Returns
    Type Description
    bool

    True if there is an obstacle at the specified grid cell, otherwise false.

    IsObstacle(int, int)

    Checks if there is an obstacle at the specified cell coordinates.

    Declaration
    public bool IsObstacle(int col, int row)
    Parameters
    Type Name Description
    int col

    The column index of the cell to check.

    int row

    The row index of the cell to check.

    Returns
    Type Description
    bool

    True if there is an obstacle at the specified cell, otherwise false.

    OnRender(Game, IRenderDevice)

    Renders the navmesh

    Declaration
    public override void OnRender(Game game, IRenderDevice renderDevice)
    Parameters
    Type Name Description
    Game game
    IRenderDevice renderDevice
    Overrides
    GameElement.OnRender(Game, IRenderDevice)

    ToPath(Waypoint)

    Declaration
    public static List<Waypoint> ToPath(Waypoint waypoint)
    Parameters
    Type Name Description
    Waypoint waypoint
    Returns
    Type Description
    List<Waypoint>
    In this article
    Back to top Generated by DocFX