1.3.9 • Published 10 months ago

@galacean/engine-toolkit-gizmo v1.3.9

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Gizmo

Gizmos allow for mouse-controlled translation, rotation, and scaling within the 3D Viewport.

There is a distinct gizmo for each operation, which can be used individually or in conjunction with one another.

Each gizmo features three color-coded axes: X (green), Y (blue), and Z (red). To transform along a specific axis, drag it with the left mouse button. The Move and Scale gizmos also have small, colored squares that allow for transforming along two axes simultaneously.

Translate

Show the gizmo to control the location.

Rotate

Show the gizmo to control the rotation.

Scale

Show the gizmo to control the scale. Dragging the center cube scales along all three axes.

merge

Feature

AttributesMeaning
GroupStore selection. Need to init with gizmo.
AnchorTypeGizmo Position. Center for at the center of the selection, Pivot for at the pivot point
CoordinateTypeGizmo Rotation. Local aligns to the selection's local space. Global aligns to the world space orientation
StateGizmo State. translate rotate scale all
EventMeaning
gizmo-move-startFire when gizmo moving start. Could get the triggered axis from event value.
gizmo-move-endFire when gizmo moving end.

Example

Gizmo-Examples

npm

The Gizmo is published on npm with full typing support. To install, use:

$ npm install @galacean/engine-toolkit-gizmo

This will allow you to import package entirely using:

import { Gizmo, Group, AnchorType, CoordinateType, State } from "@galacean/engine-toolkit-gizmo";

Usage

// Initialize camera entity.
const cameraEntity = rootEntity.createChild("camera");
const camera = cameraEntity.addComponent(Camera);

// Initialize group for selection
const group = new Group();

// add gizmo
const gizmoEntity = rootEntity.createChild("editor-gizmo");
const gizmo = gizmoEntity.addComponent(Gizmo);
gizmo.init(camera, group);
gizmo.state = State.translate;

Links

License

The engine is released under the MIT license. See LICENSE file.

1.3.9

10 months ago

1.3.8

10 months ago

1.3.7

10 months ago

1.3.6

10 months ago

1.3.5

10 months ago

1.3.4

10 months ago

1.3.3

10 months ago

1.4.0-alpha.1

10 months ago

1.3.2

10 months ago

1.3.1

10 months ago

1.2.0

12 months ago

1.2.0-beta.9

1 year ago

1.2.0-beta.8

1 year ago

1.2.0-beta.5

1 year ago

1.2.0-beta.7

1 year ago

1.2.0-beta.6

1 year ago

1.3.0-alpha.5

12 months ago

1.3.0-alpha.2

12 months ago

1.3.0-alpha.1

12 months ago

1.3.0-alpha.4

12 months ago

1.3.0-alpha.3

12 months ago

1.3.0

11 months ago

1.3.0-beta.1

12 months ago

1.3.0-beta.2

12 months ago

1.3.0-beta.3

11 months ago

1.2.0-beta.10

1 year ago

1.3.0-beta.0

12 months ago

1.2.0-beta.4

1 year ago

1.2.0-beta.3

1 year ago

1.1.0

1 year ago

1.2.0-beta.1

1 year ago

1.2.0-beta.0

1 year ago

1.2.0-beta.2

1 year ago

1.2.0-alpha.13

1 year ago

1.2.0-alpha.12

1 year ago

1.2.0-alpha.10

1 year ago

1.2.0-alpha.9

1 year ago

1.2.0-alpha.8

1 year ago

1.2.0-alpha.7

1 year ago

1.2.0-alpha.6

1 year ago

1.2.0-alpha.5

1 year ago

1.2.0-alpha.4

2 years ago

1.2.0-alpha.3

2 years ago

1.2.0-alpha.2

2 years ago

1.0.1

2 years ago

1.0.1-latest.1

2 years ago

1.1.0-beta.6

2 years ago

1.1.0-beta.5

2 years ago

1.1.0-beta.4

2 years ago

1.0.0

2 years ago

1.0.0-beta.5

2 years ago

1.1.0-beta.2

2 years ago

1.1.0-beta.1

2 years ago

1.1.0-beta.0

2 years ago

1.1.0-alpha.0

2 years ago

1.0.0-beta.6

2 years ago

1.0.0-beta.7

2 years ago

1.0.0-beta.3

2 years ago

1.0.0-beta.2

2 years ago

1.0.0-beta.0

2 years ago

1.0.0-beta.1

2 years ago

0.9.0

2 years ago

0.9.0-beta.8

2 years ago

1.0.0-alpha.20

2 years ago

0.9.0-beta.7

2 years ago

1.0.0-alpha.19

2 years ago

0.9.0-beta.6

2 years ago