Inheritance #
- AudioServer
- CameraServer
- ClassDB
- DisplayServer
- EditorFileSystemDirectory
- EditorInterface
- EditorPaths
- EditorSelection
- EditorUndoRedoManager
- EditorVCSInterface
- Engine
- EngineDebugger
- FramebufferCacheRD
- GDExtensionManager
- Geometry2D
- Geometry3D
- IP
- Input
- InputMap
- JNISingleton
- JSONRPC
- JavaClassWrapper
- JavaScriptBridge
- MainLoop (1)
- Marshalls
- MovieWriter
- NativeMenu
- NavigationMeshGenerator
- NavigationServer2D
- NavigationServer3D
- Node (21)
- OS
- OpenXRExtensionWrapperExtension
- OpenXRInteractionProfileMetadata
- Performance
- PhysicsDirectBodyState2D (1)
- PhysicsDirectBodyState3D (1)
- PhysicsDirectSpaceState2D (1)
- PhysicsDirectSpaceState3D (1)
- PhysicsServer2D (1)
- PhysicsServer2DManager
- PhysicsServer3D (1)
- PhysicsServer3DManager
- PhysicsServer3DRendering
ServerHandler
- ProjectSettings
- RefCounted (121)
- RenderData (2)
- RenderSceneData (2)
- RenderingDevice
- RenderingServer
- ResourceLoader
- ResourceSaver
- ResourceUID
- ScriptLanguage (1)
- ShaderIncludeDB
- TextServerManager
- ThemeDB
- TileData
- Time
- TranslationServer
- TreeItem
- UndoRedo
- UniformSetCacheRD
- WorkerThreadPool
- XRServer
- XRVRS
- AESContext
- AStar2D
- AStar3D
- AStarGrid2D
- AudioEffectInstance (1)
- AudioSample
- AudioSamplePlayback
- AudioStreamPlayback (5)
- CameraFeed
- CharFXTransform
- ConfigFile
- Crypto
- DTLSServer
- DirAccess
- ENetConnection
- EditorContextMenuPlugin
- EditorDebuggerPlugin
- EditorDebuggerSession
- EditorExportPlatform (6)
- EditorExportPlugin
- EditorExportPreset
- EditorFeatureProfile
- EditorFileSystemImportFormatSupportQuery
- EditorInspectorPlugin
- EditorResourceConversionPlugin
- EditorResourcePreviewGenerator
- EditorResourceTooltipPlugin
- EditorSceneFormatImporter (4)
- EditorScenePostImport
- EditorScenePostImportPlugin
- EditorScript
- EditorTranslationParserPlugin
- EncodedObjectAsID
- EngineProfiler
- Expression
- FileAccess
- GLTFObjectModelProperty
- HMACContext
- HTTPClient
- HashingContext
- ImageFormatLoader (1)
- JavaClass
- JavaObject
- JavaScriptObject
- KinematicCollision2D
- KinematicCollision3D
- Lightmapper (1)
- MeshConvexDecompositionSettings
- MeshDataTool
- MultiplayerAPI (2)
- Mutex
- NavigationPathQueryParameters2D
- NavigationPathQueryParameters3D
- NavigationPathQueryResult2D
- NavigationPathQueryResult3D
- Node3DGizmo (1)
- OggPacketSequencePlayback
- OpenXRAPIExtension
- PCKPacker
- PackedDataContainerRef
- PacketPeer (8)
- PhysicsPointQueryParameters2D
- PhysicsPointQueryParameters3D
- PhysicsRayQueryParameters2D
- PhysicsRayQueryParameters3D
- PhysicsShapeQueryParameters2D
- PhysicsShapeQueryParameters3D
- PhysicsTestMotionParameters2D
- PhysicsTestMotionParameters3D
- PhysicsTestMotionResult2D
- PhysicsTestMotionResult3D
- RDAttachmentFormat
- RDFramebufferPass
- RDPipelineColorBlendState
- RDPipelineColorBlendStateAttachment
- RDPipelineDepthStencilState
- RDPipelineMultisampleState
- RDPipelineRasterizationState
- RDPipelineSpecializationConstant
- RDSamplerState
- RDShaderSource
- RDTextureFormat
- RDTextureView
- RDUniform
- RDVertexAttribute
- RandomNumberGenerator
- RegEx
- RegExMatch
- RenderSceneBuffers (2)
- RenderSceneBuffersConfiguration
- Resource (103)
- ResourceFormatLoader
- ResourceFormatSaver
- ResourceImporter (16)
- SceneState
- SceneTreeTimer
- Semaphore
- SkinReference
- StreamPeer (5)
- SurfaceTool
- TCPServer
- TLSOptions
- TextLine
- TextParagraph
- TextServer (1)
- Thread
- TranslationDomain
- TriangleMesh
- Tween
- Tweener (5)
- UDPServer
- UPNP
- UPNPDevice
- WeakRef
- WebRTCPeerConnection (1)
- XMLParser
- XRInterface (4)
- XRPose
- XRTracker (2)
- ZIPPacker
- ZIPReader
- Animation
- AnimationLibrary
- AnimationNode (6)
- AnimationNodeStateMachinePlayback
- AnimationNodeStateMachineTransition
- AudioBusLayout
- AudioEffect (17)
- AudioStream (10)
- BitMap
- BoneMap
- ButtonGroup
- CameraAttributes (2)
- ColorPalette
- Compositor
- CompositorEffect
- CryptoKey
- Curve
- Curve2D
- Curve3D
- EditorNode3DGizmoPlugin
- EditorSettings
- Environment
- Font (3)
- GDExtension
- GLTFAccessor
- GLTFAnimation
- GLTFBufferView
- GLTFCamera
- GLTFDocument (1)
- GLTFDocumentExtension (1)
- GLTFLight
- GLTFMesh
- GLTFNode
- GLTFPhysicsBody
- GLTFPhysicsShape
- GLTFSkeleton
- GLTFSkin
- GLTFSpecGloss
- GLTFState (1)
- GLTFTexture
- GLTFTextureSampler
- Gradient
- Image
- ImporterMesh
- InputEvent (6)
- JSON
- LabelSettings
- LightmapGIData
- Material (9)
- Mesh (4)
- MeshLibrary
- MissingResource
- MultiMesh
- NavigationMesh
- NavigationMeshSourceGeometryData2D
- NavigationMeshSourceGeometryData3D
- NavigationPolygon
- Noise (1)
- Occluder3D (5)
- OccluderPolygon2D
- OggPacketSequence
- OpenXRAction
- OpenXRActionMap
- OpenXRActionSet
- OpenXRBindingModifier (2)
- OpenXRHapticBase (1)
- OpenXRIPBinding
- OpenXRInteractionProfile
- PackedDataContainer
- PackedScene
- PhysicsMaterial
- PolygonPathFinder
- RDShaderFile
- RDShaderSPIRV
- RichTextEffect
- SceneReplicationConfig
- Script (3)
- Shader (1)
- ShaderInclude
- Shape2D (8)
- Shape3D (9)
- Shortcut
- SkeletonModification2D (7)
- SkeletonModificationStack2D
- SkeletonProfile (1)
- Skin
- Sky
- SpriteFrames
- StyleBox (4)
- SyntaxHighlighter (2)
- Texture (3)
- Theme
- TileMapPattern
- TileSet
- TileSetSource (2)
- Translation (1)
- VideoStream (1)
- VideoStreamPlayback
- VisualShaderNode (62)
- VoxelGIData
- World2D
- World3D
- X509Certificate
Table of contents
-
var agent_height: float = 1.5 -
var agent_max_climb: float = 0.25 -
var agent_max_slope: float = 45.0 -
var agent_radius: float = 0.5 -
var border_size: float = 0.0 -
var cell_height: float = 0.25 -
var cell_size: float = 0.25 -
var detail_sample_distance: float = 6.0 -
var detail_sample_max_error: float = 1.0 -
var edge_max_error: float = 1.3 -
var edge_max_length: float = 0.0 -
var filter_baking_aabb: AABB = AABB(0, 0, 0, 0, 0, 0) -
var filter_baking_aabb_offset: Vector3 = Vector3(0, 0, 0) -
var filter_ledge_spans: bool = false -
var filter_low_hanging_obstacles: bool = false -
var filter_walkable_low_height_spans: bool = false -
var geometry_collision_mask: int = 4294967295 -
var geometry_parsed_geometry_type = PARSED_GEOMETRY_BOTH -
var geometry_source_geometry_mode = SOURCE_GEOMETRY_ROOT_NODE_CHILDREN -
var geometry_source_group_name: StringName = &"navigation_mesh_source_group" -
var region_merge_size: float = 20.0 -
var region_min_size: float = 2.0 -
var sample_partition_type = SAMPLE_PARTITION_WATERSHED -
var vertices_per_polygon: float = 6.0 -
func add_polygon(polygon: PackedInt32Array) -> void -
func clear() -> void -
func clear_polygons() -> void -
func create_from_mesh(mesh: Mesh) -> void -
const func get_collision_mask_value(layer_number: int) -> bool -
func get_polygon(idx: int) -> PackedInt32Array -
const func get_polygon_count() -> int -
const func get_vertices() -> PackedVector3Array -
func set_collision_mask_value(value: bool) -> void -
func set_vertices(vertices: PackedVector3Array) -> void -
const SAMPLE_PARTITION_WATERSHED = 0 enum SamplePartitionType -
const SAMPLE_PARTITION_MONOTONE = 1 enum SamplePartitionType -
const SAMPLE_PARTITION_LAYERS = 2 enum SamplePartitionType -
const SAMPLE_PARTITION_MAX = 3 enum SamplePartitionType -
const PARSED_GEOMETRY_MESH_INSTANCES = 0 enum ParsedGeometryType -
const PARSED_GEOMETRY_STATIC_COLLIDERS = 1 enum ParsedGeometryType -
const PARSED_GEOMETRY_BOTH = 2 enum ParsedGeometryType -
const PARSED_GEOMETRY_MAX = 3 enum ParsedGeometryType -
const SOURCE_GEOMETRY_ROOT_NODE_CHILDREN = 0 enum SourceGeometryMode -
const SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN = 1 enum SourceGeometryMode -
const SOURCE_GEOMETRY_GROUPS_EXPLICIT = 2 enum SourceGeometryMode -
const SOURCE_GEOMETRY_MAX = 3 enum SourceGeometryMode -
enum SamplePartitionType -
enum ParsedGeometryType -
enum SourceGeometryMode
NavigationMesh #
is_refcounted, is_instantiable, resource, core, not_builtin_classes
A navigation mesh that defines traversable areas and obstacles.
A navigation mesh is a collection of polygons that define which areas of an environment are traversable to aid agents in pathfinding through complicated spaces.
Members #
var agent_height: float = 1.5#
The minimum floor to ceiling height that will still allow the floor area to be considered walkable.
Note: While baking, this value will be rounded up to the nearest multiple of cell_height.
var agent_max_climb: float = 0.25#
The minimum ledge height that is considered to still be traversable.
Note: While baking, this value will be rounded down to the nearest multiple of cell_height.
var agent_max_slope: float = 45.0#
The maximum slope that is considered walkable, in degrees.
var agent_radius: float = 0.5#
The distance to erode/shrink the walkable area of the heightfield away from obstructions.
Note: While baking, this value will be rounded up to the nearest multiple of cell_size.
var border_size: float = 0.0#
The size of the non-navigable border around the bake bounding area.
In conjunction with the filter_baking_aabb and a edge_max_error value at 1.0 or below the border size can be used to bake tile aligned navigation meshes without the tile edges being shrunk by agent_radius.
Note: While baking and not zero, this value will be rounded up to the nearest multiple of cell_size.
var cell_height: float = 0.25#
The cell height used to rasterize the navigation mesh vertices on the Y axis. Must match with the cell height on the navigation map.
var cell_size: float = 0.25#
The cell size used to rasterize the navigation mesh vertices on the XZ plane. Must match with the cell size on the navigation map.
var detail_sample_distance: float = 6.0#
The sampling distance to use when generating the detail mesh, in cell unit.
var detail_sample_max_error: float = 1.0#
The maximum distance the detail mesh surface should deviate from heightfield, in cell unit.
var edge_max_error: float = 1.3#
The maximum distance a simplified contour's border edges should deviate the original raw contour.
var edge_max_length: float = 0.0#
The maximum allowed length for contour edges along the border of the mesh. A value of 0.0 disables this feature.
Note: While baking, this value will be rounded up to the nearest multiple of cell_size.
var filter_baking_aabb: AABB = AABB(0, 0, 0, 0, 0, 0)#
If the baking AABB has a volume the navigation mesh baking will be restricted to its enclosing area.
var filter_baking_aabb_offset: Vector3 = Vector3(0, 0, 0)#
The position offset applied to the filter_baking_aabb AABB.
var filter_ledge_spans: bool = false#
If true, marks spans that are ledges as non-walkable.
var filter_low_hanging_obstacles: bool = false#
If true, marks non-walkable spans as walkable if their maximum is within agent_max_climb of a walkable neighbor.
var filter_walkable_low_height_spans: bool = false#
If true, marks walkable spans as not walkable if the clearance above the span is less than agent_height.
var geometry_collision_mask: int = 4294967295#
The physics layers to scan for static colliders.
Only used when geometry_parsed_geometry_type is PARSED_GEOMETRY_STATIC_COLLIDERS or PARSED_GEOMETRY_BOTH.
var geometry_parsed_geometry_type = PARSED_GEOMETRY_BOTH#
Determines which type of nodes will be parsed as geometry. See ParsedGeometryType for possible values.
var geometry_source_geometry_mode = SOURCE_GEOMETRY_ROOT_NODE_CHILDREN#
The source of the geometry used when baking. See SourceGeometryMode for possible values.
var geometry_source_group_name: StringName = &"navigation_mesh_source_group"#
The name of the group to scan for geometry.
Only used when geometry_source_geometry_mode is SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN or SOURCE_GEOMETRY_GROUPS_EXPLICIT.
var region_merge_size: float = 20.0#
Any regions with a size smaller than this will be merged with larger regions if possible.
Note: This value will be squared to calculate the number of cells. For example, a value of 20 will set the number of cells to 400.
var region_min_size: float = 2.0#
The minimum size of a region for it to be created.
Note: This value will be squared to calculate the minimum number of cells allowed to form isolated island areas. For example, a value of 8 will set the number of cells to 64.
var sample_partition_type = SAMPLE_PARTITION_WATERSHED#
Partitioning algorithm for creating the navigation mesh polys. See SamplePartitionType for possible values.
var vertices_per_polygon: float = 6.0#
The maximum number of vertices allowed for polygons generated during the contour to polygon conversion process.
Methods #
func add_polygon(polygon: PackedInt32Array) -> void#
Adds a polygon using the indices of the vertices you get when calling get_vertices.
func clear() -> void#
Clears the internal arrays for vertices and polygon indices.
func clear_polygons() -> void#
Clears the array of polygons, but it doesn't clear the array of vertices.
func create_from_mesh(mesh: Mesh) -> void#
Initializes the navigation mesh by setting the vertices and indices according to a Mesh.
Note: The given mesh must be of type Mesh.PRIMITIVE_TRIANGLES and have an index array.
const func get_collision_mask_value(layer_number: int) -> bool#
Returns whether or not the specified layer of the geometry_collision_mask is enabled, given a layer_number between 1 and 32.
func get_polygon(idx: int) -> PackedInt32Array#
Returns a PackedInt32Array containing the indices of the vertices of a created polygon.
const func get_polygon_count() -> int#
Returns the number of polygons in the navigation mesh.
const func get_vertices() -> PackedVector3Array#
Returns a PackedVector3Array containing all the vertices being used to create the polygons.
func set_collision_mask_value(value: bool) -> void#
Based on value, enables or disables the specified layer in the geometry_collision_mask, given a layer_number between 1 and 32.
func set_vertices(vertices: PackedVector3Array) -> void#
Sets the vertices that can be then indexed to create polygons with the add_polygon method.
Annotations #
Constants #
const SAMPLE_PARTITION_WATERSHED = 0 enum SamplePartitionType#
Watershed partitioning. Generally the best choice if you precompute the navigation mesh, use this if you have large open areas.
const SAMPLE_PARTITION_MONOTONE = 1 enum SamplePartitionType#
Monotone partitioning. Use this if you want fast navigation mesh generation.
const SAMPLE_PARTITION_LAYERS = 2 enum SamplePartitionType#
Layer partitioning. Good choice to use for tiled navigation mesh with medium and small sized tiles.
const SAMPLE_PARTITION_MAX = 3 enum SamplePartitionType#
Represents the size of the SamplePartitionType enum.
const PARSED_GEOMETRY_MESH_INSTANCES = 0 enum ParsedGeometryType#
Parses mesh instances as geometry. This includes MeshInstance3D, CSGShape3D, and GridMap nodes.
const PARSED_GEOMETRY_STATIC_COLLIDERS = 1 enum ParsedGeometryType#
Parses StaticBody3D colliders as geometry. The collider should be in any of the layers specified by geometry_collision_mask.
const PARSED_GEOMETRY_BOTH = 2 enum ParsedGeometryType#
Both PARSED_GEOMETRY_MESH_INSTANCES and PARSED_GEOMETRY_STATIC_COLLIDERS.
const PARSED_GEOMETRY_MAX = 3 enum ParsedGeometryType#
Represents the size of the ParsedGeometryType enum.
const SOURCE_GEOMETRY_ROOT_NODE_CHILDREN = 0 enum SourceGeometryMode#
Scans the child nodes of the root node recursively for geometry.
const SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN = 1 enum SourceGeometryMode#
Scans nodes in a group and their child nodes recursively for geometry. The group is specified by geometry_source_group_name.
const SOURCE_GEOMETRY_GROUPS_EXPLICIT = 2 enum SourceGeometryMode#
Uses nodes in a group for geometry. The group is specified by geometry_source_group_name.
const SOURCE_GEOMETRY_MAX = 3 enum SourceGeometryMode#
Represents the size of the SourceGeometryMode enum.
Constructors #
Enums #
SamplePartitionType#
enum SamplePartitionType {
SAMPLE_PARTITION_WATERSHED = 0,
SAMPLE_PARTITION_MONOTONE = 1,
SAMPLE_PARTITION_LAYERS = 2,
SAMPLE_PARTITION_MAX = 3,
}ParsedGeometryType#
enum ParsedGeometryType {
PARSED_GEOMETRY_MESH_INSTANCES = 0,
PARSED_GEOMETRY_STATIC_COLLIDERS = 1,
PARSED_GEOMETRY_BOTH = 2,
PARSED_GEOMETRY_MAX = 3,
}SourceGeometryMode#
enum SourceGeometryMode {
SOURCE_GEOMETRY_ROOT_NODE_CHILDREN = 0,
SOURCE_GEOMETRY_GROUPS_WITH_CHILDREN = 1,
SOURCE_GEOMETRY_GROUPS_EXPLICIT = 2,
SOURCE_GEOMETRY_MAX = 3,
}