ObjectNode
The ObjectNode class handles transformations and hierarchical relationships within an Object. It supports attaching single or multiple ObjectGeometry instances, with optional application of a pivot transformation matrix.
#include <scene/TellusimObject.h>
Constructors
explicit ObjectNode(const char *name = nullptr)
explicit ObjectNode(Object &object, const char *name = nullptr)
explicit ObjectNode(ObjectNode *parent, const char *name = nullptr)
Methods
Clear node.
void clear()
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 object.
void setObject(Object &object, bool check = true)
const Object getObject() const
Object getObject()
Enabled flag.
void setEnabled(bool enabled)
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
Node parent.
void clearParent()
uint32_t setParent(ObjectNode &parent, bool check = true)
const ObjectNode getParent() const
ObjectNode getParent()
bool isRoot() const
Node children.
void reserveChildren(uint32_t num_children)
uint32_t addChild(ObjectNode &child, bool check = true)
bool removeChild(ObjectNode &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 ObjectNode &child) const
bool isChild(const ObjectNode &child) const
uint32_t getNumChildren() const
const Array<ObjectNode> getChildren() const
Array<ObjectNode> getChildren()
const ObjectNode getChild(uint32_t index) const
const ObjectNode getChild(const char *name) const
ObjectNode getChild(uint32_t index)
ObjectNode getChild(const char *name)
Node hierarchy.
uint32_t getHierarchy(Array<ObjectNode> &nodes, bool clear = true)
Node geometries.
void clearGeometries()
void shrinkGeometries()
void reserveGeometries(uint32_t num_geometries)
void setNumGeometries(uint32_t num_geometries)
void setGeometry(uint32_t index, ObjectGeometry &geometry)
uint32_t addGeometry(ObjectGeometry &geometry, bool check = true)
bool removeGeometry(const ObjectGeometry &geometry)
uint32_t findGeometry(const ObjectGeometry &geometry) const
uint32_t getNumGeometries() const
const Array<ObjectGeometry> getGeometries() const
Array<ObjectGeometry> getGeometries()
const ObjectGeometry getGeometry(uint32_t index) const
ObjectGeometry getGeometry(uint32_t index)
Set transforms.
void setTransforms(Matrix4x3f local, Matrix4x3f global, bool force = false, bool atomic = false)
Local transform.
void setLocalTransform(Matrix4x3f transform, bool force = false, bool atomic = false)
const Matrix4x3f getLocalTransform() const
Global transform.
void setGlobalTransform(Matrix4x3f transform, bool force = false, bool atomic = false)
const Matrix4x3f getGlobalTransform() const
Pivot transform.
void setPivotTransform(Matrix4x3f transform, bool force = false, bool atomic = false)
const Matrix4x3f getPivotTransform() const
Create transforms.
void createTransforms(bool update = false, bool clear = false)
void createLocalTransforms(Matrix4x3f itransform = Matrix4x3f::identity, bool update = false, bool clear = false)
void createGlobalTransforms(Matrix4x3f itransform = Matrix4x3f::identity, bool update = false, bool clear = false)
Type | Name | Description |
---|---|---|
bool | update | Update Nodes. |
bool | clear | Clear update mask after transformation. |
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.
ObjectNode clone(Object &object, bool children = true) const
Updated flag.
bool isUpdated() const
Update scene.
void updateScene()