Skip to content

Commit ba6a58d

Browse files
authored
fix(types): Remove usages of ambient THREE namespace (#346)
1 parent 11bd428 commit ba6a58d

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

src/animation/MMDPhysics.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Bone, Euler, Matrix4, Object3D, Quaternion, SkinnedMesh, Vector3 } from 'three'
1+
import { Bone, Euler, Matrix4, MeshBasicMaterial, Object3D, Quaternion, SkinnedMesh, Vector3 } from 'three'
22

33
export interface MMDPhysicsParameter {
44
unitStep?: number | undefined
@@ -110,10 +110,10 @@ export class Constraint {
110110
}
111111

112112
export class MMDPhysicsHelper extends Object3D {
113-
mesh: THREE.SkinnedMesh
113+
mesh: SkinnedMesh
114114
physics: MMDPhysics
115-
materials: [THREE.MeshBasicMaterial, THREE.MeshBasicMaterial, THREE.MeshBasicMaterial]
115+
materials: [MeshBasicMaterial, MeshBasicMaterial, MeshBasicMaterial]
116116

117-
constructor(mesh: THREE.SkinnedMesh, physics: MMDPhysics)
117+
constructor(mesh: SkinnedMesh, physics: MMDPhysics)
118118
dispose(): void
119119
}

src/controls/OrbitControls.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -274,10 +274,7 @@ class OrbitControls extends EventDispatcher {
274274

275275
// adjust the camera position based on zoom only if we're not zooming to the cursor or if it's an ortho camera
276276
// we adjust zoom later in these cases
277-
if (
278-
(scope.zoomToCursor && performCursorZoom) ||
279-
(scope.object as THREE.OrthographicCamera).isOrthographicCamera
280-
) {
277+
if ((scope.zoomToCursor && performCursorZoom) || (scope.object as OrthographicCamera).isOrthographicCamera) {
281278
spherical.radius = clampDistance(spherical.radius)
282279
} else {
283280
spherical.radius = clampDistance(spherical.radius * scale)
@@ -317,7 +314,7 @@ class OrbitControls extends EventDispatcher {
317314
const radiusDelta = prevRadius - newRadius
318315
scope.object.position.addScaledVector(dollyDirection, radiusDelta)
319316
scope.object.updateMatrixWorld()
320-
} else if ((scope.object as THREE.OrthographicCamera).isOrthographicCamera) {
317+
} else if ((scope.object as OrthographicCamera).isOrthographicCamera) {
321318
// adjust the ortho camera position based on zoom changes
322319
const mouseBefore = new Vector3(mouse.x, mouse.y, 0)
323320
mouseBefore.unproject(scope.object)

src/utils/RoughnessMipmapper.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import { WebGLRenderer } from 'three'
1+
import { Material, WebGLRenderer } from 'three'
22

33
export class RoughnessMipmapper {
44
constructor(renderer: WebGLRenderer)
55

6-
generateMipmaps(material: THREE.Material): void
6+
generateMipmaps(material: Material): void
77
dispose(): void
88
}

0 commit comments

Comments
 (0)