remove MouseControl
This commit is contained in:
parent
b616ce8cf2
commit
58a9df63bf
|
@ -37,10 +37,10 @@ Three.js powered Minecraft skin viewer.
|
|||
skinViewer.height = 400;
|
||||
|
||||
// Control objects with your mouse!
|
||||
let control = new skinview3d.SkinControl(skinViewer);
|
||||
control.rotation = true;
|
||||
control.zoom = false;
|
||||
control.pan = false;
|
||||
let control = skinview3d.createOrbitControls(skinViewer);
|
||||
control.enableRotate = true;
|
||||
control.enableZoom = false;
|
||||
control.enablePan = false;
|
||||
|
||||
skinViewer.animation = new skinview3d.CompositeAnimation();
|
||||
|
||||
|
|
|
@ -593,4 +593,17 @@ class OrbitControls extends THREE.EventDispatcher {
|
|||
}
|
||||
}
|
||||
|
||||
export { OrbitControls };
|
||||
function createOrbitControls(skinViewer) {
|
||||
let control = new OrbitControls(skinViewer.camera, skinViewer.renderer.domElement);
|
||||
|
||||
// default configuration
|
||||
control.enablePan = false;
|
||||
control.target = new THREE.Vector3(0, -12, 0);
|
||||
control.minDistance = 10;
|
||||
control.maxDistance = 256;
|
||||
control.update();
|
||||
|
||||
return control;
|
||||
}
|
||||
|
||||
export { OrbitControls, createOrbitControls };
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
export { SkinObject, CapeObject, PlayerObject } from "./model";
|
||||
export { SkinViewer, MouseControl } from "./viewer";
|
||||
export { SkinViewer } from "./viewer";
|
||||
export { OrbitControls, createOrbitControls } from "./orbit_controls";
|
||||
export {
|
||||
invokeAnimation,
|
||||
CompositeAnimation,
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import * as THREE from "three";
|
||||
import { PlayerObject } from "./model";
|
||||
import { OrbitControls } from "./orbit_controls";
|
||||
import { invokeAnimation } from "./animation";
|
||||
|
||||
function copyImage(context, sX, sY, w, h, dX, dY, flipHorizontal) {
|
||||
|
@ -228,45 +227,4 @@ class SkinViewer {
|
|||
}
|
||||
}
|
||||
|
||||
class MouseControl {
|
||||
constructor(skinViewer) {
|
||||
this.skinViewer = skinViewer;
|
||||
|
||||
this.orbitControls = new OrbitControls(skinViewer.camera, skinViewer.renderer.domElement);
|
||||
this.orbitControls.enablePan = false;
|
||||
this.orbitControls.target = new THREE.Vector3(0, -12, 0);
|
||||
this.orbitControls.minDistance = 10;
|
||||
this.orbitControls.maxDistance = 256;
|
||||
this.orbitControls.update();
|
||||
}
|
||||
|
||||
get rotation() {
|
||||
return this.orbitControls.enableRotate;
|
||||
}
|
||||
|
||||
set rotation(value) {
|
||||
this.orbitControls.enableRotate = value;
|
||||
}
|
||||
|
||||
get zoom() {
|
||||
return this.orbitControls.enableZoom;
|
||||
}
|
||||
|
||||
set zoom(value) {
|
||||
this.orbitControls.enableZoom = value;
|
||||
}
|
||||
|
||||
get pan() {
|
||||
return this.orbitControls.enablePan;
|
||||
}
|
||||
|
||||
set pan(value) {
|
||||
this.orbitControls.enablePan = value;
|
||||
}
|
||||
|
||||
dispose() {
|
||||
this.orbitControls.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
export { SkinViewer, MouseControl };
|
||||
export { SkinViewer };
|
||||
|
|
Loading…
Reference in New Issue