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 |
---|---|---|---|
|
ToolMode | undefined |
Get the current tool mode. |
Methods
Method |
Modifiers |
Description |
---|---|---|
Attach event handlers to the scene. | ||
Destroy the instance. | ||
Remove event listeners from the scene. | ||
Set the tool mode. |