NavMeshObstacleΒΆ
Inherited: NativeBehaviour
DescriptionΒΆ
A navigation obstacle prevents agents from using the space occupied by its shape. The obstacle can be represented by a cylinder or a box and is automatically re-registered when its transform or geometry changes.
Public MethodsΒΆ
Public EnumsΒΆ
enum NavMeshObstacle::Shape
Defines the geometric shape used by the navigation obstacle.
Constant |
Value |
Description |
NavMeshObstacle::Cylinder |
0 |
A cylindrical obstacle described by radius() and height(). |
NavMeshObstacle::Box |
1 |
A box obstacle described by size(). |
Static MethodsΒΆ
None
Methods DescriptionΒΆ
NavMeshObstacle::NavMeshObstacle ()
Constructs a navigation obstacle with a cylindrical shape.
NavMeshObstacle::~NavMeshObstacle ()
Destroys the navigation obstacle and unregisters it from NavigationSystem.
float NavMeshObstacle::height () const
Returns the height of the obstacle.
See also setHeight().
float NavMeshObstacle::radius () const
Returns the radius of a cylindrical obstacle.
See also setRadius().
void NavMeshObstacle::registerObstacle ()
Registers the obstacle in NavigationSystem when it is not registered yet.
void NavMeshObstacle::setEnabled (bool enabled)
Reimplements: Component::setEnabled(bool enabled).
Enables or disables the obstacle.
An enabled value registers the obstacle in NavigationSystem, while a disabled value removes it from the navigation system while retaining its configuration.
void NavMeshObstacle::setHeight (float height)
Sets the height of the obstacle.
The height value sets the new size in world units and re-registers the obstacle in NavigationSystem.
See also height().
void NavMeshObstacle::setRadius (float radius)
Sets the radius of a cylindrical obstacle.
The radius value sets the new size in world units and re-registers the obstacle in NavigationSystem.
See also radius().
void NavMeshObstacle::setShape (int shape)
Sets the geometric shape of the obstacle.
The shape value selects the geometry used by the obstacle. Invalid values are ignored, and a changed value re-registers the obstacle in NavigationSystem.
See also shape().
void NavMeshObstacle::setSize (Vector3 & size)
Sets the size of a box-shaped obstacle.
The size value sets the box dimensions in world units and re-registers the obstacle in NavigationSystem.
See also size().
int NavMeshObstacle::shape () const
Returns the geometric shape of the obstacle.
See also setShape().
Vector3 NavMeshObstacle::size () const
Returns the size of a box-shaped obstacle.
See also setSize().
void NavMeshObstacle::unregisterObstacle ()
Removes the obstacle from NavigationSystem when it is registered.
void NavMeshObstacle::update ()
Reimplements: NativeBehaviour::update().
Updates the registered obstacle when its world position changes.