template<UnsignedInt dimensions>
Magnum::DebugTools::ShapeRenderer class

Shape renderer.

Visualizes collision shapes using wireframe primitives. See Debug renderers for more information.

Basic usage

Example code:

// Create some options
DebugTools::ResourceManager::instance().set("red",
    DebugTools::ShapeRendererOptions().setColor({1.0f, 0.0f, 0.0f}));

// Create debug renderer for given shape, use "red" options for it
Shapes::AbstractShape2D* shape;
new DebugTools::ShapeRenderer2D(shape, "red", debugDrawables);

Base classes

template<UnsignedInt dimensions, class T>
class Magnum::SceneGraph::Drawable
Drawable.

Constructors, destructors, conversion operators

ShapeRenderer(Shapes::AbstractShape<dimensions>& shape, ResourceKey options = ResourceKey(), SceneGraph::DrawableGroup<dimensions, Float>* drawables = nullptr) explicit
Constructor.

Private functions

void draw(const MatrixTypeFor<dimensions, Float>& transformationMatrix, SceneGraph::Camera<dimensions, Float>& camera) override virtual
Draw the object using given camera.

Function documentation

template<UnsignedInt dimensions>
Magnum::DebugTools::ShapeRenderer<dimensions>::ShapeRenderer(Shapes::AbstractShape<dimensions>& shape, ResourceKey options = ResourceKey(), SceneGraph::DrawableGroup<dimensions, Float>* drawables = nullptr) explicit

Constructor.

Parameters
shape Shape for which to create debug renderer
options Options resource key. See class documentation for more information.
drawables Drawable group

The renderer is automatically added to shape's object features, shape must be available for the whole lifetime of the renderer and if it is group, it must not change its internal structure.

template<UnsignedInt dimensions>
void Magnum::DebugTools::ShapeRenderer<dimensions>::draw(const MatrixTypeFor<dimensions, Float>& transformationMatrix, SceneGraph::Camera<dimensions, Float>& camera) override virtual private

Draw the object using given camera.

Parameters
transformationMatrix Object transformation relative to camera
camera Camera

Projection matrix can be retrieved from Camera::projectionMatrix().