Magnum::BulletIntegration::DebugDraw class

Bullet physics debug visualization.

This class implements btIDebugDraw, which allows rendering a visualization of a Bullet physics world for debugging purposes.

Usage

btDynamicsWorld* btWorld = // ...
DebugDraw debugDraw;

debugDraw.setDebugMode(DebugDraw::DebugMode::DrawWireframe|DebugDraw::DebugMode::DrawConstraints);
btWorld->setDebugDrawer(&debugDraw);

// Per frame call:

debugDraw.setTransformationProjectionMatrix(projection*view*transformation);
btWorld->debugDrawWorld();

Public types

enum class DebugMode: Int { NoDebug = DBG_NoDebug, DrawWireframe = DBG_DrawWireframe, DrawAabb = DBG_DrawAabb, DrawFeaturesText = DBG_DrawFeaturesText, DrawContactPoints = DBG_DrawContactPoints, NoDeactivation = DBG_NoDeactivation, NoHelpText = DBG_NoHelpText, DrawText = DBG_DrawText, ProfileTimings = DBG_ProfileTimings, EnableSatComparison = DBG_EnableSatComparison, DisableBulletLCP = DBG_DisableBulletLCP, EnableCCD = DBG_EnableCCD, DrawConstraints = DBG_DrawConstraints, DrawConstraintLimits = DBG_DrawConstraintLimits, FastWirefram = DBG_FastWireframe, DrawNormals = DBG_DrawNormals }
Debug mode.
using Mode = DebugMode deprecated
Debug mode.
using DebugModes = Containers::EnumSet<DebugMode>
Debug modes.
using Modes = DebugModes deprecated
Debug modes.

Constructors, destructors, conversion operators

DebugDraw(std::size_t initialBufferCapacity = 0) explicit
Constructor.

Public functions

auto debugMode() const -> DebugModes
Debug mode.
auto setDebugMode(DebugModes mode) -> DebugDraw&
Set debug mode.
auto setTransformationProjectionMatrix(const Matrix4& matrix) -> DebugDraw&
Set transformation projection matrix used for rendering.

Enum documentation

enum class Magnum::BulletIntegration::DebugDraw::DebugMode: Int

Debug mode.

Enumerators
NoDebug

Disable debug rendering

DrawWireframe

Draw wireframe of all collision shapes

DrawAabb

Draw axis aligned bounding box of all collision object

DrawFeaturesText

Draw text for features

DrawContactPoints

Draw contact points

NoDeactivation

Disable deactivation of objects

NoHelpText

Diable help text

DrawText

Enable text drawing

ProfileTimings

Profile timings

EnableSatComparison

Enable Sat Comparison

DisableBulletLCP

Disable Bullet LCP

EnableCCD

Enable CCD

DrawConstraints

Draw constaints

DrawConstraintLimits

Draw constraint limits

FastWirefram

Draw fast wireframes

DrawNormals

Draw normals

Typedef documentation

typedef DebugMode Magnum::BulletIntegration::DebugDraw::Mode

Debug mode.

typedef Containers::EnumSet<DebugMode> Magnum::BulletIntegration::DebugDraw::DebugModes

Debug modes.

typedef DebugModes Magnum::BulletIntegration::DebugDraw::Modes

Debug modes.

Function documentation

Magnum::BulletIntegration::DebugDraw::DebugDraw(std::size_t initialBufferCapacity = 0) explicit

Constructor.

Parameters
initialBufferCapacity Amount of lines for which to reserve memory in the buffer vector.

Sets up Shaders::VertexColor3D, GL::Buffer and GL::Mesh for physics debug rendering.

DebugDraw& Magnum::BulletIntegration::DebugDraw::setDebugMode(DebugModes mode)

Set debug mode.

Returns Reference to self (for method chaining)