diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index d9204917a..773fa882d 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -25,6 +25,7 @@ To check an item, place an "x" in the box like so: "- [x] Documentation" Remove items that are irrelevant to your changes. --> +- [ ] Checked the target branch (current goes `master`, next goes `dev`) - [ ] Added myself to contributors table - [ ] Ready to be merged diff --git a/README.md b/README.md index 8b7fe375d..a941847b0 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,9 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Max Kaye

📖
Alejandro Laufer

🐛 💻 +
Joe Tipping

💻 +
r00ster91

💻 + diff --git a/types/three/OTHER_FILES.txt b/types/three/OTHER_FILES.txt index 6734de542..2a24ea15a 100644 --- a/types/three/OTHER_FILES.txt +++ b/types/three/OTHER_FILES.txt @@ -256,6 +256,7 @@ examples/jsm/shaders/VolumeShader.d.ts examples/jsm/shaders/WaterRefractionShader.d.ts examples/jsm/utils/BufferGeometryUtils.d.ts examples/jsm/utils/GeometryCompressionUtils.d.ts +examples/jsm/utils/PackedPhongMaterial.d.ts examples/jsm/utils/SceneUtils.d.ts examples/jsm/utils/ShadowMapViewer.d.ts examples/jsm/utils/SkeletonUtils.d.ts diff --git a/types/three/examples/jsm/WebGL.d.ts b/types/three/examples/jsm/capabilities/WebGL.d.ts similarity index 83% rename from types/three/examples/jsm/WebGL.d.ts rename to types/three/examples/jsm/capabilities/WebGL.d.ts index eddff8b73..a1883a6ca 100644 --- a/types/three/examples/jsm/WebGL.d.ts +++ b/types/three/examples/jsm/capabilities/WebGL.d.ts @@ -1,7 +1,9 @@ -export namespace WEBGL { +declare namespace WEBGL { function isWebGLAvailable(): boolean; function isWebGL2Available(): boolean; function getWebGLErrorMessage(): HTMLElement; function getWebGL2ErrorMessage(): HTMLElement; function getErrorMessage(version: number): HTMLElement; } + +export default WEBGL; diff --git a/types/three/examples/jsm/controls/OrbitControls.d.ts b/types/three/examples/jsm/controls/OrbitControls.d.ts index e2c174edd..38ffc57e9 100644 --- a/types/three/examples/jsm/controls/OrbitControls.d.ts +++ b/types/three/examples/jsm/controls/OrbitControls.d.ts @@ -42,7 +42,6 @@ export class OrbitControls { autoRotate: boolean; autoRotateSpeed: number; - enableKeys: boolean; keys: { LEFT: string; UP: string; RIGHT: string; BOTTOM: string }; mouseButtons: { LEFT: MOUSE; MIDDLE: MOUSE; RIGHT: MOUSE }; touches: { ONE: TOUCH; TWO: TOUCH }; diff --git a/types/three/examples/jsm/utils/PackedPhongMaterial.d.ts b/types/three/examples/jsm/utils/PackedPhongMaterial.d.ts new file mode 100644 index 000000000..61178f540 --- /dev/null +++ b/types/three/examples/jsm/utils/PackedPhongMaterial.d.ts @@ -0,0 +1,10 @@ +/** + * `PackedPhongMaterial` inherited from THREE.MeshPhongMaterial + * + * @param {Object} parameters + */ +import { MeshPhongMaterial, MeshPhongMaterialParameters } from '../../../src/Three'; + +export class PackedPhongMaterial extends MeshPhongMaterial { + constructor(parameters: MeshPhongMaterialParameters); +} diff --git a/types/three/examples/jsm/utils/SceneUtils.d.ts b/types/three/examples/jsm/utils/SceneUtils.d.ts index b08475ab4..4783d7eec 100644 --- a/types/three/examples/jsm/utils/SceneUtils.d.ts +++ b/types/three/examples/jsm/utils/SceneUtils.d.ts @@ -1,14 +1,12 @@ import { BufferGeometry, Group, InstancedMesh, Material, Object3D, Scene } from '../../../src/Three'; -export namespace SceneUtils { - function createMeshesFromInstancedMesh(instancedMesh: InstancedMesh): Group; - function createMultiMaterialObject(geometry: BufferGeometry, materials: Material[]): Group; - /** - * @deprecated Use scene.attach( child ) instead. - */ - function detach(child: Object3D, parent: Object3D, scene: Scene): void; - /** - * @deprecated Use parent.attach( child ) instead. - */ - function attach(child: Object3D, scene: Scene, parent: Object3D): void; -} +export function createMeshesFromInstancedMesh(instancedMesh: InstancedMesh): Group; +export function createMultiMaterialObject(geometry: BufferGeometry, materials: Material[]): Group; +/** + * @deprecated Use scene.attach( child ) instead. + */ +export function detach(child: Object3D, parent: Object3D, scene: Scene): void; +/** + * @deprecated Use parent.attach( child ) instead. + */ +export function attach(child: Object3D, scene: Scene, parent: Object3D): void; diff --git a/types/three/index.d.ts b/types/three/index.d.ts index 655dfe3cc..ce805d5cd 100644 --- a/types/three/index.d.ts +++ b/types/three/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for three 0.136 +// Type definitions for three 0.137 // Project: https://threejs.org/ // Definitions by: Josh Ellis // Nathan Bierema diff --git a/types/three/src/constants.d.ts b/types/three/src/constants.d.ts index 201a367d5..b602e0781 100644 --- a/types/three/src/constants.d.ts +++ b/types/three/src/constants.d.ts @@ -302,8 +302,6 @@ export enum TextureEncoding {} export const LinearEncoding: TextureEncoding; export const sRGBEncoding: TextureEncoding; export const LogLuvEncoding: TextureEncoding; -export const RGBM7Encoding: TextureEncoding; -export const RGBM16Encoding: TextureEncoding; // Depth packing strategies export enum DepthPackingStrategies {} diff --git a/types/three/src/core/Raycaster.d.ts b/types/three/src/core/Raycaster.d.ts index 7717b0da4..9c437171f 100644 --- a/types/three/src/core/Raycaster.d.ts +++ b/types/three/src/core/Raycaster.d.ts @@ -22,6 +22,7 @@ export interface Intersection { faceIndex?: number | undefined; object: TIntersected; uv?: Vector2 | undefined; + uv2?: Vector2 | undefined; instanceId?: number | undefined; } @@ -94,7 +95,7 @@ export class Raycaster { /** * Checks all intersection between the ray and the object with or without the descendants. Intersections are returned sorted by distance, closest first. * @param object The object to check for intersection with the ray. - * @param recursive If true, it also checks all descendants. Otherwise it only checks intersecton with the object. Default is false. + * @param recursive If true, it also checks all descendants. Otherwise it only checks intersecton with the object. Default is true. * @param optionalTarget (optional) target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;). */ intersectObject( @@ -108,7 +109,7 @@ export class Raycaster { * Intersections are returned sorted by distance, closest first. * Intersections are of the same form as those returned by .intersectObject. * @param objects The objects to check for intersection with the ray. - * @param recursive If true, it also checks all descendants of the objects. Otherwise it only checks intersecton with the objects. Default is false. + * @param recursive If true, it also checks all descendants of the objects. Otherwise it only checks intersecton with the objects. Default is true. * @param optionalTarget (optional) target to set the result. Otherwise a new Array is instantiated. If set, you must clear this array prior to each call (i.e., array.length = 0;). */ intersectObjects( diff --git a/types/three/src/renderers/webxr/WebXRManager.d.ts b/types/three/src/renderers/webxr/WebXRManager.d.ts index 71c321ac5..9efba0681 100644 --- a/types/three/src/renderers/webxr/WebXRManager.d.ts +++ b/types/three/src/renderers/webxr/WebXRManager.d.ts @@ -25,7 +25,7 @@ export class WebXRManager extends EventDispatcher { getSession(): XRSession | null; setSession(value: XRSession): Promise; getCamera(camera: Camera): Camera; - setAnimationLoop(callback: XRFrameRequestCallback): void; + setAnimationLoop(callback: XRFrameRequestCallback | null): void; getFoveation(): number | undefined; setFoveation(foveation: number): void; dispose(): void; diff --git a/types/three/test/loaders/loaders-voxloader.ts b/types/three/test/loaders/loaders-voxloader.ts index 38ebc7790..70c9edd16 100644 --- a/types/three/test/loaders/loaders-voxloader.ts +++ b/types/three/test/loaders/loaders-voxloader.ts @@ -2,7 +2,7 @@ import * as THREE from 'three'; import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'; import { VOXLoader, VOXData3DTexture } from 'three/examples/jsm/loaders/VOXLoader'; -import { WEBGL } from 'three/examples/jsm/WebGL'; +import WEBGL from 'three/examples/jsm/capabilities/WebGL'; if (!WEBGL.isWebGL2Available()) { document.body.appendChild(WEBGL.getWebGL2ErrorMessage()); diff --git a/types/three/test/materials/materials-envmaps-hdr.ts b/types/three/test/materials/materials-envmaps-hdr.ts index 34fb9d8cf..7a61d7b64 100644 --- a/types/three/test/materials/materials-envmaps-hdr.ts +++ b/types/three/test/materials/materials-envmaps-hdr.ts @@ -123,11 +123,12 @@ function init() { }); const rgbmUrls = ['px.png', 'nx.png', 'py.png', 'ny.png', 'pz.png', 'nz.png']; - rgbmCubeMap = new RGBMLoader().setPath('./textures/cube/pisaRGBM16/').loadCubemap(rgbmUrls, () => { - rgbmCubeMap.encoding = THREE.RGBM16Encoding; - - rgbmCubeRenderTarget = pmremGenerator.fromCubemap(rgbmCubeMap); - }); + rgbmCubeMap = new RGBMLoader() + .setMaxRange(16) + .setPath('./textures/cube/pisaRGBM16/') + .loadCubemap(rgbmUrls, () => { + rgbmCubeRenderTarget = pmremGenerator.fromCubemap(rgbmCubeMap); + }); const pmremGenerator = new THREE.PMREMGenerator(renderer); pmremGenerator.compileCubemapShader(); diff --git a/types/three/test/materials/materials-texture3d-partialupdate.ts b/types/three/test/materials/materials-texture3d-partialupdate.ts index ef7622976..35dfe63c2 100644 --- a/types/three/test/materials/materials-texture3d-partialupdate.ts +++ b/types/three/test/materials/materials-texture3d-partialupdate.ts @@ -2,7 +2,7 @@ import * as THREE from 'three'; import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'; import { ImprovedNoise } from 'three/examples/jsm/math/ImprovedNoise'; -import { WEBGL } from 'three/examples/jsm/WebGL'; +import WEBGL from 'three/examples/jsm/capabilities/WebGL'; if (!WEBGL.isWebGL2Available()) { document.body.appendChild(WEBGL.getWebGL2ErrorMessage()); diff --git a/types/three/test/renderers/renderers-renderTarget-multiple.ts b/types/three/test/renderers/renderers-renderTarget-multiple.ts index 14946d6f6..b584ce36a 100644 --- a/types/three/test/renderers/renderers-renderTarget-multiple.ts +++ b/types/three/test/renderers/renderers-renderTarget-multiple.ts @@ -1,6 +1,6 @@ import * as THREE from 'three'; -import { WEBGL } from 'three/examples/jsm/WebGL'; +import WEBGL from 'three/examples/jsm/capabilities/WebGL'; import { OrbitControls } from 'three/examples/jsm/controls/OrbitControls'; let camera: THREE.PerspectiveCamera; diff --git a/types/three/test/renderers/renderers-renderTarget-texture2DArray.ts b/types/three/test/renderers/renderers-renderTarget-texture2DArray.ts index 588d591a4..fab1c40ee 100644 --- a/types/three/test/renderers/renderers-renderTarget-texture2DArray.ts +++ b/types/three/test/renderers/renderers-renderTarget-texture2DArray.ts @@ -1,7 +1,7 @@ import * as THREE from 'three'; import { unzipSync } from 'three/examples/jsm/libs/fflate.module.min'; -import { WEBGL } from 'three/examples/jsm/WebGL'; +import WEBGL from 'three/examples/jsm/capabilities/WebGL'; const vertextPostProcessingShader = /* glsl */ ` out vec2 vUv;