reckfellENGINE

GltfNode

glTF node class.

On this page
class GltfNodeReckfellSharpInherits Resource

glTF node class.

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 GltfNode.GetAdditionalData and GltfNode.SetAdditionalData.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

GltfNodeConstructor
# GltfNode
C#
public GltfNode();

Properties14

CameraProperty
# Camera
C#
public int Camera { get; set; }

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.

ChildrenProperty
# Children
C#
public int[] Children { get; set; }

The indices of the child nodes in the GltfState. If this glTF node has no children, this will be an empty array.

HeightProperty
# Height
C#
public int Height { get; set; }

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.

LightProperty
# Light
C#
public int Light { get; set; }

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.

MeshProperty
# Mesh
C#
public int Mesh { get; set; }

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.

OriginalNameProperty
# OriginalName
C#
public string OriginalName { get; set; }

The original name of the node.

ParentProperty
# Parent
C#
public int Parent { get; set; }

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

PositionProperty
# Position
C#
public Vector3 Position { get; set; }

The position of the glTF node relative to its parent.

RotationProperty
# Rotation
C#
public Quaternion Rotation { get; set; }

The rotation of the glTF node relative to its parent.

ScaleProperty
# Scale
C#
public Vector3 Scale { get; set; }

The scale of the glTF node relative to its parent.

SkeletonProperty
# Skeleton
C#
public int Skeleton { get; set; }

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.

SkinProperty
# Skin
C#
public int Skin { get; set; }

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.

VisibleProperty
# Visible
C#
public bool Visible { get; set; }

If true, the GLTF node is visible. If false, the GLTF node is not visible. This is converted to the Entity3D.Visible property in the Reckfell scene, and is exported to KHR_node_visibility when false.

XformProperty
# Xform
C#
public Transform3D Xform { get; set; }

The transform of the glTF node relative to its parent. This property is usually unused since the position, rotation, and scale properties are preferred.

Methods33

AppendChildIndexvoid
# AppendChildIndex
C#
public void AppendChildIndex(int childIndex);

Appends the given child node index to the GltfNode.Children array.

Parameters
NameTypeDefault
childIndexint—
GetAdditionalDataVariant
# GetAdditionalData
C#
public Variant GetAdditionalData(StringName extensionName);

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.

Parameters
NameTypeDefault
extensionNameStringName—
Returns Variant
GetCameraint
# GetCamera
C#
public int GetCamera();
Returns int
GetChildrenint[]
# GetChildren
C#
public int[] GetChildren();
Returns int[]
GetHeightint
# GetHeight
C#
public int GetHeight();
Returns int
GetLightint
# GetLight
C#
public int GetLight();
Returns int
GetMeshint
# GetMesh
C#
public int GetMesh();
Returns int
GetOriginalNamestring
# GetOriginalName
C#
public string GetOriginalName();
Returns string
GetParentint
# GetParent
C#
public int GetParent();
Returns int
GetPositionVector3
# GetPosition
C#
public Vector3 GetPosition();
Returns Vector3
GetRotationQuaternion
# GetRotation
C#
public Quaternion GetRotation();
Returns Quaternion
GetScaleVector3
# GetScale
C#
public Vector3 GetScale();
Returns Vector3
GetSceneEntityPathEntityPath
# GetSceneEntityPath
C#
public EntityPath GetSceneEntityPath(GltfState gltfState, bool handleSkeletons = true);

Returns the EntityPath that this GLTF node will have in the Reckfell scene tree after being imported. This is useful when importing glTF object model pointers with GltfObjectModelProperty, for handling extensions such as KHR_animation_pointer or KHR_interactivity. If handle_skeletons is true, paths to skeleton bone glTF nodes will be resolved properly. For example, a path that would be ^"A/B/C/Bone1/Bone2/Bone3" if false will become ^"A/B/C/Skeleton3D:Bone3".

Parameters
NameTypeDefault
gltfStateGltfState—
handleSkeletonsbooltrue
Returns EntityPath
GetSkeletonint
# GetSkeleton
C#
public int GetSkeleton();
Returns int
GetSkinint
# GetSkin
C#
public int GetSkin();
Returns int
GetVisiblebool
# GetVisible
C#
public bool GetVisible();
Returns bool
GetXformTransform3D
# GetXform
C#
public Transform3D GetXform();
Returns Transform3D
SetAdditionalDatavoid
# SetAdditionalData
C#
public void SetAdditionalData(StringName extensionName, Variant additionalData);

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.

Parameters
NameTypeDefault
extensionNameStringName—
additionalDataVariant—
SetCameravoid
# SetCamera
C#
public void SetCamera(int camera);
Parameters
NameTypeDefault
cameraint—
SetChildren2 overloads
# SetChildren · 1/2
C#
public void SetChildren(int[] children);
Parameters
NameTypeDefault
childrenint[]—
# SetChildren · 2/2
C#
public void SetChildren(ReadOnlySpan<int> children);
Parameters
NameTypeDefault
childrenReadOnlySpan<int>—
SetHeightvoid
# SetHeight
C#
public void SetHeight(int height);
Parameters
NameTypeDefault
heightint—
SetLightvoid
# SetLight
C#
public void SetLight(int light);
Parameters
NameTypeDefault
lightint—
SetMeshvoid
# SetMesh
C#
public void SetMesh(int mesh);
Parameters
NameTypeDefault
meshint—
SetOriginalNamevoid
# SetOriginalName
C#
public void SetOriginalName(string originalName);
Parameters
NameTypeDefault
originalNamestring—
SetParentvoid
# SetParent
C#
public void SetParent(int parent);
Parameters
NameTypeDefault
parentint—
SetPositionvoid
# SetPosition
C#
public void SetPosition(Vector3 position);
Parameters
NameTypeDefault
positionVector3—
SetRotationvoid
# SetRotation
C#
public void SetRotation(Quaternion rotation);
Parameters
NameTypeDefault
rotationQuaternion—
SetScalevoid
# SetScale
C#
public void SetScale(Vector3 scale);
Parameters
NameTypeDefault
scaleVector3—
SetSkeletonvoid
# SetSkeleton
C#
public void SetSkeleton(int skeleton);
Parameters
NameTypeDefault
skeletonint—
SetSkinvoid
# SetSkin
C#
public void SetSkin(int skin);
Parameters
NameTypeDefault
skinint—
SetVisiblevoid
# SetVisible
C#
public void SetVisible(bool visible);
Parameters
NameTypeDefault
visiblebool—
SetXformvoid
# SetXform
C#
public void SetXform(Transform3D xform);
Parameters
NameTypeDefault
xformTransform3D—
Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.