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
    Object
    ScriptingObject
    NavCrowd
    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)
    NavCrowd
    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/NavCrowd.h
    Syntax
    public class NavCrowd : public ScriptingObject

    Constructors

    ~NavCrowd()

    Declaration
    public ~NavCrowd()

    Methods

    AddAgent(const Vector3& position, const NavAgentProperties& properties)

    Adds a new agent to the crowd.

    Declaration
    public int32 AddAgent(const Vector3& position, const NavAgentProperties& properties)
    Parameters
    Vector3 position

    The agent position.

    NavAgentProperties properties

    The agent properties.

    Returns
    int32

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

    GetAgentPosition(int32 id)

    Gets the agent current position.

    Declaration
    public Vector3 GetAgentPosition(int32 id) const
    Parameters
    int32 id

    The agent ID.

    Returns
    Vector3

    The agent current position.

    GetAgentVelocity(int32 id)

    Gets the agent current velocity (direction * speed).

    Declaration
    public Vector3 GetAgentVelocity(int32 id) const
    Parameters
    int32 id

    The agent ID.

    Returns
    Vector3

    The agent current velocity (direction * speed).

    Init(const NavAgentProperties& agentProperties, int32 maxAgents=25)

    Initializes the crowd.

    Declaration
    public bool Init(const NavAgentProperties& agentProperties, int32 maxAgents=25)
    Parameters
    NavAgentProperties agentProperties

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

    int32 maxAgents

    maximum number of agents the crowd can manage.

    Returns
    bool

    True if failed, otherwise false.

    Init(float maxAgentRadius, int32 maxAgents, NavMeshRuntime* navMesh)

    Initializes the crowd.

    Declaration
    public bool Init(float maxAgentRadius, int32 maxAgents, NavMeshRuntime* navMesh)
    Parameters
    float maxAgentRadius

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

    int32 maxAgents

    maximum number of agents the crowd can manage.

    NavMeshRuntime navMesh

    The navigation mesh to use for crowd movement planning.

    Returns
    bool

    True if failed, otherwise false.

    Init(float maxAgentRadius=100.0f, int32 maxAgents=25, NavMesh* navMesh=nullptr)

    Initializes the crowd.

    Declaration
    public bool Init(float maxAgentRadius=100.0f, int32 maxAgents=25, NavMesh* navMesh=nullptr)
    Parameters
    float maxAgentRadius

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

    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
    bool

    True if failed, otherwise false.

    RemoveAgent(int32 id)

    Removes the agent of the given ID.

    Declaration
    public void RemoveAgent(int32 id)
    Parameters
    int32 id

    ResetAgentMove(int32 id)

    Resets any movement request for the specified agent.

    Declaration
    public void ResetAgentMove(int32 id)
    Parameters
    int32 id

    The agent ID.

    SetAgentMoveTarget(int32 id, const Vector3& position)

    Updates the agent movement target position.

    Declaration
    public void SetAgentMoveTarget(int32 id, const Vector3& position)
    Parameters
    int32 id

    The agent ID.

    Vector3 position

    The agent target position.

    SetAgentMoveVelocity(int32 id, const Vector3& velocity)

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

    Declaration
    public void SetAgentMoveVelocity(int32 id, const Vector3& velocity)
    Parameters
    int32 id

    The agent ID.

    Vector3 velocity

    The agent target velocity (direction * speed).

    SetAgentPosition(int32 id, const Vector3& position)

    Sets the agent current position.

    Declaration
    public void SetAgentPosition(int32 id, const Vector3& position)
    Parameters
    int32 id

    The agent ID.

    Vector3 position

    The agent position.

    SetAgentProperties(int32 id, const NavAgentProperties& properties)

    Updates the agent properties.

    Declaration
    public void SetAgentProperties(int32 id, const NavAgentProperties& properties)
    Parameters
    int32 id

    The agent ID.

    NavAgentProperties properties

    The agent properties.

    SetAgentVelocity(int32 id, const Vector3& velocity)

    Sets the agent current velocity (direction * speed).

    Declaration
    public void SetAgentVelocity(int32 id, const Vector3& velocity)
    Parameters
    int32 id

    The agent ID.

    Vector3 velocity

    The agent velocity (direction * speed).

    Update(float dt)

    Updates the steering and positions of all agents.

    Declaration
    public void Update(float dt)
    Parameters
    float dt

    The simulation update delta time (in seconds).

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