Skip to content

Commit

Permalink
fix(types): Remove usages of ambient THREE namespace (#346)
Browse files Browse the repository at this point in the history
  • Loading branch information
Methuselah96 committed Mar 3, 2024
1 parent 11bd428 commit ba6a58d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/animation/MMDPhysics.d.ts
@@ -1,4 +1,4 @@
import { Bone, Euler, Matrix4, Object3D, Quaternion, SkinnedMesh, Vector3 } from 'three'
import { Bone, Euler, Matrix4, MeshBasicMaterial, Object3D, Quaternion, SkinnedMesh, Vector3 } from 'three'

export interface MMDPhysicsParameter {
unitStep?: number | undefined
Expand Down Expand Up @@ -110,10 +110,10 @@ export class Constraint {
}

export class MMDPhysicsHelper extends Object3D {
mesh: THREE.SkinnedMesh
mesh: SkinnedMesh
physics: MMDPhysics
materials: [THREE.MeshBasicMaterial, THREE.MeshBasicMaterial, THREE.MeshBasicMaterial]
materials: [MeshBasicMaterial, MeshBasicMaterial, MeshBasicMaterial]

constructor(mesh: THREE.SkinnedMesh, physics: MMDPhysics)
constructor(mesh: SkinnedMesh, physics: MMDPhysics)
dispose(): void
}
7 changes: 2 additions & 5 deletions src/controls/OrbitControls.ts
Expand Up @@ -274,10 +274,7 @@ class OrbitControls extends EventDispatcher {

// adjust the camera position based on zoom only if we're not zooming to the cursor or if it's an ortho camera
// we adjust zoom later in these cases
if (
(scope.zoomToCursor && performCursorZoom) ||
(scope.object as THREE.OrthographicCamera).isOrthographicCamera
) {
if ((scope.zoomToCursor && performCursorZoom) || (scope.object as OrthographicCamera).isOrthographicCamera) {
spherical.radius = clampDistance(spherical.radius)
} else {
spherical.radius = clampDistance(spherical.radius * scale)
Expand Down Expand Up @@ -317,7 +314,7 @@ class OrbitControls extends EventDispatcher {
const radiusDelta = prevRadius - newRadius
scope.object.position.addScaledVector(dollyDirection, radiusDelta)
scope.object.updateMatrixWorld()
} else if ((scope.object as THREE.OrthographicCamera).isOrthographicCamera) {
} else if ((scope.object as OrthographicCamera).isOrthographicCamera) {
// adjust the ortho camera position based on zoom changes
const mouseBefore = new Vector3(mouse.x, mouse.y, 0)
mouseBefore.unproject(scope.object)
Expand Down
4 changes: 2 additions & 2 deletions src/utils/RoughnessMipmapper.d.ts
@@ -1,8 +1,8 @@
import { WebGLRenderer } from 'three'
import { Material, WebGLRenderer } from 'three'

export class RoughnessMipmapper {
constructor(renderer: WebGLRenderer)

generateMipmaps(material: THREE.Material): void
generateMipmaps(material: Material): void
dispose(): void
}

0 comments on commit ba6a58d

Please sign in to comment.