NavigationObstacle3D

package
v0.0.0-...-535787f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 16, 2025 License: MIT Imports: 25 Imported by: 0

Documentation

Overview

An obstacle needs a navigation map and outline Instance.Vertices defined to work correctly. The outlines can not cross or overlap and are restricted to a plane projection. This means the y-axis of the vertices is ignored, instead the obstacle's global y-axis position is used for placement. The projected shape is extruded by the obstacles height along the y-axis.

Obstacles can be included in the navigation mesh baking process when Instance.AffectNavigationMesh is enabled. They do not add walkable geometry, instead their role is to discard other source geometry inside the shape. This can be used to prevent navigation mesh from appearing in unwanted places, e.g. inside "solid" geometry or on top of it. If Instance.CarveNavigationMesh is enabled the baked shape will not be affected by offsets of the navigation mesh baking, e.g. the agent radius.

With Instance.AvoidanceEnabled the obstacle can constrain the avoidance velocities of avoidance using agents. If the obstacle's vertices are wound in clockwise order, avoidance agents will be pushed in by the obstacle, otherwise, avoidance agents will be pushed out. Obstacles using vertices and avoidance can warp to a new position but should not be moved every single frame as each change requires a rebuild of the avoidance map.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsNavigationObstacle3D() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsNavigationObstacle3D

func (self *Extension[T]) AsNavigationObstacle3D() Instance

func (*Extension[T]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsNode3D

func (self *Extension[T]) AsNode3D() Node3D.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.NavigationObstacle3D

Instance of the class with convieniently typed arguments and results.

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AffectNavigationMesh

func (self Instance) AffectNavigationMesh() bool

func (Instance) AsNavigationObstacle3D

func (self Instance) AsNavigationObstacle3D() Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsNode3D

func (self Instance) AsNode3D() Node3D.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AvoidanceEnabled

func (self Instance) AvoidanceEnabled() bool

func (Instance) AvoidanceLayers

func (self Instance) AvoidanceLayers() int

func (Instance) CarveNavigationMesh

func (self Instance) CarveNavigationMesh() bool

func (Instance) GetAvoidanceLayerValue

func (self Instance) GetAvoidanceLayerValue(layer_number int) bool

Returns whether or not the specified layer of the Instance.AvoidanceLayers bitmask is enabled, given a 'layer_number' between 1 and 32.

func (Instance) GetNavigationMap

func (self Instance) GetNavigationMap() RID.NavigationMap3D

Returns the [Resource.ID] of the navigation map for this NavigationObstacle node. This function returns always the map set on the NavigationObstacle node and not the map of the abstract obstacle on the NavigationServer. If the obstacle map is changed directly with the NavigationServer API the NavigationObstacle node will not be aware of the map change. Use Instance.SetNavigationMap to change the navigation map for the NavigationObstacle and also update the obstacle on the NavigationServer.

func (Instance) GetRid

func (self Instance) GetRid() RID.NavigationObstacle3D

Returns the [Resource.ID] of this obstacle on the graphics.gd/classdb/NavigationServer3D.

func (Instance) Height

func (self Instance) Height() Float.X

func (Instance) ID

func (self Instance) ID() ID

func (Instance) Radius

func (self Instance) Radius() Float.X

func (Instance) SetAffectNavigationMesh

func (self Instance) SetAffectNavigationMesh(value bool)

func (Instance) SetAvoidanceEnabled

func (self Instance) SetAvoidanceEnabled(value bool)

func (Instance) SetAvoidanceLayerValue

func (self Instance) SetAvoidanceLayerValue(layer_number int, value bool)

Based on 'value', enables or disables the specified layer in the Instance.AvoidanceLayers bitmask, given a 'layer_number' between 1 and 32.

func (Instance) SetAvoidanceLayers

func (self Instance) SetAvoidanceLayers(value int)

func (Instance) SetCarveNavigationMesh

func (self Instance) SetCarveNavigationMesh(value bool)

func (Instance) SetHeight

func (self Instance) SetHeight(value Float.X)

func (Instance) SetNavigationMap

func (self Instance) SetNavigationMap(navigation_map RID.NavigationMap3D)

Sets the [Resource.ID] of the navigation map this NavigationObstacle node should use and also updates the obstacle on the NavigationServer.

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetRadius

func (self Instance) SetRadius(value Float.X)

func (Instance) SetUse3dAvoidance

func (self Instance) SetUse3dAvoidance(value bool)

func (Instance) SetVelocity

func (self Instance) SetVelocity(value Vector3.XYZ)

func (Instance) SetVertices

func (self Instance) SetVertices(value []Vector3.XYZ)

func (Instance) Use3dAvoidance

func (self Instance) Use3dAvoidance() bool

func (Instance) Velocity

func (self Instance) Velocity() Vector3.XYZ

func (Instance) Vertices

func (self Instance) Vertices() []Vector3.XYZ

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL