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 — note that the force is saved as a reference to the original vector (so when you update it, the renderer updates itself as well), and thus it must be available for the whole lifetime of the renderer. The renderer is automatically added to object's features so you don't need to keep a reference to it.

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

Vector3 force; // taken as a reference, has to be kept in scope

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

Base classes

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

Constructors, destructors, conversion operators

ForceRenderer(ResourceManager& manager, 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(ResourceManager&, SceneGraph::AbstractObject<dimensions, Float>&, const VectorTypeFor<dimensions, Float>&, VectorTypeFor<dimensions, Float>&&, ResourceKey = ResourceKey(), SceneGraph::DrawableGroup<dimensions, Float>* = nullptr) deleted explicit
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) deprecated in 2019.10 explicit
Constructor.

Function documentation

template<UnsignedInt dimensions>
Magnum::DebugTools::ForceRenderer<dimensions>::ForceRenderer(ResourceManager& manager, 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
manager Resource manager instance
object Object for which to create debug renderer
forcePosition Where to render the force, relative to object
force Reference to the force vector
options Options resource key. See class documentation for more information.
drawables Drawable group

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

You have to pass a reference to an external force vector — the renderer doesn't store a copy.

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.