GltfNode
glTF node class.
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
public GltfNode();Properties14
CameraProperty
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
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
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
MeshProperty
OriginalNameProperty
public string OriginalName { get; set; }The original name of the node.
ParentProperty
PositionProperty
public Vector3 Position { get; set; }The position of the glTF node relative to its parent.
RotationProperty
public Quaternion Rotation { get; set; }The rotation of the glTF node relative to its parent.
ScaleProperty
public Vector3 Scale { get; set; }The scale of the glTF node relative to its parent.
SkeletonProperty
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
VisibleProperty
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
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
public void AppendChildIndex(int childIndex);Appends the given child node index to the GltfNode.Children array.
| Name | Type | Default |
|---|---|---|
childIndex | int | — |
GetAdditionalDataVariant
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.
| Name | Type | Default |
|---|---|---|
extensionName | StringName | — |
VariantGetCameraint
public int GetCamera();intGetChildrenint[]
public int[] GetChildren();int[]GetHeightint
public int GetHeight();intGetLightint
public int GetLight();intGetMeshint
public int GetMesh();intGetOriginalNamestring
public string GetOriginalName();stringGetParentint
public int GetParent();intGetPositionVector3
public Vector3 GetPosition();Vector3GetRotationQuaternion
public Quaternion GetRotation();QuaternionGetScaleVector3
public Vector3 GetScale();Vector3GetSceneEntityPathEntityPath
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".
| Name | Type | Default |
|---|---|---|
gltfState | GltfState | — |
handleSkeletons | bool | true |
EntityPathGetSkeletonint
public int GetSkeleton();intGetSkinint
public int GetSkin();intGetVisiblebool
public bool GetVisible();boolGetXformTransform3D
public Transform3D GetXform();Transform3DSetAdditionalDatavoid
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.
| Name | Type | Default |
|---|---|---|
extensionName | StringName | — |
additionalData | Variant | — |
SetCameravoid
public void SetCamera(int camera);| Name | Type | Default |
|---|---|---|
camera | int | — |
SetChildren2 overloads
public void SetChildren(int[] children);| Name | Type | Default |
|---|---|---|
children | int[] | — |
public void SetChildren(ReadOnlySpan<int> children);| Name | Type | Default |
|---|---|---|
children | ReadOnlySpan<int> | — |
SetHeightvoid
public void SetHeight(int height);| Name | Type | Default |
|---|---|---|
height | int | — |
SetLightvoid
public void SetLight(int light);| Name | Type | Default |
|---|---|---|
light | int | — |
SetMeshvoid
public void SetMesh(int mesh);| Name | Type | Default |
|---|---|---|
mesh | int | — |
SetOriginalNamevoid
public void SetOriginalName(string originalName);| Name | Type | Default |
|---|---|---|
originalName | string | — |
SetParentvoid
public void SetParent(int parent);| Name | Type | Default |
|---|---|---|
parent | int | — |
SetPositionvoid
public void SetPosition(Vector3 position);| Name | Type | Default |
|---|---|---|
position | Vector3 | — |
SetRotationvoid
public void SetRotation(Quaternion rotation);| Name | Type | Default |
|---|---|---|
rotation | Quaternion | — |
SetScalevoid
public void SetScale(Vector3 scale);| Name | Type | Default |
|---|---|---|
scale | Vector3 | — |
SetSkeletonvoid
public void SetSkeleton(int skeleton);| Name | Type | Default |
|---|---|---|
skeleton | int | — |
SetSkinvoid
public void SetSkin(int skin);| Name | Type | Default |
|---|---|---|
skin | int | — |
SetVisiblevoid
public void SetVisible(bool visible);| Name | Type | Default |
|---|---|---|
visible | bool | — |
SetXformvoid
public void SetXform(Transform3D xform);| Name | Type | Default |
|---|---|---|
xform | Transform3D | — |