export controls
This commit is contained in:
@ -74,7 +74,7 @@ class Stats {
|
||||
}
|
||||
|
||||
get time() {
|
||||
return this.clock.timeFormat.format(this.clock.elapsedTime * 1000)
|
||||
return this.clock.timeFormat.format(this.clock.getElapsedTime() * 1000)
|
||||
}
|
||||
|
||||
lockDown(nbClearedLines, tSpin) {
|
24
jsm/TetraControls.js
Normal file
24
jsm/TetraControls.js
Normal file
@ -0,0 +1,24 @@
|
||||
|
||||
import { OrbitControls } from 'three/addons/controls/OrbitControls.js'
|
||||
|
||||
|
||||
class TetraControls extends OrbitControls {
|
||||
constructor(camera, domElement) {
|
||||
super(camera, domElement)
|
||||
this.autoRotate
|
||||
this.enableDamping = true
|
||||
this.dampingFactor = 0.04
|
||||
this.maxDistance = 21
|
||||
this.keys = {}
|
||||
this.minPolarAngle = 0.9
|
||||
this.maxPolarAngle = 2.14
|
||||
this.minAzimuthAngle = 0.9 - Math.PI / 2
|
||||
this.maxAzimuthAngle = 2.14 - Math.PI / 2
|
||||
this.target.set(5, 9, 0)
|
||||
|
||||
this.addEventListener("start", () => domElement.style.cursor = "grabbing")
|
||||
this.addEventListener("end", () => domElement.style.cursor = "grab")
|
||||
}
|
||||
}
|
||||
|
||||
export { TetraControls }
|
Reference in New Issue
Block a user