Magnum::DartIntegration namespace

Integration with DART Dynamic Animation and Robotics Toolkit.

Conversion of nodes and shapes for visualizing physics simulation.

This library depends on the DART library and is built if MAGNUM_WITH_DART is enabled when building Magnum Integration. To use this library with CMake, put FindMagnumIntegration.cmake into your modules/ directory, request the Dart component of the MagnumIntegration package and link to the MagnumIntegration::Dart target:

find_package(MagnumIntegration REQUIRED Dart)

# ...
target_link_libraries(your-app PRIVATE MagnumIntegration::Dart)

Additionally, if you're using Magnum as a CMake subproject, bundle the magnum-integration repository and do the following before calling find_package(). Using DART itself as a CMake subproject isn't tested at the moment, so you need to provide it as a system dependency and point CMAKE_PREFIX_PATH to its installation dir if necessary.

set(MAGNUM_WITH_DART ON CACHE BOOL "" FORCE)
add_subdirectory(magnum-integration EXCLUDE_FROM_ALL)

DART is using Eigen for mathematics and you might want to use the EigenIntegration library for easy conversion between Eigen and Magnum math types. See also the DART Physics example, Downloading and building integration libraries and Integration library usage with CMake for more information.

Classes

struct DrawData
Shape draw data.
class Object
DART Physics BodyNode or ShapeNode.
struct ShapeData
Shape data.
class World
DART physics world.

Enums

enum class ConvertShapeType: UnsignedInt { Material = 1 << 0, Primitive = 1 << 1, Mesh = 1 << 2, All = Material|Primitive|Mesh }
Shape convert type.

Typedefs

using ConvertShapeTypes = Containers::EnumSet<ConvertShapeType>
Shape convert types.

Functions

auto convertShapeNode(dart::dynamics::ShapeNode& shapeNode, ConvertShapeTypes convertTypes, Trade::AbstractImporter* importer = nullptr) -> Containers::Optional<ShapeData>
Convert dart::dynamics::ShapeNode to meshes and material data.

Enum documentation

enum class Magnum::DartIntegration::ConvertShapeType: UnsignedInt

Shape convert type.

Enumerators
Material

Load only material information

Primitive

Load scaling information

Mesh

Load full meshes

All

Load everything

Typedef documentation

typedef Containers::EnumSet<ConvertShapeType> Magnum::DartIntegration::ConvertShapeTypes

Shape convert types.

Function documentation

Containers::Optional<ShapeData> Magnum::DartIntegration::convertShapeNode(dart::dynamics::ShapeNode& shapeNode, ConvertShapeTypes convertTypes, Trade::AbstractImporter* importer = nullptr)

Convert dart::dynamics::ShapeNode to meshes and material data.

Returns Corrade::Containers::NullOpt if the shape of given ShapeNode is not supported. The following DART shapes are supported:

  • BoxShape
  • CapsuleShape
  • ConeShape
  • CylinderShape
  • EllipsoidShape
  • MeshShape
  • SoftMeshShape
  • SphereShape

The following DART shapes are not yet supported:

  • LineSegmentShape
  • MultiSphereConvexHullShape
  • PlaneShape (this is an infinite plane with normal)

The importer argument is an optional instance of Trade::AssimpImporter. It is only used when loading dart::dynamics::ShapeNode with a shape of type dart::dynamics::MeshShape. As a consequence, you can omit it you do not want to load such a dart::dynamics::ShapeNode. On the contrary, when you are trying to load a dart::dynamics::MeshShape and the importer is a nullptr, the function will return Corrade::Containers::NullOpt.