Skip to content

fix(types): fix usages of ambient THREE namespace #346

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/animation/MMDPhysics.d.ts
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -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
}