Class GltfNode
- Namespace
- Godot
- Assembly
- GodotSharp.dll
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(StringName) and SetAdditionalData(StringName, Variant).
[GodotClassName("GLTFNode")]
public class GltfNode : Resource, IDisposable
- Inheritance
-
GltfNode
- Implements
- Inherited Members
Constructors
GltfNode()
public GltfNode()
Properties
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.
public int Camera { get; set; }
Property Value
Children
The indices of the child nodes in the GltfState. If this GLTF node has no children, this will be an empty array.
public int[] Children { get; set; }
Property Value
- int[]
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.
public int Height { get; set; }
Property Value
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.
public int Light { get; set; }
Property Value
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.
public int Mesh { get; set; }
Property Value
Parent
The index of the parent node in the GltfState. If -1, this node is a root node.
public int Parent { get; set; }
Property Value
Position
The position of the GLTF node relative to its parent.
public Vector3 Position { get; set; }
Property Value
Rotation
The rotation of the GLTF node relative to its parent.
public Quaternion Rotation { get; set; }
Property Value
Scale
The scale of the GLTF node relative to its parent.
public Vector3 Scale { get; set; }
Property Value
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.
public int Skeleton { get; set; }
Property Value
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.
public int Skin { get; set; }
Property Value
Xform
The transform of the GLTF node relative to its parent. This property is usually unused since the position, rotation, and scale properties are preferred.
public Transform3D Xform { get; set; }
Property Value
Methods
GetAdditionalData(StringName)
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.
public Variant GetAdditionalData(StringName extensionName)
Parameters
extensionName
StringName
Returns
HasGodotClassMethod(in godot_string_name)
Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.
protected override bool HasGodotClassMethod(in godot_string_name method)
Parameters
method
godot_string_nameName of the method to check for.
Returns
HasGodotClassSignal(in godot_string_name)
Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.
protected override bool HasGodotClassSignal(in godot_string_name signal)
Parameters
signal
godot_string_nameName of the signal to check for.
Returns
InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)
Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.
protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)
Parameters
method
godot_string_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.
Returns
SetAdditionalData(StringName, Variant)
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.
public void SetAdditionalData(StringName extensionName, Variant additionalData)
Parameters
extensionName
StringNameadditionalData
Variant