Search Results for

    Show / Hide Table of Contents

    Class Navigation

    The navigation service used for path finding and agents navigation system.

    Inheritance
    System.Object
    Navigation
    Namespace: FlaxEngine
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    [Unmanaged]
    public static class Navigation : Object

    Properties

    IsBuildingNavMesh

    Returns true if navigation system is during navmesh building (any request is valid or async task active).

    Declaration
    [Unmanaged]
    public static bool IsBuildingNavMesh { get; }
    Property Value
    System.Boolean

    NavMeshBuildingProgress

    Gets the navmesh building progress (normalized to range 0-1).

    Declaration
    [Unmanaged]
    public static float NavMeshBuildingProgress { get; }
    Property Value
    System.Single

    Methods

    BuildNavMesh(Scene, BoundingBox, Single)

    Builds the Nav Mesh for the given scene (builds only the tiles overlapping the given bounding box).

    Declaration
    [Unmanaged]
    public static void BuildNavMesh(Scene scene, BoundingBox dirtyBounds, float timeoutMs = 50F)
    Parameters
    Scene scene

    The scene.

    BoundingBox dirtyBounds

    The bounds in world-space to build overlapping tiles.

    System.Single timeoutMs

    The timeout to wait before building Nav Mesh (in milliseconds).

    Remarks

    Requests are enqueued till the next game scripts update. Actual navmesh building in done via Thread Pool tasks in a background to prevent game thread stalls.

    BuildNavMesh(Scene, Single)

    Builds the Nav Mesh for the given scene (discards all its tiles).

    Declaration
    [Unmanaged]
    public static void BuildNavMesh(Scene scene, float timeoutMs = 50F)
    Parameters
    Scene scene

    The scene.

    System.Single timeoutMs

    The timeout to wait before building Nav Mesh (in milliseconds).

    Remarks

    Requests are enqueued till the next game scripts update. Actual navmesh building in done via Thread Pool tasks in a background to prevent game thread stalls.

    FindClosestPoint(Vector3, out Vector3)

    Finds the nearest point on a nav mesh surface.

    Declaration
    [Unmanaged]
    public static bool FindClosestPoint(Vector3 point, out Vector3 result)
    Parameters
    Vector3 point

    The source point.

    Vector3 result

    The result position on the navmesh (valid only if method returns true).

    Returns
    System.Boolean

    True if found valid location on the navmesh, otherwise false.

    FindDistanceToWall(Vector3, out NavMeshHit, Single)

    Finds the distance from the specified start position to the nearest polygon wall.

    Declaration
    [Unmanaged]
    public static bool FindDistanceToWall(Vector3 startPosition, out NavMeshHit hitInfo, float maxDistance = 3.40282347E+38F)
    Parameters
    Vector3 startPosition

    The start position.

    NavMeshHit hitInfo

    The result hit information. Valid only when query succeed.

    System.Single maxDistance

    The maximum distance to search for wall (search radius).

    Returns
    System.Boolean

    True if ray hits an matching object, otherwise false.

    FindPath(Vector3, Vector3, out Vector3[])

    Finds the path between the two positions presented as a list of waypoints stored in the corners array.

    Declaration
    [Unmanaged]
    public static bool FindPath(Vector3 startPosition, Vector3 endPosition, out Vector3[] resultPath)
    Parameters
    Vector3 startPosition

    The start position.

    Vector3 endPosition

    The end position.

    Vector3[] resultPath

    The result path.

    Returns
    System.Boolean

    True if found valid path between given two points (it may be partial), otherwise false if failed.

    FindRandomPoint(out Vector3)

    Finds random location on nav mesh.

    Declaration
    [Unmanaged]
    public static bool FindRandomPoint(out Vector3 result)
    Parameters
    Vector3 result

    The result position on the navmesh (valid only if method returns true).

    Returns
    System.Boolean

    True if found valid location on the navmesh, otherwise false.

    FindRandomPointAroundCircle(Vector3, Single, out Vector3)

    Finds random location on nav mesh within the reach of specified location.

    Declaration
    [Unmanaged]
    public static bool FindRandomPointAroundCircle(Vector3 center, float radius, out Vector3 result)
    Parameters
    Vector3 center

    The source point to find random location around it.

    System.Single radius

    The search distance for a random point. Maximum distance for a result point from the center of the circle.

    Vector3 result

    The result position on the navmesh (valid only if method returns true).

    Returns
    System.Boolean

    True if found valid location on the navmesh, otherwise false.

    ProjectPoint(Vector3, out Vector3)

    Projects the point to nav mesh surface (finds the nearest polygon). [Deprecated in v1.8]

    Declaration
    [Unmanaged]
    public static bool ProjectPoint(Vector3 point, out Vector3 result)
    Parameters
    Vector3 point

    The source point.

    Vector3 result

    The result position on the navmesh (valid only if method returns true).

    Returns
    System.Boolean

    True if found valid location on the navmesh, otherwise false.

    RayCast(Vector3, Vector3, out NavMeshHit)

    Casts a 'walkability' ray along the surface of the navigation mesh from the start position toward the end position.

    Declaration
    [Unmanaged]
    public static bool RayCast(Vector3 startPosition, Vector3 endPosition, out NavMeshHit hitInfo)
    Parameters
    Vector3 startPosition

    The start position.

    Vector3 endPosition

    The end position.

    NavMeshHit hitInfo

    The result hit information. Valid only when query succeed.

    Returns
    System.Boolean

    True if ray hits an matching object, otherwise false.

    TestPath(Vector3, Vector3)

    Tests the path between the two positions (non-partial).

    Declaration
    [Unmanaged]
    public static bool TestPath(Vector3 startPosition, Vector3 endPosition)
    Parameters
    Vector3 startPosition

    The start position.

    Vector3 endPosition

    The end position.

    Returns
    System.Boolean

    True if found valid path between given two points, otherwise false if failed.

    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat