ArrayFormat
Mesh.swift:136struct ArrayFormatstruct ArrayFormatimport SwiftGodotFramework to write Godot Game Extensions using the Swift Programming Language.
class MeshA Resource that contains vertex array-based geometry.
override class var godotClassName: StringName { get }final var lightmapSizeHint: Vector2i { get set }Sets a hint to be used for lightmap resolution.
func _getAabb() -> AABB Virtual method to override the AABB for a custom class extending Mesh.
func _getBlendShapeCount() -> Int32 Virtual method to override the number of blend shapes for a custom class extending Mesh.
func _getBlendShapeName(index: Int32) -> StringName Virtual method to override the retrieval of blend shape names for a custom class extending Mesh.
func _getSurfaceCount() -> Int32 Virtual method to override the surface count for a custom class extending Mesh.
func _setBlendShapeName(index: Int32, name: StringName) Virtual method to override the names of blend shapes for a custom class extending Mesh.
func _surfaceGetArrayIndexLen(index: Int32) -> Int32 Virtual method to override the surface array index length for a custom class extending Mesh.
func _surfaceGetArrayLen(index: Int32) -> Int32 Virtual method to override the surface array length for a custom class extending Mesh.
func _surfaceGetArrays(index: Int32) -> GArray Virtual method to override the surface arrays for a custom class extending Mesh.
func _surfaceGetBlendShapeArrays(index: Int32) -> VariantCollection<GArray> Virtual method to override the blend shape arrays for a custom class extending Mesh.
func _surfaceGetFormat(index: Int32) -> UInt32 Virtual method to override the surface format for a custom class extending Mesh.
func _surfaceGetLods(index: Int32) -> GDictionary Virtual method to override the surface LODs for a custom class extending Mesh.
func _surfaceGetMaterial(index: Int32) -> Material? Virtual method to override the surface material for a custom class extending Mesh.
func _surfaceGetPrimitiveType(index: Int32) -> UInt32 Virtual method to override the surface primitive type for a custom class extending Mesh.
func _surfaceSetMaterial(index: Int32, material: Material?) Virtual method to override the setting of a material at the given index for a custom class extending Mesh.
final func createConvexShape(clean: Bool = true, simplify: Bool = false) -> ConvexPolygonShape3D? Calculate a ConvexPolygonShape3D from the mesh.
final func createOutline(margin: Double) -> Mesh? Calculate an outline mesh at a defined offset (margin) from the original mesh.
final func createPlaceholder() -> Resource? Creates a placeholder version of this resource (PlaceholderMesh).
final func createTrimeshShape() -> ConcavePolygonShape3D? Calculate a ConcavePolygonShape3D from the mesh.
final func generateTriangleMesh() -> TriangleMesh? Generate a TriangleMesh from the mesh. Considers only surfaces using one of these primitive types: .primitiveTriangles, .primitiveTriangleStrip.
final func getAabb() -> AABB Returns the smallest AABB enclosing this mesh in local space. Not affected by custom_aabb.
final func getFaces() -> PackedVector3Array Returns all the vertices that make up the faces of the mesh. Each three vertices represent one triangle.
final func getSurfaceCount() -> Int32 Returns the number of surfaces that the Mesh holds. This is equivalent to getSurfaceOverrideMaterialCount.
final func surfaceGetArrays(surfIdx: Int32) -> GArray Returns the arrays for the vertices, normals, UVs, etc. that make up the requested surface (see addSurfaceFromArrays(primitive:arrays:blendShapes:lods:flags:)).
final func surfaceGetBlendShapeArrays(surfIdx: Int32) -> VariantCollection<GArray> Returns the blend shape arrays for the requested surface.
final func surfaceGetMaterial(surfIdx: Int32) -> Material? Returns a Material in a given surface. Surface is rendered using this material.
final func surfaceSetMaterial(surfIdx: Int32, material: Material?) Sets a Material for a given surface. Surface will be rendered using this material.
enum ArrayCustomFormatenum ArrayTypeenum BlendShapeModeenum PrimitiveTypeclass PlaceholderMeshPlaceholder class for a mesh.
protocol CustomDebugStringConvertibleA type with a customized textual representation suitable for debugging purposes.
protocol EquatableA type that can be compared for value equality.
protocol ExpressibleByArrayLiteralA type that can be initialized using an array literal.
protocol OptionSet : RawRepresentable, SetAlgebraA type that presents a mathematical set interface to a bit set.
protocol RawRepresentable<RawValue>A type that can be converted to and from an associated raw value.
protocol SetAlgebra<Element> : Equatable, ExpressibleByArrayLiteralA type that provides mathematical set operations.
init(rawValue: Int) static let compressFlagsBase: Mesh.ArrayFormatShift of first compress flag. Compress flags should be passed to addSurfaceFromArrays(primitive:arrays:blendShapes:lods:flags:) and commit(existing:flags:).
static let flagCompressAttributes: Mesh.ArrayFormatFlag used to mark that a mesh is using compressed attributes (vertices, normals, tangents, UVs). When this form of compression is enabled, vertex positions will be packed into an RGBA16UNORM attribute and scaled in the vertex shader. The normal and tangent will be packed into an RG16UNORM representing an axis, and a 16-bit float stored in the A-channel of the vertex. UVs will use 16-bit normalized floats instead of full 32-bit signed floats. When using this compression mode you must use either vertices, normals, and tangents or only vertices. You cannot use normals without tangents. Importers will automatically enable this compression if they can.
static let flagUse2dVertices: Mesh.ArrayFormatFlag used to mark that the array contains 2D vertices.
static let flagUse8BoneWeights: Mesh.ArrayFormatFlag used to mark that the mesh contains up to 8 bone influences per vertex. This flag indicates that .arrayBones and .arrayWeights elements will have double length.
static let flagUseDynamicUpdate: Mesh.ArrayFormatFlag indices that the mesh data will use GL_DYNAMIC_DRAW on GLES. Unused on Vulkan.
static let flagUsesEmptyVertexArray: Mesh.ArrayFormatFlag used to mark that the mesh intentionally contains no vertex array.
static let formatBlendShapeMask: Mesh.ArrayFormatMask of mesh channels permitted in blend shapes.
static let formatBones: Mesh.ArrayFormatMesh array contains bones.
static let formatColor: Mesh.ArrayFormatMesh array contains colors.
static let formatCustom0: Mesh.ArrayFormatMesh array contains custom channel index 0.
static let formatCustom0Shift: Mesh.ArrayFormatAmount to shift ArrayCustomFormat for custom channel index 0.
static let formatCustom1: Mesh.ArrayFormatMesh array contains custom channel index 1.
static let formatCustom1Shift: Mesh.ArrayFormatAmount to shift ArrayCustomFormat for custom channel index 1.
static let formatCustom2: Mesh.ArrayFormatMesh array contains custom channel index 2.
static let formatCustom2Shift: Mesh.ArrayFormatAmount to shift ArrayCustomFormat for custom channel index 2.
static let formatCustom3: Mesh.ArrayFormatMesh array contains custom channel index 3.
static let formatCustom3Shift: Mesh.ArrayFormatAmount to shift ArrayCustomFormat for custom channel index 3.
static let formatCustomBase: Mesh.ArrayFormatShift of first custom channel.
static let formatCustomBits: Mesh.ArrayFormatNumber of format bits per custom channel. See ArrayCustomFormat.
static let formatCustomMask: Mesh.ArrayFormatMask of custom format bits per custom channel. Must be shifted by one of the SHIFT constants. See ArrayCustomFormat.
static let formatIndex: Mesh.ArrayFormatMesh array uses indices.
static let formatNormal: Mesh.ArrayFormatMesh array contains normals.
static let formatTangent: Mesh.ArrayFormatMesh array contains tangents.
static let formatTexUv: Mesh.ArrayFormatMesh array contains UVs.
static let formatTexUv2: Mesh.ArrayFormatMesh array contains second UV.
static let formatVertex: Mesh.ArrayFormatMesh array contains vertices. All meshes require a vertex array so this should always be present.
static let formatWeights: Mesh.ArrayFormatMesh array contains bone weights.
var debugDescription: String { get }A textual representation of this instance, suitable for debugging
let rawValue: Intinit() Creates an empty option set.
init<S>(_ sequence: S) where S : Sequence, Self.Element == S.Element Creates a new set from a finite sequence of items.
init(arrayLiteral: Self.Element...) Creates a set containing the elements of the given array literal.
var isEmpty: Bool { get }A Boolean value that indicates whether the set has no elements.
static func != (lhs: Self, rhs: Self) -> Bool Returns a Boolean value indicating whether two values are not equal.
func contains(_ member: Self) -> Bool Returns a Boolean value that indicates whether a given element is a member of the option set.
mutating func formIntersection(_ other: Self) Removes all elements of this option set that are not also present in the given set.
mutating func formSymmetricDifference(_ other: Self) Replaces this set with a new set containing all elements contained in either this set or the given set, but not in both.
mutating func formUnion(_ other: Self) Inserts the elements of another set into this option set.
@discardableResult mutating func insert(_ newMember: Self.Element) -> (inserted: Bool, memberAfterInsert: Self.Element) Adds the given element to the option set if it is not already a member.
func intersection(_ other: Self) -> Self Returns a new option set with only the elements contained in both this set and the given set.
func isDisjoint(with other: Self) -> Bool Returns a Boolean value that indicates whether the set has no members in common with the given set.
func isStrictSubset(of other: Self) -> Bool Returns a Boolean value that indicates whether this set is a strict subset of the given set.
func isStrictSuperset(of other: Self) -> Bool Returns a Boolean value that indicates whether this set is a strict superset of the given set.
func isSubset(of other: Self) -> Bool Returns a Boolean value that indicates whether the set is a subset of another set.
func isSuperset(of other: Self) -> Bool Returns a Boolean value that indicates whether the set is a superset of the given set.
@discardableResult mutating func remove(_ member: Self.Element) -> Self.Element? Removes the given element and all elements subsumed by it.
mutating func subtract(_ other: Self) Removes the elements of the given set from this set.
func subtracting(_ other: Self) -> Self Returns a new set containing the elements of this set that do not occur in the given set.
func symmetricDifference(_ other: Self) -> Self Returns a new option set with the elements contained in this set or in the given set, but not in both.
func union(_ other: Self) -> Self Returns a new option set of the elements contained in this set, in the given set, or in both.
@discardableResult mutating func update(with newMember: Self.Element) -> Self.Element? Inserts the given element into the set.