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 payload data.

void setPayloadAddress(uint32_t address)
void setPayloadStride(uint32_t stride)
uint32_t getPayloadAddress() const
uint32_t getPayloadStride() const
TypeNameDescription
uint32_taddressThe storage buffer address to the payload data. If the 31 bit is set, the actual address is fetched from the scalar buffer.
uint32_tstrideThe stride of the payload data.

Object geometry index.

void setGeometryIndex(uint32_t index)
uint32_t getGeometryIndex() const

Object geometry instancing.

void setNumInstances(uint32_t num)
uint32_t getNumInstances() const
TypeNameDescription
uint32_tnumThe number of instances. If the 31 bit is set, the actual number is fetched from the scalar buffer.

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)>