Search Results for

    Show / Hide Table of Contents

    Class NavMeshRuntime

    The navigation mesh runtime object that builds the navmesh from all loaded scenes.

    Inheritance
    Object
    ScriptingObject
    NavMeshRuntime
    Inherited Members
    ScriptingObject::_gcHandle
    ScriptingObject::_id
    ScriptingObject::_type
    ScriptingObject::CanCast(const ScriptingTypeHandle& from, const ScriptingTypeHandle& to)
    ScriptingObject::CanCast(const MClass* from, const MClass* to)
    ScriptingObject::Cast(ScriptingObject* obj)
    ScriptingObject::ChangeID(const Guid& newId)
    ScriptingObject::CreateManaged()
    ScriptingObject::CreateManagedInternal()
    ScriptingObject::Deleted
    Object::DeleteObject(float timeToLive = 0.0f, bool useGameTime=false)
    Object::DeleteObjectNow()
    ScriptingObject::DestroyManaged()
    Object::Flags
    ScriptingObject::FromInterface(void* interfaceObj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::FromInterface(T* interfaceObj)
    ScriptingObject::GetClass()
    ScriptingObject::GetID()
    ScriptingObject::GetManagedInstance()
    ScriptingObject::GetOrCreateManagedInstance()
    ScriptingObject::GetType()
    ScriptingObject::GetTypeHandle()
    ScriptingObject::HasManagedInstance()
    ScriptingObject::Is(const ScriptingTypeHandle& type)
    ScriptingObject::Is(const MClass* type)
    ScriptingObject::Is()
    ScriptingObject::IsRegistered()
    ScriptingObject::NewObject(const ScriptingTypeHandle& typeHandle)
    ScriptingObject::NewObject()
    ScriptingObject::OnDeleteObject()
    ScriptingObject::OnManagedInstanceDeleted()
    ScriptingObject::OnScriptingDispose()
    ScriptingObject::RegisterObject()
    ScriptingObject::ScriptingObject(const SpawnParams& params)
    ScriptingObject::SetManagedInstance(MObject* instance)
    NavMeshRuntime
    ScriptingObject::ToInterface(ScriptingObject* obj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::ToInterface(ScriptingObject* obj)
    ScriptingObject::ToManaged(const ScriptingObject* obj)
    ScriptingObject::ToNative(MObject* obj)
    ScriptingObject::ToString()
    ScriptingObject::UnregisterObject()
    Object::~Object()
    ScriptingObject::~ScriptingObject()
    Assembly: FlaxEngine.dll
    File: Engine/Navigation/NavMeshRuntime.h
    Syntax
    public class NavMeshRuntime : public ScriptingObject

    Constructors

    ~NavMeshRuntime()

    Declaration
    public ~NavMeshRuntime()

    DEPRECATED("Use FindClosestPoint instead")

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

    Declaration
    public DEPRECATED("Use FindClosestPoint instead") bool ProjectPoint(const Vector3& point
    Parameters
    "Use FindClosestPoint instead" NavMeshRuntime_DEPRECATED__Use_FindClosestPoint_instead__

    NavMeshRuntime(const NavMeshProperties& properties)

    Declaration
    public NavMeshRuntime(const NavMeshProperties& properties)
    Parameters
    NavMeshProperties properties

    Fields

    const

    Declaration
    public Vector3result const{
        return FindClosestPoint(point, result)
    Field Value
    Vector3result

    Locker

    The object locker.

    Declaration
    public CriticalSection Locker
    Field Value
    CriticalSection

    NavAreasColors

    Declaration
    public static Color NavAreasColors[64]
    Field Value
    Color

    NavAreasCosts

    Declaration
    public static float NavAreasCosts[64]
    Field Value
    float

    Properties

    The navigation mesh properties.

    Declaration
    public NavMeshProperties Properties
    Field Value
    NavMeshProperties

    Methods

    AddTile(NavMesh* navMesh, NavMeshTileData& tileData)

    Adds the tile from the given scene to the runtime navmesh.

    Declaration
    public void AddTile(NavMesh* navMesh, NavMeshTileData& tileData)
    Parameters
    NavMesh navMesh

    The navigation mesh.

    NavMeshTileData tileData

    The tile data.

    AddTiles(NavMesh* navMesh)

    Adds the tiles from the given scene to the runtime navmesh.

    Declaration
    public void AddTiles(NavMesh* navMesh)
    Parameters
    NavMesh navMesh

    The navigation mesh.

    DebugDraw()

    Declaration
    public void DebugDraw()

    Dispose()

    Releases the navmesh.

    Declaration
    public void Dispose()

    EnsureCapacity(int32 tilesToAddCount)

    Ensures the navmesh capacity for adding new tiles. Performs resizing if needed.

    Declaration
    public void EnsureCapacity(int32 tilesToAddCount)
    Parameters
    int32 tilesToAddCount

    The new tiles amount.

    FindClosestPoint(const Vector3& point, Vector3& result)

    Finds the nearest point on a nav mesh surface.

    Declaration
    public bool FindClosestPoint(const Vector3& point, Vector3& result) const
    Parameters
    Vector3 point

    The source point.

    Vector3 result

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

    Returns
    bool

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

    FindDistanceToWall(const Vector3& startPosition, NavMeshHit& hitInfo, float maxDistance=MAX_float)

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

    Declaration
    public bool FindDistanceToWall(const Vector3& startPosition, NavMeshHit& hitInfo, float maxDistance=MAX_float) const
    Parameters
    Vector3 startPosition

    The start position.

    NavMeshHit hitInfo

    The result hit information. Valid only when query succeed.

    float maxDistance

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

    Returns
    bool

    True if ray hits an matching object, otherwise false.

    FindPath(const Vector3& startPosition, const Vector3& endPosition, Array<Vector3, HeapAllocation>& resultPath)

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

    Declaration
    public bool FindPath(const Vector3& startPosition, const Vector3& endPosition, Array<Vector3, HeapAllocation>& resultPath) const
    Parameters
    Vector3 startPosition

    The start position.

    Vector3 endPosition

    The end position.

    Array<Vector3, HeapAllocation> resultPath

    The result path.

    Returns
    bool

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

    FindPath(const Vector3& startPosition, const Vector3& endPosition, Array<Vector3, HeapAllocation>& resultPath, NavMeshPathFlags& resultFlags)

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

    Declaration
    public bool FindPath(const Vector3& startPosition, const Vector3& endPosition, Array<Vector3, HeapAllocation>& resultPath, NavMeshPathFlags& resultFlags) const
    Parameters
    Vector3 startPosition

    The start position.

    Vector3 endPosition

    The end position.

    Array<Vector3, HeapAllocation> resultPath

    The result path.

    NavMeshPathFlags resultFlags

    The result path flags.

    Returns
    bool

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

    FindRandomPoint(Vector3& result)

    Finds random location on nav mesh.

    Declaration
    public bool FindRandomPoint(Vector3& result) const
    Parameters
    Vector3 result

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

    Returns
    bool

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

    FindRandomPointAroundCircle(const Vector3& center, float radius, Vector3& result)

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

    Declaration
    public bool FindRandomPointAroundCircle(const Vector3& center, float radius, Vector3& result) const
    Parameters
    Vector3 center

    The source point to find random location around it.

    float 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
    bool

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

    Get()

    Declaration
    public static NavMeshRuntime* Get()
    Returns
    NavMeshRuntime

    Get(const NavAgentProperties& agentProperties)

    Declaration
    public static NavMeshRuntime* Get(const NavAgentProperties& agentProperties)
    Parameters
    NavAgentProperties agentProperties

    Returns
    NavMeshRuntime

    Get(const NavMeshProperties& navMeshProperties, bool createIfMissing=false)

    Declaration
    public static NavMeshRuntime* Get(const NavMeshProperties& navMeshProperties, bool createIfMissing=false)
    Parameters
    NavMeshProperties navMeshProperties

    bool createIfMissing

    Returns
    NavMeshRuntime

    Get(const StringView& navMeshName)

    Declaration
    public static NavMeshRuntime* Get(const StringView& navMeshName)
    Parameters
    StringView navMeshName

    Returns
    NavMeshRuntime

    GetNavMesh()

    Declaration
    public dtNavMesh* GetNavMesh() const
    Returns
    dtNavMesh

    GetNavMeshQuery()

    Declaration
    public dtNavMeshQuery* GetNavMeshQuery() const
    Returns
    dtNavMeshQuery

    GetTilesCapacity()

    Declaration
    public int32 GetTilesCapacity() const
    Returns
    int32

    GetTileSize()

    Gets the size of the tile (in world-units). Returns zero if not initialized yet.

    Declaration
    public float GetTileSize() const
    Returns
    float

    RayCast(const Vector3& startPosition, const Vector3& endPosition, NavMeshHit& hitInfo)

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

    Declaration
    public bool RayCast(const Vector3& startPosition, const Vector3& endPosition, NavMeshHit& hitInfo) const
    Parameters
    Vector3 startPosition

    The start position.

    Vector3 endPosition

    The end position.

    NavMeshHit hitInfo

    The result hit information. Valid only when query succeed.

    Returns
    bool

    True if ray hits an matching object, otherwise false.

    RemoveTile(int32 x, int32 y, int32 layer)

    Removes the tile from the navmesh.

    Declaration
    public void RemoveTile(int32 x, int32 y, int32 layer)
    Parameters
    int32 x

    The tile X coordinate.

    int32 y

    The tile Y coordinate.

    int32 layer

    The tile layer.

    RemoveTiles(bool(*prediction)(const NavMeshRuntime* navMesh, const NavMeshTile& tile, void* customData), void* userData)

    Removes all the tiles that custom prediction callback marks.

    Declaration
    public void RemoveTiles(bool(*prediction)(const NavMeshRuntime* navMesh, const NavMeshTile& tile, void* customData), void* userData)
    Parameters
    bool()(NavMeshRuntime navMesh, NavMeshTiletile, void customData) prediction

    The prediction callback, returns true for tiles to remove and false for tiles to preserve.

    void userData

    The user data passed to the callback method.

    RemoveTiles(NavMesh* navMesh)

    Removes all the tiles from the navmesh that has been added from the given navigation scene.

    Declaration
    public void RemoveTiles(NavMesh* navMesh)
    Parameters
    NavMesh navMesh

    The navigation mesh.

    SetTileSize(float tileSize)

    Sets the size of the tile (if not assigned). Disposes the mesh if added tiles have different size.

    Declaration
    public void SetTileSize(float tileSize)
    Parameters
    float tileSize

    The size of the tile.

    TestPath(const Vector3& startPosition, const Vector3& endPosition)

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

    Declaration
    public bool TestPath(const Vector3& startPosition, const Vector3& endPosition) const
    Parameters
    Vector3 startPosition

    The start position.

    Vector3 endPosition

    The end position.

    Returns
    bool

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

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat