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 ¶
- type Advanced
- type Any
- type Extension
- type ID
- type Instance
- func (self Instance) AffectNavigationMesh() bool
- func (self Instance) AsNavigationObstacle3D() Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode3D() Node3D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AvoidanceEnabled() bool
- func (self Instance) AvoidanceLayers() int
- func (self Instance) CarveNavigationMesh() bool
- func (self Instance) GetAvoidanceLayerValue(layer_number int) bool
- func (self Instance) GetNavigationMap() RID.NavigationMap3D
- func (self Instance) GetRid() RID.NavigationObstacle3D
- func (self Instance) Height() Float.X
- func (self Instance) ID() ID
- func (self Instance) Radius() Float.X
- func (self Instance) SetAffectNavigationMesh(value bool)
- func (self Instance) SetAvoidanceEnabled(value bool)
- func (self Instance) SetAvoidanceLayerValue(layer_number int, value bool)
- func (self Instance) SetAvoidanceLayers(value int)
- func (self Instance) SetCarveNavigationMesh(value bool)
- func (self Instance) SetHeight(value Float.X)
- func (self Instance) SetNavigationMap(navigation_map RID.NavigationMap3D)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetRadius(value Float.X)
- func (self Instance) SetUse3dAvoidance(value bool)
- func (self Instance) SetVelocity(value Vector3.XYZ)
- func (self Instance) SetVertices(value []Vector3.XYZ)
- func (self Instance) Use3dAvoidance() bool
- func (self Instance) Velocity() Vector3.XYZ
- func (self Instance) Vertices() []Vector3.XYZ
- func (self Instance) Virtual(name string) reflect.Value
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 Extension ¶
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 ¶
type 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.
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 (Instance) AffectNavigationMesh ¶
func (Instance) AsNavigationObstacle3D ¶
func (Instance) AvoidanceEnabled ¶
func (Instance) AvoidanceLayers ¶
func (Instance) CarveNavigationMesh ¶
func (Instance) GetAvoidanceLayerValue ¶
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) SetAffectNavigationMesh ¶
func (Instance) SetAvoidanceEnabled ¶
func (Instance) SetAvoidanceLayerValue ¶
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 (Instance) SetCarveNavigationMesh ¶
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.