1.3.9 • Published 10 months ago

@galacean/engine-toolkit-controls v1.3.9

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

Camera Controls

The Camera Controls, as the name implies, is a component that is used with the camera to display the 3D scene. This type of component customizes the corresponding parameters according to different functions, and controls the display of the 3D scene by affecting the properties of the camera.

Category

OrbitControl

OrbitControl is used to simulate orbital interaction, suitable for 360 rotation interaction around a target object, be sure to add the OrbitControl after adding the Camera component.

merge

Feature

AttributesMeaning
targetObservation point
autoRotateWhether to rotate automatically, the default is false, the rotation speed can be adjusted by autoRotateSpeed
autoRotateSpeedSpeed ​​of automatic rotation
enableDampingWhether to enable camera damping, the default is true
dampingFactorRotation damping parameter, default is 0.1
enableKeysWhether to support keyboard operation (up, down, left, and right keys)
enablePanWhether to support camera translation, the default is true
keyPanSpeedThe amplitude of the operation when the keyboard is continuously pressed
enableRotateWhether to support camera rotation, the default is true
rotateSpeedCamera rotation speed, the default is 1.0
enableZoomWhether to support camera zoom, the default is true
minAzimuthAngleWhen onUpdate, the minimum radian of a reasonable range for horizontal operation, the default is negative infinity
maxAzimuthAngleWhen onUpdate, the maximum radian of the reasonable range of horizontal operation, the default is positive infinity
minDistanceWhen onUpdate, the minimum value of the reasonable range of distance operation is judged
maxDistanceWhen onUpdate, the maximum value of the reasonable range of distance operation judged
minPolarAngleWhen onUpdate, the minimum arc within a reasonable range of vertical operation
maxPolarAngleWhen onUpdate, the maximum arc within a reasonable range of vertical operation

Example

OrbitControl-Examples

FreeControl

FreeControl are generally used for roaming control, often in game scenes, be sure to add the FreeControl after adding the Camera component.

merge

Feature

AttributesMeaning
floorMockWhether to simulate the ground, the default is true
floorYUse with floorMock to declare the location information of the ground
movementSpeedSpeed ​​of movement
rotateSpeedSpeed ​​of rotation

Example

FreeControl-Examples

OrthoControl

OrthoControl are generally used to control zoom and displacement in 2D scenes.

Feature

AttributesMeaning
zoomSpeedZoom Speed

Example

OrthoControl-Examples

merge

BoxSelectionControls

BoxSelectionControls is generally used in editor or RTS games to draw a rectangle on the screen and find objects in it.

https://user-images.githubusercontent.com/7953802/250814033-073aee92-cd8d-489e-8e89-d3cbeb26ee84.mov

npm

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

$ npm install @galacean/engine-toolkit-controls

This will allow you to import package entirely using:

import * as Controls from "@galacean/engine-toolkit-controls";

or individual classes using:

import { OrthoControl } from "@galacean/engine-toolkit-controls";

Usage

import { OrbitControl } from "@galacean/engine-toolkit-controls";

// Create engine
const engine = await WebGLEngine.create({ canvas: "canvas" });
engine.canvas.resizeByClientSize();

// Initialize root
const rootEntity = engine.sceneManager.activeScene.createRootEntity();

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

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.4.0-alpha.0

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.0

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

1 year 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