Magnum::DartIntegration::Object class

DART Physics BodyNode or ShapeNode.

Encapsulates BodyNode or ShapeNode as a SceneGraph feature.

Usage

Common usage is to create a DartIntegration::Object to share transformation with a DART BodyNode or ShapeNode by passing a pointer to its constructor:

dart::dynamics::BodyNode* bodyNode = ;
SceneGraph::Object<SceneGraph::MatrixTransformation3D> object;
auto* obj = new DartIntegration::Object{object, bodyNode};

or

dart::dynamics::ShapeNode* shapeNode = ;
SceneGraph::Object<SceneGraph::MatrixTransformation3D> object;
auto* obj = new DartIntegration::Object{object, shapeNode};

Only the DART body/node can affect the transformation of the Magnum object and not the other way around. To get the latest DART transformation, you should update the object with update().

Base classes

template<UnsignedInt dimensions, class T>
class Magnum::SceneGraph::AbstractFeature<Float>
Base for object features.

Constructors, destructors, conversion operators

template<class T>
Object(T& object, dart::dynamics::ShapeNode* node = nullptr)
Constructor.
template<class T>
Object(T& object, dart::dynamics::BodyNode* body = nullptr)
Constructor.

Public functions

auto update(Trade::AbstractImporter* importer = nullptr) -> Object&
Get transformation from DART.
auto isUpdated() const -> bool
Whether the object was updated.
auto clearUpdateFlag() -> Object&
Clear update flag.
auto hasUpdatedMesh() const -> bool
Whether object mesh was updated.
auto drawData() -> DrawData&
Data for drawing.
auto shapeNode() -> dart::dynamics::ShapeNode*
Underlying DART ShapeNode
auto bodyNode() -> dart::dynamics::BodyNode*
Underlying DART BodyNode

Function documentation

template<class T>
Magnum::DartIntegration::Object::Object(T& object, dart::dynamics::ShapeNode* node = nullptr)

Constructor.

Parameters
object SceneGraph::Object this DartIntegration::Object belongs to
node DART ShapeNode to connect with

template<class T>
Magnum::DartIntegration::Object::Object(T& object, dart::dynamics::BodyNode* body = nullptr)

Constructor.

Parameters
object SceneGraph::Object this DartIntegration::Object belongs to
body DART BodyNode to connect with

Object& Magnum::DartIntegration::Object::update(Trade::AbstractImporter* importer = nullptr)

Get transformation from DART.

Returns Reference to self (for method chaining)

bool Magnum::DartIntegration::Object::isUpdated() const

Whether the object was updated.

Object& Magnum::DartIntegration::Object::clearUpdateFlag()

Clear update flag.

Returns Reference to self (for method chaining)