ArrayFormat
Mesh.swift:136struct ArrayFormat
Other members in extension
View members
Hide members
This section is hidden by default because it contains too many (32) members.
Types
Type members
Instance members
var lightmapSizeHint: Vector2i
Sets a hint to be used for lightmap resolution.
func createConvexShape(clean: Bool, simplify: Bool
) -> ConvexPolygonShape3D? Calculate a
ConvexPolygonShape3D
from the mesh.func createOutline(margin: Double
) -> Mesh? Calculate an outline mesh at a defined offset (margin) from the original mesh.
func createPlaceholder(
) -> Resource? Creates a placeholder version of this resource (
PlaceholderMesh
).func createTrimeshShape(
) -> ConcavePolygonShape3D? Calculate a
ConcavePolygonShape3D
from the mesh.func generateTriangleMesh(
) -> TriangleMesh? Generate a
TriangleMesh
from the mesh. Considers only surfaces using one of these primitive types: .primitiveTriangles, .primitiveTriangleStrip.func getAabb(
) -> AABB Returns the smallest
AABB
enclosing this mesh in local space. Not affected bycustom_aabb
.func getFaces(
) -> PackedVector3Array Returns all the vertices that make up the faces of the mesh. Each three vertices represent one triangle.
func getSurfaceCount(
) -> Int32 Returns the number of surfaces that the
Mesh
holds. This is equivalent togetSurfaceOverrideMaterialCount
.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:)
).func surfaceGetBlendShapeArrays(surfIdx: Int32
) -> VariantCollection<GArray> Returns the blend shape arrays for the requested surface.
func surfaceGetMaterial(surfIdx: Int32
) -> Material? Returns a
Material
in a given surface. Surface is rendered using this material.func surfaceSetMaterial(surfIdx: Int32, material: Material?
) Sets a
Material
for a given surface. Surface will be rendered using this material.
Show implementation details (14)
Hide implementation details
func _getAabb(
) -> AABB Virtual method to override the
AABB
for a custom class extendingMesh
.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 givenindex
for a custom class extendingMesh
.
Citizens in SwiftGodot
Conformances
protocol CustomDebugStringConvertible
A type with a customized textual representation suitable for debugging purposes.
protocol Equatable
A type that can be compared for value equality.
protocol ExpressibleByArrayLiteral
A type that can be initialized using an array literal.
protocol OptionSet
A 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>
A type that provides mathematical set operations.
Type members
init(rawValue: Int
) static let compressFlagsBase: Mesh.ArrayFormat
Shift of first compress flag. Compress flags should be passed to
addSurfaceFromArrays(primitive:arrays:blendShapes:lods:flags:)
andcommit(existing:flags:)
.static let flagCompressAttributes: Mesh.ArrayFormat
Flag 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.ArrayFormat
Flag used to mark that the array contains 2D vertices.
static let flagUse8BoneWeights: Mesh.ArrayFormat
Flag 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.ArrayFormat
Flag indices that the mesh data will use
GL_DYNAMIC_DRAW
on GLES. Unused on Vulkan.static let flagUsesEmptyVertexArray: Mesh.ArrayFormat
Flag used to mark that the mesh intentionally contains no vertex array.
static let formatBlendShapeMask: Mesh.ArrayFormat
Mask of mesh channels permitted in blend shapes.
static let formatBones: Mesh.ArrayFormat
Mesh array contains bones.
static let formatColor: Mesh.ArrayFormat
Mesh array contains colors.
static let formatCustom0: Mesh.ArrayFormat
Mesh array contains custom channel index 0.
static let formatCustom0Shift: Mesh.ArrayFormat
Amount to shift
ArrayCustomFormat
for custom channel index 0.static let formatCustom1: Mesh.ArrayFormat
Mesh array contains custom channel index 1.
static let formatCustom1Shift: Mesh.ArrayFormat
Amount to shift
ArrayCustomFormat
for custom channel index 1.static let formatCustom2: Mesh.ArrayFormat
Mesh array contains custom channel index 2.
static let formatCustom2Shift: Mesh.ArrayFormat
Amount to shift
ArrayCustomFormat
for custom channel index 2.static let formatCustom3: Mesh.ArrayFormat
Mesh array contains custom channel index 3.
static let formatCustom3Shift: Mesh.ArrayFormat
Amount to shift
ArrayCustomFormat
for custom channel index 3.static let formatCustomBase: Mesh.ArrayFormat
Shift of first custom channel.
static let formatCustomBits: Mesh.ArrayFormat
Number of format bits per custom channel. See
ArrayCustomFormat
.static let formatCustomMask: Mesh.ArrayFormat
Mask of custom format bits per custom channel. Must be shifted by one of the SHIFT constants. See
ArrayCustomFormat
.static let formatIndex: Mesh.ArrayFormat
Mesh array uses indices.
static let formatNormal: Mesh.ArrayFormat
Mesh array contains normals.
static let formatTangent: Mesh.ArrayFormat
Mesh array contains tangents.
static let formatTexUv: Mesh.ArrayFormat
Mesh array contains UVs.
static let formatTexUv2: Mesh.ArrayFormat
Mesh array contains second UV.
static let formatVertex: Mesh.ArrayFormat
Mesh array contains vertices. All meshes require a vertex array so this should always be present.
static let formatWeights: Mesh.ArrayFormat
Mesh array contains bone weights.
Instance members
var debugDescription: String
A textual representation of this instance, suitable for debugging
let rawValue: Int
Type features
init(
) Creates an empty option set.
init<S>(S
) 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.
static func != (lhs: Self, rhs: Self
) -> Bool Returns a Boolean value indicating whether two values are not equal.
Instance features
var isEmpty: Bool
A Boolean value that indicates whether the set has no elements.
func contains(Self
) -> Bool Returns a Boolean value that indicates whether a given element is a member of the option set.
func formIntersection(Self
) Removes all elements of this option set that are not also present in the given set.
func formSymmetricDifference(Self
) Replaces this set with a new set containing all elements contained in either this set or the given set, but not in both.
func formUnion(Self
) Inserts the elements of another set into this option set.
func insert(Self.Element
) -> (inserted: Bool, memberAfterInsert: Self.Element) Adds the given element to the option set if it is not already a member.
func intersection(Self
) -> Self Returns a new option set with only the elements contained in both this set and the given set.
func isDisjoint(with: Self
) -> Bool Returns a Boolean value that indicates whether the set has no members in common with the given set.
func isStrictSubset(of: Self
) -> Bool Returns a Boolean value that indicates whether this set is a strict subset of the given set.
func isStrictSuperset(of: Self
) -> Bool Returns a Boolean value that indicates whether this set is a strict superset of the given set.
func isSubset(of: Self
) -> Bool Returns a Boolean value that indicates whether the set is a subset of another set.
func isSuperset(of: Self
) -> Bool Returns a Boolean value that indicates whether the set is a superset of the given set.
func remove(Self.Element
) -> Self.Element? Removes the given element and all elements subsumed by it.
func subtract(Self
) Removes the elements of the given set from this set.
func subtracting(Self
) -> Self Returns a new set containing the elements of this set that do not occur in the given set.
func symmetricDifference(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(Self
) -> Self Returns a new option set of the elements contained in this set, in the given set, or in both.
func update(with: Self.Element
) -> Self.Element? Inserts the given element into the set.