## Libraries.Game.Graphics.ModelData.Node Documentation

*Inherits from: *Libraries.Language.Object

## Summary

### Variable Summary Table

Variables | Description |
---|---|

Libraries.Compute.Quaternion rotation | |

Libraries.Compute.Vector3 scale | |

text id | |

Libraries.Compute.Vector3 translation | |

Libraries.Containers.Array parts | |

Libraries.Compute.Matrix4 localTransform | |

Libraries.Compute.Matrix4 globalTransform | |

boolean inheritTransform |

### Actions Summary Table

Actions | Description |
---|---|

Add(integer index, Libraries.Game.Graphics.ModelData.Node node) | This action will insert a new node in this node's children hierarchy at the given index. |

Add(Libraries.Game.Graphics.ModelData.Node node) | This action will add a new node to this node's children hierarchy. |

CalculateAllBoneTransforms() | This action calculates the bone transforms of this node and for its entire children hiearchy. |

CalculateAllTransforms() | This action calculates the local and world transforms of this node and for its entire children hiearchy. |

CalculateBoneTransforms() | This action calculates the bone transforms for this node. |

CalculateBoundingBox(Libraries.Game.BoundingBox box) | This action will set the given BoundingBox to contain the bounds of this node. |

CalculateBoundingBox() | This action will create a new BoundingBox object that contains the bounds of this node. |

CalculateBoundingBox(Libraries.Game.BoundingBox box, boolean applyTransform) | This action will set the given BoundingBox to contain the bounds of this node. |

CalculateLocalTransform() | This action will calculate the node's local transform based on its translation, scale, and rotation. |

CalculateTransforms() | This action calculates the local and world transforms for this node. |

CalculateWorldTransform() | This action will calculate the node's world transform, which is the product of its local transform and its parent's world transform. |

Compare(Libraries.Language.Object object) | This action compares two object hash codes and returns an integer. |

Equals(Libraries.Language.Object object) | This action determines if two objects are equal based on their hash code values. |

ExtendBoundingBox(Libraries.Game.BoundingBox box, boolean applyTransform) | This action will extend the given BoundingBox to contain the bounds of this node. |

ExtendBoundingBox(Libraries.Game.BoundingBox box) | This action will extend the given BoundingBox to contain the bounds of this node. |

GetChild(text id) | This action will search the entire children hierarchy of this node, and return the child node with the given ID. |

GetChild(integer index) | This action returns the child stored at the given index in this node's children hierarchy. |

GetChildren() | This action returns an iterator containing all of the direct children of this node, i. |

GetChildrenCount() | This action will return the number of nodes that are direct children of this node, i. |

GetHashCode() | This action gets the hash code for an object. |

GetImmediateChild(text id) | This action will return the child node with the given ID in this node's immediate children hierarchy. |

GetParent() | This action returns this node's parent node. |

HasChildren() | This action returns whether or not this node has any children nodes that have been added to it. |

HasParent() | This action returns whether or not this node has a parent node. |

Remove(Libraries.Game.Graphics.ModelData.Node node) | This action removes a node from the children hierarchy. |

SetParent(Libraries.Game.Graphics.ModelData.Node node) | This action will set the parent of this node. |

## Actions Documentation

### Add(integer index, Libraries.Game.Graphics.ModelData.Node node)

This action will insert a new node in this node's children hierarchy at the given index.

#### Parameters

### Add(Libraries.Game.Graphics.ModelData.Node node)

This action will add a new node to this node's children hierarchy.

#### Parameters

### CalculateAllBoneTransforms()

This action calculates the bone transforms of this node and for its entire children hiearchy.

### CalculateAllTransforms()

This action calculates the local and world transforms of this node and for its entire children hiearchy.

### CalculateBoneTransforms()

This action calculates the bone transforms for this node. This does not calculate the bone transforms of children nodes -- to do that, use CalculateAllBoneTransforms().

### CalculateBoundingBox(Libraries.Game.BoundingBox box)

This action will set the given BoundingBox to contain the bounds of this node. Any data that was in the BoundingBox before this action will be overwritten.

#### Parameters

#### Return

### CalculateBoundingBox()

This action will create a new BoundingBox object that contains the bounds of this node.

#### Return

### CalculateBoundingBox(Libraries.Game.BoundingBox box, boolean applyTransform)

This action will set the given BoundingBox to contain the bounds of this node. The boolean parameter will determine whether to apply the node's global transform to the BoundingBox. If the value is true, the transform will be applied.

#### Parameters

#### Return

### CalculateLocalTransform()

This action will calculate the node's local transform based on its translation, scale, and rotation. It then returns the local transform.

#### Return

### CalculateTransforms()

This action calculates the local and world transforms for this node. This does not calculate the transforms of children nodes -- to do that, use CalculateAllTransforms().

### CalculateWorldTransform()

This action will calculate the node's world transform, which is the product of its local transform and its parent's world transform. It then returns the world transform. In the case that this node has no parent, the local transform will be returned.

#### Return

### Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

**Example Code**

```
Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)
```

#### Parameters

- Libraries.Language.Object: The object to compare to.

#### Return

integer: The Compare result, Smaller, Equal, or Larger.

### Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

**Example Code**

```
use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)
```

#### Parameters

- Libraries.Language.Object: The to be compared.

#### Return

boolean: True if the hash codes are equal and false if they are not equal.

### ExtendBoundingBox(Libraries.Game.BoundingBox box, boolean applyTransform)

This action will extend the given BoundingBox to contain the bounds of this node. The boolean parameter dictates whether or not to use the global transform - if the boolean is true, the bounds will be offset by the global transform. If it is false, the global transform will be ignored.

#### Parameters

#### Return

### ExtendBoundingBox(Libraries.Game.BoundingBox box)

This action will extend the given BoundingBox to contain the bounds of this node. The global transform of this node will be applied when calculating the bounds.

#### Parameters

#### Return

### GetChild(text id)

This action will search the entire children hierarchy of this node, and return the child node with the given ID. The case of the ID is ignored. If no node is found, undefined is returned.

#### Parameters

#### Return

Libraries.Game.Graphics.ModelData.Node:

### GetChild(integer index)

This action returns the child stored at the given index in this node's children hierarchy.

#### Parameters

#### Return

Libraries.Game.Graphics.ModelData.Node:

### GetChildren()

This action returns an iterator containing all of the direct children of this node, i.e., they have been specifically added to this node.

#### Return

Libraries.Containers.Iterator:

### GetChildrenCount()

This action will return the number of nodes that are direct children of this node, i.e., they have been specifically added to this node.

#### Return

integer:

### GetHashCode()

This action gets the hash code for an object.

**Example Code**

```
Object o
integer hash = o:GetHashCode()
```

#### Return

integer: The integer hash code of the object.

### GetImmediateChild(text id)

This action will return the child node with the given ID in this node's immediate children hierarchy. The case of the ID is ignored. If no node is found, undefined is returned.

#### Parameters

#### Return

Libraries.Game.Graphics.ModelData.Node:

### GetParent()

This action returns this node's parent node.

#### Return

Libraries.Game.Graphics.ModelData.Node:

### HasChildren()

This action returns whether or not this node has any children nodes that have been added to it.

#### Return

boolean:

### HasParent()

This action returns whether or not this node has a parent node.

#### Return

boolean:

### Remove(Libraries.Game.Graphics.ModelData.Node node)

This action removes a node from the children hierarchy.

#### Parameters

#### Return

boolean:

### SetParent(Libraries.Game.Graphics.ModelData.Node node)

This action will set the parent of this node. This information is automatically set when the node is added to another node.