Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
_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],
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({