Assimp v5.2.2 (January 2022)
The Asset-Importer-Lib API documentation.
aiNode Struct Reference

A node in the imported hierarchy. More...

#include <scene.h>

Public Member Functions

void addChildren (unsigned int numChildren, aiNode **children)
 Will add new children. More...
 
 aiNode ()
 Constructor. More...
 
 aiNode (const std::string &name)
 Construction from a specific name. More...
 
aiNodeFindNode (const aiString &name)
 
const aiNodeFindNode (const aiString &name) const
 Searches for a node with a specific name, beginning at this nodes. More...
 
aiNodeFindNode (const char *name)
 
const aiNodeFindNode (const char *name) const
 
 ~aiNode ()
 Destructor. More...
 

Public Attributes

C_STRUCT aiNode ** mChildren
 The child nodes of this node. More...
 
unsigned int * mMeshes
 The meshes of this node. More...
 
C_STRUCT aiMetadatamMetaData
 Metadata associated with this node or nullptr if there is no metadata. More...
 
C_STRUCT aiString mName
 The name of the node. More...
 
unsigned int mNumChildren
 The number of child nodes of this node. More...
 
unsigned int mNumMeshes
 The number of meshes of this node. More...
 
C_STRUCT aiNodemParent
 Parent node. More...
 
C_STRUCT aiMatrix4x4 mTransformation
 The transformation relative to the node's parent. More...
 

Detailed Description

A node in the imported hierarchy.

Each node has name, a parent node (except for the root node), a transformation relative to its parent and possibly several child nodes. Simple file formats don't support hierarchical structures - for these formats the imported scene does consist of only a single root node without children.

Constructor & Destructor Documentation

◆ aiNode() [1/2]

aiNode::aiNode ( )

Constructor.

◆ aiNode() [2/2]

aiNode::aiNode ( const std::string &  name)
explicit

Construction from a specific name.

◆ ~aiNode()

aiNode::~aiNode ( )

Destructor.

Member Function Documentation

◆ addChildren()

void aiNode::addChildren ( unsigned int  numChildren,
aiNode **  children 
)

Will add new children.

Parameters
numChildrenNumber of children to add.
childrenThe array with pointers showing to the children.

◆ FindNode() [1/4]

aiNode * aiNode::FindNode ( const aiString name)
inline

◆ FindNode() [2/4]

const aiNode * aiNode::FindNode ( const aiString name) const
inline

Searches for a node with a specific name, beginning at this nodes.

Normally you will call this method on the root node of the scene.

Parameters
nameName to search for
Returns
nullptr or a valid Node if the search was successful.

◆ FindNode() [3/4]

aiNode * aiNode::FindNode ( const char *  name)

◆ FindNode() [4/4]

const aiNode * aiNode::FindNode ( const char *  name) const

Member Data Documentation

◆ mChildren

C_STRUCT aiNode** aiNode::mChildren

The child nodes of this node.

nullptr if mNumChildren is 0.

◆ mMeshes

unsigned int* aiNode::mMeshes

The meshes of this node.

Each entry is an index into the mesh list of the aiScene.

◆ mMetaData

C_STRUCT aiMetadata* aiNode::mMetaData

Metadata associated with this node or nullptr if there is no metadata.

Whether any metadata is generated depends on the source file format. See the importer_notes page for more information on every source file format. Importers that don't document any metadata don't write any.

◆ mName

C_STRUCT aiString aiNode::mName

The name of the node.

The name might be empty (length of zero) but all nodes which need to be referenced by either bones or animations are named. Multiple nodes may have the same name, except for nodes which are referenced by bones (see aiBone and aiMesh::mBones). Their names must be unique.

Cameras and lights reference a specific node by name - if there are multiple nodes with this name, they are assigned to each of them.
There are no limitations with regard to the characters contained in the name string as it is usually taken directly from the source file.

Implementations should be able to handle tokens such as whitespace, tabs, line feeds, quotation marks, ampersands etc.

Sometimes assimp introduces new nodes not present in the source file into the hierarchy (usually out of necessity because sometimes the source hierarchy format is simply not compatible). Their names are surrounded by

<> 

e.g.

<DummyRootNode> 

.

◆ mNumChildren

unsigned int aiNode::mNumChildren

The number of child nodes of this node.

◆ mNumMeshes

unsigned int aiNode::mNumMeshes

The number of meshes of this node.

◆ mParent

C_STRUCT aiNode* aiNode::mParent

Parent node.

nullptr if this node is the root node.

◆ mTransformation

C_STRUCT aiMatrix4x4 aiNode::mTransformation

The transformation relative to the node's parent.


The documentation for this struct was generated from the following file: