GLTFNode
GLTF node class.
GLTFNode.swift:20class GLTFNode
Represents a GLTF node. GLTF nodes may have names, transforms, children (other GLTF nodes), and more specialized properties (represented by their own classes).
GLTF nodes generally exist inside of GLTFState
which represents all data of a GLTF file. Most of GLTFNode’s properties are indices of other data in the GLTF file. You can extend a GLTF node with additional properties by using getAdditionalData(extensionName:)
and setAdditionalData(extensionName:additionalData:)
.
Superclasses
class Resource
Base class for serializable objects.
Citizens in SwiftGodot
Conformances
protocol CustomStringConvertible
A type with a customized textual representation.
protocol Equatable
A type that can be compared for value equality.
protocol Hashable
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
Types that conform to VariantRepresentable can be stored directly in
Variant
with no conversion. These include all of the Variant types from Godot (for exampleGString
,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.
Type members
Instance members
var camera: Int32
If this GLTF node is a camera, the index of the
GLTFCamera
in theGLTFState
that describes the camera’s properties. If -1, this node is not a camera.var children: PackedInt32Array
The indices of the child nodes in the
GLTFState
. If this GLTF node has no children, this will be an empty array.var height: Int32
How deep into the node hierarchy this node is. A root node will have a height of 0, its children will have a height of 1, and so on. If -1, the height has not been calculated.
var light: Int32
If this GLTF node is a light, the index of the
GLTFLight
in theGLTFState
that describes the light’s properties. If -1, this node is not a light.var mesh: Int32
If this GLTF node is a mesh, the index of the
GLTFMesh
in theGLTFState
that describes the mesh’s properties. If -1, this node is not a mesh.var originalName: String
The original name of the node.
var parent: Int32
The index of the parent node in the
GLTFState
. If -1, this node is a root node.var position: Vector3
The position of the GLTF node relative to its parent.
var rotation: Quaternion
The rotation of the GLTF node relative to its parent.
var scale: Vector3
The scale of the GLTF node relative to its parent.
var skeleton: Int32
If this GLTF node has a skeleton, the index of the
GLTFSkeleton
in theGLTFState
that describes the skeleton’s properties. If -1, this node does not have a skeleton.var skin: Int32
If this GLTF node has a skin, the index of the
GLTFSkin
in theGLTFState
that describes the skin’s properties. If -1, this node does not have a skin.var xform: Transform3D
The transform of the GLTF node relative to its parent. This property is usually unused since the position, rotation, and scale properties are preferred.
func getAdditionalData(extensionName: StringName
) -> Variant Gets additional arbitrary data in this
GLTFNode
instance. This can be used to keep per-node state data inGLTFDocumentExtension
classes, which is important because they are stateless.func setAdditionalData(extensionName: StringName, additionalData: Variant
) Sets additional arbitrary data in this
GLTFNode
instance. This can be used to keep per-node state data inGLTFDocumentExtension
classes, which is important because they are stateless.