Open 3D Engine RecastNavigation Gem API Reference
23.05.0
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
|
#include <RecastNavigationMeshComponentController.h>
Inherits Handler.
Public Member Functions | |
AZ_CLASS_ALLOCATOR (RecastNavigationMeshComponentController, AZ::SystemAllocator) | |
AZ_RTTI (RecastNavigationMeshComponentController,"{D34CD5E0-8C29-4545-8734-9C7A92F03740}") | |
RecastNavigationMeshComponentController (const RecastNavigationMeshConfig &config) | |
void | Activate (const AZ::EntityComponentIdPair &entityComponentIdPair) |
void | Deactivate () |
void | SetConfiguration (const RecastNavigationMeshConfig &config) |
const RecastNavigationMeshConfig & | GetConfiguration () const |
bool | CreateNavigationMesh (AZ::EntityId meshEntityId) |
bool | AttachNavigationTileToMesh (NavigationTileData &navigationTileData) |
NavigationTileData | CreateNavigationTile (TileGeometry *geom, const RecastNavigationMeshConfig &meshConfig, rcContext *context) |
void | ReceivedAllNewTilesImpl (const RecastNavigationMeshConfig &config, AZ::ScheduledEvent &sendNotificationEvent) |
bool | UpdateNavigationMeshBlockUntilCompleted () override |
bool | UpdateNavigationMeshAsync () override |
AZStd::shared_ptr< NavMeshQuery > | GetNavigationObject () override |
Protected Member Functions | |
void | OnSendNotificationTick () |
bool | IsDebugDrawEnabled () const |
void | OnDebugDrawTick () |
If debug draw was specified, then this call will be invoked every frame. | |
void | OnReceivedAllNewTiles () |
void | OnTileProcessedEvent (AZStd::shared_ptr< TileGeometry > tile) |
Protected Attributes | |
AZ::EntityComponentIdPair | m_entityComponentIdPair |
RecastNavigationMeshConfig | m_configuration |
In-game navigation mesh configuration. | |
AZ::ScheduledEvent | m_sendNotificationEvent { [this]() { OnSendNotificationTick(); }, AZ::Name("RecastNavigationMeshUpdated") } |
AZ::ScheduledEvent | m_tickEvent { [this]() { OnDebugDrawTick(); }, AZ::Name("RecastNavigationDebugViewTick") } |
Tick event for the optional debug draw. | |
AZ::ScheduledEvent | m_receivedAllNewTilesEvent { [this]() { OnReceivedAllNewTiles(); }, AZ::Name("RecastNavigationReceivedTiles") } |
RecastNavigationDebugDraw | m_customDebugDraw |
Debug draw object for Recast navigation mesh. | |
AZStd::unique_ptr< rcContext > | m_context |
Recast logging functionality and other optional tools. | |
AZStd::shared_ptr< NavMeshQuery > | m_navObject |
Recast navigation objects. | |
AZStd::vector < AZStd::shared_ptr < TileGeometry > > | m_tilesToBeProcessed |
AZStd::recursive_mutex | m_tileProcessingMutex |
AZStd::atomic< bool > | m_shouldProcessTiles { true } |
A way to check if we should stop tile processing (because we might be deactivating, for example). | |
AZ::TaskGraph | m_taskGraph { "RecastNavigation Tile Processing" } |
Task graph objects to process tile geometry into Recast tiles. | |
AZ::TaskExecutor | m_taskExecutor |
AZStd::unique_ptr < AZ::TaskGraphEvent > | m_taskGraphEvent |
AZ::TaskDescriptor | m_taskDescriptor { "Processing Tiles", "Recast Navigation" } |
AZStd::atomic< bool > | m_updateInProgress { false } |
If true, an update operation is in progress. | |
Friends | |
class | EditorRecastNavigationMeshComponent |
Common navigation mesh logic for Recast navigation components. Recommended use is as a base class. The method provided are not thread-safe. Use the mutex from to synchronize as necessary at the higher level.
bool RecastNavigation::RecastNavigationMeshComponentController::AttachNavigationTileToMesh | ( | NavigationTileData & | navigationTileData | ) |
Given a Recast data add a tile to the navigation mesh .
navigationTileData | the raw data of a Recast tile |
bool RecastNavigation::RecastNavigationMeshComponentController::CreateNavigationMesh | ( | AZ::EntityId | meshEntityId | ) |
Allocates and initializes Recast navigation mesh into .
meshEntityId | the entity's positions will be used as the center of the navigation mesh. |
NavigationTileData RecastNavigation::RecastNavigationMeshComponentController::CreateNavigationTile | ( | TileGeometry * | geom, |
const RecastNavigationMeshConfig & | meshConfig, | ||
rcContext * | context | ||
) |
Given a set of geometry and configuration create a Recast tile that can be attached using .
geom | A set of geometry, triangle data. |
meshConfig | Recast navigation mesh configuration. |
context | Recast context object, . |
void RecastNavigation::RecastNavigationMeshComponentController::ReceivedAllNewTilesImpl | ( | const RecastNavigationMeshConfig & | config, |
AZ::ScheduledEvent & | sendNotificationEvent | ||
) |
Creates a task graph with tasks to process received tile data.
config | navigation mesh configuration to apply to the tile data |
sendNotificationEvent | once all the tiles are processed and added to the navigation update notify on the main thread |
|
override |
RecastNavigationRequestBus overrides ...
|
protected |
Tick event to notify on navigation mesh updates from the main thread. This is often needed for script environment, such as Script Canvas.
|
protected |
Tick event to notify on navigation mesh updates from the main thread. This is often needed for script environment, such as Script Canvas.