NavigationObstacle2D

package
v0.0.0-...-7325ca5 Latest Latest
Warning

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

Go to latest
Published: Jan 31, 2025 License: MIT Imports: 23 Imported by: 0

Documentation

Overview

Package NavigationObstacle2D provides methods for working with NavigationObstacle2D object instances.

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
	AsNavigationObstacle2D() Instance
}

type Instance

type Instance [1]gdclass.NavigationObstacle2D

An obstacle needs a navigation map and outline [member vertices] defined to work correctly. The outlines can not cross or overlap. Obstacles can be included in the navigation mesh baking process when [member affect_navigation_mesh] 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. If [member carve_navigation_mesh] is enabled the baked shape will not be affected by offsets of the navigation mesh baking, e.g. the agent radius. With [member avoidance_enabled] 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.

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) AsCanvasItem

func (self Instance) AsCanvasItem() CanvasItem.Instance

func (Instance) AsNavigationObstacle2D

func (self Instance) AsNavigationObstacle2D() Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsNode2D

func (self Instance) AsNode2D() Node2D.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 [member avoidance_layers] bitmask is enabled, given a [param layer_number] between 1 and 32.

func (Instance) GetNavigationMap

func (self Instance) GetNavigationMap() RID.NavigationMap2D

Returns the [RID] 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 [method set_navigation_map] to change the navigation map for the NavigationObstacle and also update the obstacle on the NavigationServer.

func (Instance) GetRid

func (self Instance) GetRid() RID.NavigationObstacle2D

Returns the [RID] of this obstacle on the [NavigationServer2D].

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 [param value], enables or disables the specified layer in the [member avoidance_layers] bitmask, given a [param 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) SetNavigationMap

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

Sets the [RID] of the navigation map this NavigationObstacle node should use and also updates the [code]obstacle[/code] on the NavigationServer.

func (Instance) SetRadius

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

func (Instance) SetVelocity

func (self Instance) SetVelocity(value Vector2.XY)

func (Instance) SetVertices

func (self Instance) SetVertices(value []Vector2.XY)

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

func (Instance) Velocity

func (self Instance) Velocity() Vector2.XY

func (Instance) Vertices

func (self Instance) Vertices() []Vector2.XY

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