Skip to main content

MeshNode

The MeshNode class represents a single node in a 3D mesh hierarchy and serves as a container for geometries, attachments, and transformation data. It supports hierarchical relationships by allowing parent-child connections between nodes, enabling complex scene graph structures. Each node can be associated with a mesh, named for identification, and optionally contain geometries.

#include <format/TellusimMesh.h>

Constructors

explicit MeshNode(const char *name = nullptr)
explicit MeshNode(Mesh &mesh, const char *name = nullptr)
explicit MeshNode(MeshNode *parent, const char *name = nullptr)
explicit MeshNode(Mesh &mesh, MeshNode *parent, const char *name = nullptr)

Methods

Clear node.

void clear()

Clone node.

MeshNode clone(Mesh &mesh) const

Node name.

void setName(const char *name)
String getName() const

Node index.

uint32_t getIndex() const

Node mesh.

void setMesh(Mesh &mesh, bool check = true)
const Mesh getMesh() const
Mesh getMesh()

Node parent.

uint32_t setParent(MeshNode &parent, bool check = true)
const MeshNode getParent() const
MeshNode getParent()
bool isRoot() const

Node children.

void reserveChildren(uint32_t num_children)
uint32_t addChild(MeshNode &child, bool check = true)
bool removeChild(MeshNode &child)
void releaseChildren()
uint32_t findChild(const MeshNode &child) const
uint32_t findChild(const char *name) const
uint32_t getNumChildren() const
const Array<MeshNode> getChildren() const
Array<MeshNode> getChildren()
const MeshNode getChild(uint32_t index) const
const MeshNode getChild(const char *name) const
MeshNode getChild(uint32_t index)
MeshNode getChild(const char *name)

Node geometries.

void clearGeometries()
void reserveGeometries(uint32_t num_geometries)
uint32_t addGeometry(MeshGeometry &geometry, bool check = true)
bool removeGeometry(MeshGeometry &geometry)
bool replaceGeometry(MeshGeometry &old_geometry, MeshGeometry &geometry)
uint32_t findGeometry(const MeshGeometry &geometry) const
uint32_t getNumGeometries() const
const Array<MeshGeometry> getGeometries() const
Array<MeshGeometry> getGeometries()
const MeshGeometry getGeometry(uint32_t index) const
MeshGeometry getGeometry(uint32_t index)

Node attachments.

void clearAttachments()
void reserveAttachments(uint32_t num_attachments)
uint32_t addAttachment(MeshAttachment &attachment, bool check = true)
bool removeAttachment(MeshAttachment &attachment)
bool replaceAttachment(MeshAttachment &old_attachment, MeshAttachment &attachment)
uint32_t findAttachment(const MeshAttachment &attachment) const
uint32_t findAttachment(const char *name) const
uint32_t getNumAttachments() const
const Array<MeshAttachment> getAttachments() const
Array<MeshAttachment> getAttachments()
const MeshAttachment getAttachment(uint32_t index) const
MeshAttachment getAttachment(uint32_t index)

Local transform.

void setLocalTransform(Matrix4x3d transform)
const Matrix4x3d getLocalTransform() const

Global transform.

void setGlobalTransform(Matrix4x3d transform)
const Matrix4x3d getGlobalTransform() const

Pivot transform.

void setPivotTransform(Matrix4x3d transform)
const Matrix4x3d getPivotTransform() const

Morph transform.

void setMorphTransform(Vector4f transform)
const Vector4f getMorphTransform() const

Create transforms.

void createLocalTransforms(Matrix4x3d itransform = Matrix4x3d::identity)
void createGlobalTransforms(Matrix4x3d transform = Matrix4x3d::identity)

Apply transform.

void setTransform(Vector3d scale)

Memory usage.

size_t getMemory() const