How to use the @egjs/axes.PinchInput function in @egjs/axes

To help you get started, we’ve selected a few @egjs/axes examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github naver / egjs-view360 / src / YawPitchControl / YawPitchControl.js View on Github external
_initAxes(opt) {
		const yRange = this._updateYawRange(opt.yawRange, opt.fov, opt.aspectRatio);
		const pRange = this._updatePitchRange(opt.pitchRange, opt.fov, opt.showPolePoint);
		const useRotation = opt.gyroMode === GYRO_MODE.VR;

		this.axesPanInput = new RotationPanInput(this._element, {useRotation});
		this.axesWheelInput = new WheelInput(this._element, {scale: -4});
		this.axesTiltMotionInput = null;
		this.axesPinchInput = SUPPORT_TOUCH ? new PinchInput(this._element, {scale: -1}) : null;
		this.axesMoveKeyInput = new MoveKeyInput(this._element, {scale: [-6, 6]});

		this.axes = new Axes({
			yaw: {
				range: yRange,
				circular: YawPitchControl.isCircular(yRange),
				bounce: [0, 0]
			},
			pitch: {
				range: pRange,
				circular: YawPitchControl.isCircular(pRange),
				bounce: [0, 0]
			},
			fov: {
				range: opt.fovRange,
				circular: [false, false],
github daybrush / scenejs-editor / packages / react-scenejs-timeline / src / react-scenejs-timeline / Timeline.tsx View on Github external
private initWheelZoom() {
        const scrollArea = this.scrollArea.getElement();
        const axes = this.axes!;

        if (SUPPORT_TOUCH || SUPPORT_POINTER_EVENTS) {
            axes.connect("zoom", new PinchInput(scrollArea, {
                scale: 0.1,
                hammerManagerOptions: {
                    touchAction: "auto",
                },
            }));
        }
        axes.on("hold", e => {
            if (e.inputEvent) {
                e.inputEvent.preventDefault();
            }
        });
        axes.on("change", e => {
            if (e.pos.zoom === this.state.zoom) {
                return;
            }
            this.setState({

@egjs/axes

A module used to change the information of user action entered by various input devices such as touch screen or mouse into the logical virtual coordinates. You can easily create a UI that responds to user actions.

MIT
Latest version published 3 months ago

Package Health Score

75 / 100
Full package analysis

Similar packages