NavigationMeshSourceGeometryData3D
Container for parsed source geometry data used in navigation mesh baking.
class NavigationMeshSourceGeometryData3D
Container for parsed source geometry data used in navigation mesh baking.
Container for parsed source geometry data used in navigation mesh baking.
class NavigationMeshSourceGeometryData3D
Container for parsed source geometry data used in navigation mesh baking.
import SwiftGodot
Framework to write Godot Game Extensions using the Swift Programming Language.
class Resource
Base class for serializable objects.
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable : Equatable
A type that can be hashed into a Hasher
to produce an integer hash value.
protocol Identifiable<ID>
A class of types whose instances hold the value of an entity with stable identity.
protocol VariantRepresentable : VariantStorable
Types that conform to VariantRepresentable can be stored directly in Variant
with no conversion. These include all of the Variant types from Godot (for example GString
, Rect
, Plane
), Godot objects (those that subclass SwiftGodot.Object) as well as the built-in Swift types UInt8, Int64 and Double.
protocol VariantStorable
Types that conform to VariantStorable can be stored in a Variant and can be extracted back out of a Variant.
override class var godotClassName: StringName { get }
final var indices: PackedInt32Array { get set }
final var projectedObstructions: GArray { get set }
final var vertices: PackedFloat32Array { get set }
final func addFaces(_ faces: PackedVector3Array, xform: Transform3D)
Adds an array of vertex positions to the geometry data for navigation mesh baking to form triangulated faces. For each face the array must have three vertex positions in clockwise winding order. Since NavigationMesh
resources have no transform, all vertex positions need to be offset by the node’s transform using xform
.
final func addMesh(_ mesh: Mesh?, xform: Transform3D)
Adds the geometry data of a Mesh
resource to the navigation mesh baking data. The mesh must have valid triangulated mesh data to be considered. Since NavigationMesh
resources have no transform, all vertex positions need to be offset by the node’s transform using xform
.
final func addMeshArray(_ meshArray: GArray, xform: Transform3D)
Adds an GArray
the size of Mesh/ArrayType/arrayMax
and with vertices at index Mesh/ArrayType/arrayVertex
and indices at index Mesh/ArrayType/arrayIndex
to the navigation mesh baking data. The array must have valid triangulated mesh data to be considered. Since NavigationMesh
resources have no transform, all vertex positions need to be offset by the node’s transform using xform
.
final func addProjectedObstruction(vertices: PackedVector3Array, elevation: Double, height: Double, carve: Bool)
Adds a projected obstruction shape to the source geometry. The vertices
are considered projected on a xz-axes plane, placed at the global y-axis elevation
and extruded by height
. If carve
is true
the carved shape will not be affected by additional offsets (e.g. agent radius) of the navigation mesh baking process.
final func appendArrays(vertices: PackedFloat32Array, indices: PackedInt32Array)
Appends arrays of vertices
and indices
at the end of the existing arrays. Adds the existing index as an offset to the appended indices.
final func clear()
Clears the internal data.
final func clearProjectedObstructions()
Clears all projected obstructions.
final func hasData() -> Bool
Returns true
when parsed source geometry data exists.
final func merge(otherGeometry: NavigationMeshSourceGeometryData3D?)
Adds the geometry data of another NavigationMeshSourceGeometryData3D
to the navigation mesh baking data.