Tool class

Implementation of basic editing tools.

Signature:

declare class Tool 

Remarks

This class is meant to bootstrap simple editing scenes quickly. It's also a demonstration of how you can build editing tools with the Core3D SDK.

This implementation supports "move", "rotate", and "scale" operations.

Internally, this tool adds event listeners to the events emitted by a SceneInterface and uses pointer position changes to compute new values for ModifierInterface position, rotation, and scale options. It operates on the `target` of the scene.

Currently only GraphicAssignment, MaterialAssignment, and PatternAssignment are supported.

For many use cases, this set of tools alone will suffice, but you always have the option to build your own tool implementations to achieve desired functionality.

Constructors

Constructor

Modifiers

Description

(constructor)({ autoAttach, autoRender, fetchModifiers, mode, scene, })

Constructor

Properties

Property

Modifiers

Type

Description

mode

readonly

ToolMode | undefined

Get the current tool mode.

Methods

Method

Modifiers

Description

attach()

Attach event handlers to the scene.

destroy()

Destroy the instance.

detach()

Remove event listeners from the scene.

setMode(mode)

Set the tool mode.

Get in touch

We'd love to learn more about your vision and how we can help.

PressPrivacyTermsSupportCopyright © 2024 Core3D, Inc. All Rights Reserved.