Kaim::CylinderObstacle Class Reference

Kaim::CylinderObstacle Class Reference

#include <cylinderobstacle.h>

Class Description

CylinderObstacles represent dynamic objects of your game engine that prevent your Bots from moving freely in a vertical cylinder volume.

This is especially recommended for player representation. You can also use this for cylindric obstacles that cannot tilt (if your obstacle can tilt, you must use a BoxObstacle).

By default CylinderObstacles are integrated in avoidance trajectory computation. If your game obstacle does not move, you can set DoesTriggerTagVolume to true to make Autodesk Navigation spawn and manage a TagVolume around the CylinderObstacle that will be integrated into the DynamicNavMesh.

+ Examples:

Inherits Kaim::WorldElement.

Main API Functions

 CylinderObstacle ()
 
 CylinderObstacle (const CylinderObstacleInitConfig &initConfig)
 
virtual ~CylinderObstacle ()
 
void Init (const CylinderObstacleInitConfig &initConfig)
 Sets m_world and allocates memory depending on m_databaseBinding but does not add the CylinderObstacle to the world. More...
 
void Clear ()
 Prepares this instance for destruction or reuse; it sets all members to their default values, and clears memory of PointSpatialization. More...
 
void AddToWorld ()
 Adds the CylinderObstacle to the World: it becomes active in the simulation, it is updated, taken into account by Bots, etc., and it increments the RefCount of this instance. More...
 
void RemoveFromWorld ()
 Removes the CylinderObstacle from the World: it is removed from the simulation, it is no longer updated, it is ignored by Bots, and the RefCount of this instance is decremented by 1. More...
 
void SetPosition (const Vec3f &position)
 
void SetVelocity (const Vec3f &velocity)
 The CylinderObstacle velocity expressed in meter per seconds. More...
 
void SetDoesTriggerTagVolume (bool triggerTagVolume)
 This information is copied and applied in the next World::Update. More...
 

Getters

const DynamicNavTag & GetNavTag () const
 
const SpatializedCylinderGetSpatializedCylinder () const
 
SpatializedCylinderGetSpatializedCylinder ()
 
KyFloat32 GetRadius () const
 
KyFloat32 GetHeight () const
 Used only for visual debugging. Not relevant for navigation. More...
 
const Vec3fGetPosition () const
 
const Vec3fGetVelocity () const
 
bool DoesTriggerTagVolume () const
 
const TagVolumeGetTagVolume () const
 
TagVolume::IntegrationStatus GetTagVolumeIntegrationStatus () const
 
const DatabaseBindingGetDatabaseBinding () const
 

For internal use only

virtual void DoSendVisualDebug (VisualDebugServer &server, VisualDebugSendChangeEvent changeEvent)
 
void UpdateSpatialization ()
 
void SetupTagVolumeInitConfig (TagVolumeInitConfig &tagVolumeInitConfig)
 
void OnTagVolumeIntegration ()
 

Input

Vec3f m_position
 
Vec3f m_velocity
 The CylinderObstacle velocity expressed in meter per seconds. More...
 
bool m_doesTriggerTagVolume
 
DynamicNavTag m_navTag
 
Ptr< DatabaseBindingm_databaseBinding
 

Obstacle state

TagVolumeTrigger< CylinderObstaclem_tagVolumeTrigger
 
SpatializedCylinder m_spatializedCylinder
 

Main API Functions

bool IsAddedToWorld () const
 
WorldGetWorld () const
 
KyUInt32 GetVisualDebugId () const
 
void * GetUserData () const
 
void SetUserData (void *userData)
 

Visual Debug

void SetCurrentVisualDebugLOD (VisualDebugLOD lod)
 Set the visual debug level of details to use for this WorldElement instance. More...
 
VisualDebugLOD GetCurrentVisualDebugLOD () const
 
VisualDebugLOD GetPreviousVisualDebugLod () const
 
void SendVisualDebug (VisualDebugServer &server)
 
void ForceSendAllVisualDebug ()
 Call this when something impacts all your visual debug data. More...
 

For internal use only

void SendForMaxLevelOfDetail (VisualDebugServer &server, const Vec3f &shapePosition)
 
void RegisterToVisualDebug ()
 
void UnRegisterFromVisualDebug ()
 
KyUInt32 GetIndexInCollection () const
 
void SetIndexInCollection (KyUInt32 indexInCollection)
 

Member Function Documentation

void Kaim::CylinderObstacle::AddToWorld ( )

Adds the CylinderObstacle to the World: it becomes active in the simulation, it is updated, taken into account by Bots, etc., and it increments the RefCount of this instance.

NOTE: this method has immediate effect: ensure to call this outside of any Autodesk Navigation computation (World::Update() or threaded query computation). However, the spatialization is not updated immediately, this will be done in next World::Update().

+ Examples:
void Kaim::CylinderObstacle::Clear ( )

Prepares this instance for destruction or reuse; it sets all members to their default values, and clears memory of PointSpatialization.

void Kaim::WorldElement::ForceSendAllVisualDebug ( )
inlineinherited

Call this when something impacts all your visual debug data.

It will set the event to VisualDebugSendChangeEvent_ForceSendAll. (called internally when connecting with a VisualDebug client).

KyFloat32 Kaim::CylinderObstacle::GetHeight ( ) const
inline

Used only for visual debugging. Not relevant for navigation.

void Kaim::CylinderObstacle::Init ( const CylinderObstacleInitConfig initConfig)

Sets m_world and allocates memory depending on m_databaseBinding but does not add the CylinderObstacle to the world.

Does not modify the world. If m_world is already set, Clear() is called. Asserts if initConfig.m_world is NULL.

+ Examples:
void Kaim::CylinderObstacle::RemoveFromWorld ( )

Removes the CylinderObstacle from the World: it is removed from the simulation, it is no longer updated, it is ignored by Bots, and the RefCount of this instance is decremented by 1.

NOTE: this method has immediate effect: ensure to call this outside of any Autodesk Navigation computation (Kaim::World::Update or threaded query computation). The spatialization information are immediately invalidated too.

+ Examples:
void Kaim::WorldElement::SetCurrentVisualDebugLOD ( VisualDebugLOD  lod)
inlineinherited

Set the visual debug level of details to use for this WorldElement instance.

Generally, setting this to VisualDebugLOD_Minimal, sends almost nothing but position and status, whereas setting it to VisualDebugLOD_Maximal sends all available debug information including spatialization and some internal algorithm results.

void Kaim::CylinderObstacle::SetDoesTriggerTagVolume ( bool  triggerTagVolume)
inline

This information is copied and applied in the next World::Update.

Setting to true will trigger a TagVolume for this CylinderObstacle during the next World::Update. The TagVolume will then be integrated into the DynamicNavMesh, and the obstacle will be no longer be integrated into avoidance computation. While set to true, the position is not updated. If the obstacle triggering a TagVolume is moved, set to false, wait at least one frame to ensure the CylinderObstacle is updated, then set it back to true once your obstacle is stationary again.

+ Examples:
void Kaim::CylinderObstacle::SetVelocity ( const Vec3f velocity)
inline

The CylinderObstacle velocity expressed in meter per seconds.

+ Examples:

Member Data Documentation

Vec3f Kaim::CylinderObstacle::m_velocity
private

The CylinderObstacle velocity expressed in meter per seconds.


The documentation for this class was generated from the following files: