GLTFNode

package
v0.0.0-...-357ca8a Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 20, 2025 License: MIT Imports: 27 Imported by: 0

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

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 Any

type Any interface {
	gd.IsClass
	AsGLTFNode() Instance
}

type Expanded

type Expanded = MoreArgs

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

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 (self *Extension[T]) AsGLTFNode() Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsRefCounted

func (self *Extension[T]) AsRefCounted() [1]gd.RefCounted

func (*Extension[T]) AsResource

func (self *Extension[T]) AsResource() Resource.Instance

type ID

type ID Object.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.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.GLTFNode

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 New

func New() Instance

func (Instance) AppendChildIndex

func (self Instance) AppendChildIndex(child_index int)

Appends the given child node index to the Children array.

func (Instance) AsGLTFNode

func (self Instance) AsGLTFNode() Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) Camera

func (self Instance) Camera() int

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

func (self Instance) Children() []int32

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

func (self Instance) GetAdditionalData(extension_name string) any

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

func (self Instance) Height() int

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) ID

func (self Instance) ID() ID

func (Instance) Light

func (self Instance) Light() int

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

func (self Instance) Mesh() int

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

func (self Instance) MoreArgs() MoreArgs

MoreArgs enables certain functions to be called with additional 'optional' arguments.

func (Instance) OriginalName

func (self Instance) OriginalName() string

The original name of the node.

func (Instance) Parent

func (self Instance) Parent() int

The index of the parent node in the GLTFState. If -1, this node is a root node.

func (Instance) Position

func (self Instance) Position() Vector3.XYZ

The position of the glTF node relative to its parent.

func (Instance) Rotation

func (self Instance) Rotation() Quaternion.IJKX

The rotation of the glTF node relative to its parent.

func (Instance) Scale

func (self Instance) Scale() Vector3.XYZ

The scale of the glTF node relative to its parent.

func (Instance) SetAdditionalData

func (self Instance) SetAdditionalData(extension_name string, additional_data any)

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) SetCamera

func (self Instance) SetCamera(value int)

SetCamera sets the property returned by [GetCamera].

func (Instance) SetChildren

func (self Instance) SetChildren(value []int32)

SetChildren sets the property returned by [GetChildren].

func (Instance) SetHeight

func (self Instance) SetHeight(value int)

SetHeight sets the property returned by [GetHeight].

func (Instance) SetLight

func (self Instance) SetLight(value int)

SetLight sets the property returned by [GetLight].

func (Instance) SetMesh

func (self Instance) SetMesh(value int)

SetMesh sets the property returned by [GetMesh].

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetOriginalName

func (self Instance) SetOriginalName(value string)

SetOriginalName sets the property returned by [GetOriginalName].

func (Instance) SetParent

func (self Instance) SetParent(value int)

SetParent sets the property returned by [GetParent].

func (Instance) SetPosition

func (self Instance) SetPosition(value Vector3.XYZ)

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) SetScale

func (self Instance) SetScale(value Vector3.XYZ)

SetScale sets the property returned by [GetScale].

func (Instance) SetSkeleton

func (self Instance) SetSkeleton(value int)

SetSkeleton sets the property returned by [GetSkeleton].

func (Instance) SetSkin

func (self Instance) SetSkin(value int)

SetSkin sets the property returned by [GetSkin].

func (Instance) SetVisible

func (self Instance) SetVisible(value bool)

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

func (self Instance) Skeleton() int

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

func (self Instance) Skin() int

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) Virtual

func (self Instance) Virtual(name string) reflect.Value

func (Instance) Visible

func (self Instance) Visible() bool

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.

type MoreArgs

type MoreArgs [1]gdclass.GLTFNode

MoreArgs is a container for Instance functions with additional 'optional' arguments.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL