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

Force renderer.

Visualizes force pushing on object by an arrow of the same direction and size. See Debug renderers for more information.

Basic usage

Example code:

DebugTools::ResourceManager::instance().set("my",
    DebugTools::ForceRendererOptions{}
        .setSize(5.0f)
        .setColor(Color3::fromHsv({120.0_degf, 1.0f, 0.7f})));

// Create debug renderer for given object, use "my" options for it
Vector3 force;
new DebugTools::ForceRenderer3D(*object, {0.3f, 1.5f, -0.7f}, force, "my",
        &debugDrawables);

Base classes

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

Constructors, destructors, conversion operators

ForceRenderer(SceneGraph::AbstractObject<dimensions, Float>& object, const VectorTypeFor<dimensions, Float>& forcePosition, const VectorTypeFor<dimensions, Float>& force, ResourceKey options = ResourceKey(), SceneGraph::DrawableGroup<dimensions, Float>* drawables = nullptr) explicit
Constructor.
ForceRenderer(SceneGraph::AbstractObject<dimensions, Float>&, const VectorTypeFor<dimensions, Float>&, VectorTypeFor<dimensions, Float>&&, ResourceKey = ResourceKey(), SceneGraph::DrawableGroup<dimensions, Float>* = nullptr) deleted

Function documentation

template<UnsignedInt dimensions>
Magnum::DebugTools::ForceRenderer<dimensions>::ForceRenderer(SceneGraph::AbstractObject<dimensions, Float>& object, const VectorTypeFor<dimensions, Float>& forcePosition, const VectorTypeFor<dimensions, Float>& force, ResourceKey options = ResourceKey(), SceneGraph::DrawableGroup<dimensions, Float>* drawables = nullptr) explicit

Constructor.

Parameters
object Object for which to create debug renderer
forcePosition Where to render the force, relative to object
force Force vector
options Options resource key. See class documentation for more information.
drawables Drawable group

The renderer is automatically added to object's features, force is saved as reference to original vector and thus it must be available for the whole lifetime of the renderer.

template<UnsignedInt dimensions>
Magnum::DebugTools::ForceRenderer<dimensions>::ForceRenderer(SceneGraph::AbstractObject<dimensions, Float>&, const VectorTypeFor<dimensions, Float>&, VectorTypeFor<dimensions, Float>&&, ResourceKey = ResourceKey(), SceneGraph::DrawableGroup<dimensions, Float>* = nullptr) deleted

You have to pass reference to existing force instance, as the renderer uses the current value when rendering.