Skip to main content

NodeObject

The NodeObject class provides spatial transformation for a Scene Object and Body. It includes a pivot transformation matrix that affects only the attached Object instance, without affecting its children nodes. This class supports dynamic material changes, allowing materials to be redefined or extended. It also manages a list of ObjectNode transformations and Morph target weights so that each NodeObject instance can be animated independently. Additionally, the geometry index enables rendering of specific ObjectGeometry instances.

#include <scene/TellusimNodeObject.h>

Inheritance

  • Inherits from Node

Constructors

explicit NodeObject(const char *name = nullptr)
explicit NodeObject(Graph &graph, const char *name = nullptr)
explicit NodeObject(Node *parent, const char *name = nullptr)
NodeObject(Graph &graph, Object &object, const char *name = nullptr)
NodeObject(Node *parent, Object &object, const char *name = nullptr)
NodeObject(Graph &graph, Object &object, Body &body, const char *name = nullptr)
NodeObject(Node *parent, Object &object, Body &body, const char *name = nullptr)

Methods

Node object.

void setObject(Object &object, bool force = false)
const Object getObject() const
Object getObject()

Node body.

void setBody(Body &body, bool force = false)
const Body getBody() const
Body getBody()

Pivot transform.

void setPivotTransform(Matrix4x3f transform, bool force = false, bool atomic = false)
const Matrix4x3f getPivotTransform() const

Object materials.

void clearMaterials()
void shrinkMaterials()
void reserveMaterials(uint32_t num_materials)
void setNumMaterials(uint32_t num_materials)
void setMaterial(uint32_t index, Material &material)
uint32_t addMaterial(Material &material)
bool updateMaterial(const Material &material)
bool removeMaterial(const Material &material)
uint32_t findMaterial(const Material &material) const
uint32_t getNumMaterials() const
const Array<Material> getMaterials() const
Array<Material> getMaterials()
const Material getMaterial(uint32_t index) const
Material getMaterial(uint32_t index)

Object frame.

void setFrame(const ObjectFrame &frame)
void setFrame(ObjectFrame &&frame)
const ObjectFrame getFrame() const
ObjectFrame getFrame(bool clear)

Object geometry index.

void setGeometryIndex(uint32_t index)
uint32_t getGeometryIndex() const

Create node tracings.

void updateTracings(bool update = false)
void removeTracings(bool update = false)

Update node spatial bounds.

void updateBounds(bool update = false)

Fetch frame.

bool fetchFrame(const FrameCallback &func)

Types

using FrameCallback = Function<void(NodeObject node, uint32_t frame)>