Node
The Node class manages transformations and hierarchical relationships within a Scene Graph.
It supports loading parameters from an external *.node
file.
#include <scene/TellusimNode.h>
Constructors
explicit Node(const char *name = nullptr)
explicit Node(Graph &graph, const char *name = nullptr)
explicit Node(Node *parent, const char *name = nullptr)
Methods
static Node create(Type type, const char *name = nullptr)
Clear node.
void clear()
Node type.
Type getType() const
static const char *getTypeName(Type type)
const char *getTypeName() const
bool isBase() const
bool isLight() const
bool isCamera() const
bool isObject() const
bool isInstance() const
bool isVarying() const
bool isScript() const
bool isJoint() const
Node unique identifier.
uint32_t getID() const
Node index.
uint32_t getIndex() const
Node address.
uint32_t getAddress() const
Node name.
void setName(const char *name)
void setName(const String &name)
String getName() const
Node file name.
void setNodeName(const char *name)
void setNodeName(const String &name)
String getNodeName() const
Node graph.
void setGraph(Graph &graph, bool check = true)
const Graph getGraph() const
Graph getGraph()
Node scene.
const Scene getScene() const
Scene getScene()
Enabled flag.
void setEnabled(bool enabled, bool force = false, bool atomic = false)
bool isEnabled() const
bool isDisabled() const
Hidden flag.
void setHidden(bool flag)
bool isHidden() const
Expanded flag.
void setExpanded(bool flag)
bool isExpanded() const
Internal flag.
void setInternal(bool flag)
bool isInternal() const
Virtual flag.
void setVirtual(bool flag)
bool isVirtual() const
Changed flag.
void setChanged(bool flag)
bool isChanged() const
Pointer info.
void setPtrInfo(void *ptr)
void *getPtrInfo() const
Meta info.
void setMetaInfo(const String &info)
String getMetaInfo() const
Node parent.
void clearParent()
uint32_t setParent(Node &parent, bool check = true)
const Node getParent() const
Node getParent()
bool isRoot() const
const Node getRoot() const
Node getRoot()
Node children.
void shrinkChildren()
void reserveChildren(uint32_t num_children)
uint32_t addChild(Node &child, bool check = true)
bool removeChild(Node &child)
bool releaseChildren()
bool clearChildren()
void swapChildren(uint32_t index_0, uint32_t index_1)
uint32_t findChild(const char *name) const
uint32_t findChild(const Node &child) const
bool isChild(const Node &child) const
uint32_t getNumChildren() const
const Array<Node> getChildren() const
Array<Node> getChildren()
const Node getChild(uint32_t index) const
const Node getChild(const char *name) const
Node getChild(uint32_t index)
Node getChild(const char *name)
Node hierarchy.
uint32_t getHierarchy(Array<Node> &nodes, bool clear = true)
Motion hash.
uint32_t setMotionHash(uint32_t hash, bool children = true)
uint32_t getMotionHash() const
Set transforms.
void setTransforms(Matrix4x3d local, Matrix4x3d global, bool force = false, bool atomic = false)
Local transform.
void setLocalTransform(Matrix4x3d transform, bool force = false, bool atomic = false)
const Matrix4x3d getLocalTransform() const
Global transform.
void setGlobalTransform(Matrix4x3d transform, bool force = false, bool atomic = false)
const Matrix4x3d getGlobalTransform() const
Create transforms.
void createTransforms(bool update = false, bool clear = false)
Type | Name | Description |
---|---|---|
bool | update | Update Nodes. |
bool | clear | Clear update mask after transformation. |
Update transforms.
void updateTransforms(bool update = false)
Type | Name | Description |
---|---|---|
bool | update | Update Node. |
Fetch transforms.
bool fetchTransforms(const TransformCallback &func)
bool fetchTransforms(bool children)
Load node.
bool load(const Xml &xml)
bool load(const Json &json)
bool load(Stream &stream)
Save node.
bool save(Xml &xml) const
bool save(Json &json) const
bool save(Stream &stream) const
Clone node.
Node clone(Graph &graph, bool children = true) const
Updated flag.
bool isUpdated() const
bool isTransformUpdated() const
Update scene.
void updateScene()
Types
using TransformCallback = Function<void(Node node)>
Enums
Type
Node types.
Name | Value |
---|---|
TypeUnknown | 0 |
TypeBase | 1 |
TypeLight | 2 |
TypeCamera | 3 |
TypeObject | 4 |
TypeInstance | 5 |
TypeVarying | 6 |
TypeScript | 7 |
TypeJoint | 8 |
NumTypes | 9 |