Search Results for

    Show / Hide Table of Contents

    Class NavCrowd

    Navigation steering behaviors system for a group of agents. Handles avoidance between agents by using an adaptive RVO sampling calculation.

    Inheritance
    System.Object
    Object
    NavCrowd
    Inherited Members
    Object.__unmanagedPtr
    Object.__internalId
    Object.Finalize()
    Object.As<T>()
    Object.NewValue(Type)
    Object.New(String)
    Object.Find<T>(Guid, Boolean)
    Object.Find(Guid, Type, Boolean)
    Object.TryFind<T>(Guid)
    Object.TryFind(Guid, Type)
    Object.Destroy(Object, Single)
    Object.DestroyNow(Object)
    Object.Destroy<T>(T, Single)
    Object.Equals(Object)
    Object.GetUnmanagedPtr(Object)
    Object.GetUnmanagedInterface(Object, Type)
    Object.FromUnmanagedPtr(IntPtr)
    Object.MapObjectID(Guid)
    Object.RemapObjectID(Guid)
    Object.GetHashCode()
    Object.ID
    Object.TypeName
    Namespace: FlaxEngine
    Assembly: FlaxEngine.CSharp.dll
    Syntax
    [Unmanaged]
    public class NavCrowd : Object

    Constructors

    NavCrowd()

    Initializes a new instance of the NavCrowd.

    Declaration
    public NavCrowd()

    Methods

    AddAgent(Vector3, NavAgentProperties)

    Adds a new agent to the crowd.

    Declaration
    [Unmanaged]
    public int AddAgent(Vector3 position, NavAgentProperties properties)
    Parameters
    Vector3 position

    The agent position.

    NavAgentProperties properties

    The agent properties.

    Returns
    System.Int32

    The agent unique ID or -1 if failed to add it (eg. too many active agents).

    GetAgentPosition(Int32)

    Gets the agent current position.

    Declaration
    [Unmanaged]
    public Vector3 GetAgentPosition(int id)
    Parameters
    System.Int32 id

    The agent ID.

    Returns
    Vector3

    The agent current position.

    GetAgentVelocity(Int32)

    Gets the agent current velocity (direction * speed).

    Declaration
    [Unmanaged]
    public Vector3 GetAgentVelocity(int id)
    Parameters
    System.Int32 id

    The agent ID.

    Returns
    Vector3

    The agent current velocity (direction * speed).

    Init(NavAgentProperties, Int32)

    Initializes the crowd.

    Declaration
    [Unmanaged]
    public bool Init(NavAgentProperties agentProperties, int maxAgents = 25)
    Parameters
    NavAgentProperties agentProperties

    The properties of the agents that will be added to the crowd.

    System.Int32 maxAgents

    maximum number of agents the crowd can manage.

    Returns
    System.Boolean

    True if failed, otherwise false.

    Init(Single, Int32, NavMesh)

    Initializes the crowd.

    Declaration
    [Unmanaged]
    public bool Init(float maxAgentRadius = 100F, int maxAgents = 25, NavMesh navMesh = null)
    Parameters
    System.Single maxAgentRadius

    The maximum radius of any agent that will be added to the crowd.

    System.Int32 maxAgents

    maximum number of agents the crowd can manage.

    NavMesh navMesh

    The navigation mesh to use for crowd movement planning. Use null to pick the first navmesh.

    Returns
    System.Boolean

    True if failed, otherwise false.

    RemoveAgent(Int32)

    Removes the agent of the given ID.

    Declaration
    [Unmanaged]
    public void RemoveAgent(int id)
    Parameters
    System.Int32 id

    ResetAgentMove(Int32)

    Resets any movement request for the specified agent.

    Declaration
    [Unmanaged]
    public void ResetAgentMove(int id)
    Parameters
    System.Int32 id

    The agent ID.

    SetAgentMoveTarget(Int32, Vector3)

    Updates the agent movement target position.

    Declaration
    [Unmanaged]
    public void SetAgentMoveTarget(int id, Vector3 position)
    Parameters
    System.Int32 id

    The agent ID.

    Vector3 position

    The agent target position.

    SetAgentMoveVelocity(Int32, Vector3)

    Updates the agent movement target velocity (direction * speed).

    Declaration
    [Unmanaged]
    public void SetAgentMoveVelocity(int id, Vector3 velocity)
    Parameters
    System.Int32 id

    The agent ID.

    Vector3 velocity

    The agent target velocity (direction * speed).

    SetAgentPosition(Int32, Vector3)

    Sets the agent current position.

    Declaration
    [Unmanaged]
    public void SetAgentPosition(int id, Vector3 position)
    Parameters
    System.Int32 id

    The agent ID.

    Vector3 position

    The agent position.

    SetAgentProperties(Int32, NavAgentProperties)

    Updates the agent properties.

    Declaration
    [Unmanaged]
    public void SetAgentProperties(int id, NavAgentProperties properties)
    Parameters
    System.Int32 id

    The agent ID.

    NavAgentProperties properties

    The agent properties.

    SetAgentVelocity(Int32, Vector3)

    Sets the agent current velocity (direction * speed).

    Declaration
    [Unmanaged]
    public void SetAgentVelocity(int id, Vector3 velocity)
    Parameters
    System.Int32 id

    The agent ID.

    Vector3 velocity

    The agent velocity (direction * speed).

    Update(Single)

    Updates the steering and positions of all agents.

    Declaration
    [Unmanaged]
    public void Update(float dt)
    Parameters
    System.Single dt

    The simulation update delta time (in seconds).

    Extension Methods

    Extensions.ReflectiveCompare<T>(T, T)
    Extensions.DeepClone<T>(T)
    Extensions.RawClone<T>(T)
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat