Documentation
¶
Overview ¶
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 and SetAdditionalData.
Index ¶
- type Advanced
- type Any
- type Expanded
- type Extension
- type ID
- type Instance
- func (self Instance) AppendChildIndex(child_index int)
- func (self Instance) AsGLTFNode() Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) Camera() int
- func (self Instance) Children() []int32
- func (self Instance) GetAdditionalData(extension_name string) any
- func (self Instance) Height() int
- func (self Instance) ID() ID
- func (self Instance) Light() int
- func (self Instance) Mesh() int
- func (self Instance) MoreArgs() MoreArgs
- func (self Instance) OriginalName() string
- func (self Instance) Parent() int
- func (self Instance) Position() Vector3.XYZ
- func (self Instance) Rotation() Quaternion.IJKX
- func (self Instance) Scale() Vector3.XYZ
- func (self Instance) SetAdditionalData(extension_name string, additional_data any)
- func (self Instance) SetCamera(value int)
- func (self Instance) SetChildren(value []int32)
- func (self Instance) SetHeight(value int)
- func (self Instance) SetLight(value int)
- func (self Instance) SetMesh(value int)
- func (self *Instance) SetObject(obj [1]gd.Object) bool
- func (self Instance) SetOriginalName(value string)
- func (self Instance) SetParent(value int)
- func (self Instance) SetPosition(value Vector3.XYZ)
- func (self Instance) SetRotation(value Quaternion.IJKX)
- func (self Instance) SetScale(value Vector3.XYZ)
- func (self Instance) SetSkeleton(value int)
- func (self Instance) SetSkin(value int)
- func (self Instance) SetVisible(value bool)
- func (self Instance) SetXform(value Transform3D.BasisOrigin)
- func (self Instance) Skeleton() int
- func (self Instance) Skin() int
- func (self Instance) Virtual(name string) reflect.Value
- func (self Instance) Visible() bool
- func (self Instance) Xform() Transform3D.BasisOrigin
- type MoreArgs
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Advanced ¶
type Advanced = class
Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.
type Extension ¶
Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension
func (*Extension[T]) AsGLTFNode ¶
func (*Extension[T]) AsRefCounted ¶
func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted
func (*Extension[T]) AsResource ¶
type ID ¶
ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.
type Instance ¶
Instance of the class with convieniently typed arguments and results.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AppendChildIndex ¶
Appends the given child node index to the Children array.
func (Instance) AsGLTFNode ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) Camera ¶
If this glTF node is a camera, the index of the GLTFCamera in the GLTFState that describes the camera's properties. If -1, this node is not a camera.
func (Instance) Children ¶
The indices of the child nodes in the GLTFState. If this glTF node has no children, this will be an empty array.
func (Instance) GetAdditionalData ¶
Gets additional arbitrary data in this GLTFNode instance. This can be used to keep per-node state data in GLTFDocumentExtension classes, which is important because they are stateless.
The argument should be the GLTFDocumentExtension name (does not have to match the extension name in the glTF file), and the return value can be anything you set. If nothing was set, the return value is null.
func (Instance) Height ¶
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.
func (Instance) Light ¶
If this glTF node is a light, the index of the GLTFLight in the GLTFState that describes the light's properties. If -1, this node is not a light.
func (Instance) Mesh ¶
If this glTF node is a mesh, the index of the GLTFMesh in the GLTFState that describes the mesh's properties. If -1, this node is not a mesh.
func (Instance) MoreArgs ¶
MoreArgs enables certain functions to be called with additional 'optional' arguments.
func (Instance) OriginalName ¶
The original name of the node.
func (Instance) Parent ¶
The index of the parent node in the GLTFState. If -1, this node is a root node.
func (Instance) Rotation ¶
func (self Instance) Rotation() Quaternion.IJKX
The rotation of the glTF node relative to its parent.
func (Instance) SetAdditionalData ¶
Sets additional arbitrary data in this GLTFNode instance. This can be used to keep per-node state data in GLTFDocumentExtension classes, which is important because they are stateless.
The first argument should be the GLTFDocumentExtension name (does not have to match the extension name in the glTF file), and the second argument can be anything you want.
func (Instance) SetChildren ¶
SetChildren sets the property returned by [GetChildren].
func (Instance) SetOriginalName ¶
SetOriginalName sets the property returned by [GetOriginalName].
func (Instance) SetPosition ¶
SetPosition sets the property returned by [GetPosition].
func (Instance) SetRotation ¶
func (self Instance) SetRotation(value Quaternion.IJKX)
SetRotation sets the property returned by [GetRotation].
func (Instance) SetSkeleton ¶
SetSkeleton sets the property returned by [GetSkeleton].
func (Instance) SetVisible ¶
SetVisible sets the property returned by [GetVisible].
func (Instance) SetXform ¶
func (self Instance) SetXform(value Transform3D.BasisOrigin)
SetXform sets the property returned by [GetXform].
func (Instance) Skeleton ¶
If this glTF node has a skeleton, the index of the GLTFSkeleton in the GLTFState that describes the skeleton's properties. If -1, this node does not have a skeleton.
func (Instance) Skin ¶
If this glTF node has a skin, the index of the GLTFSkin in the GLTFState that describes the skin's properties. If -1, this node does not have a skin.
func (Instance) Visible ¶
If true, the GLTF node is visible. If false, the GLTF node is not visible. This is translated to the Node3D.Visible property in the Godot scene, and is exported to KHR_node_visibility when false.
func (Instance) Xform ¶
func (self Instance) Xform() Transform3D.BasisOrigin
The transform of the glTF node relative to its parent. This property is usually unused since the position, rotation, and scale properties are preferred.