diff --git a/.gitignore b/.gitignore index 0058fb81c02d2f..31f1276e1de031 100644 --- a/.gitignore +++ b/.gitignore @@ -17,5 +17,4 @@ test/treeshake/index.webgpu.nodes.bundle.min.js test/e2e/chromium test/e2e/output-screenshots -**/node_modules -**/docs_new \ No newline at end of file +**/node_modules \ No newline at end of file diff --git a/src/extras/Earcut.js b/src/extras/Earcut.js index 9c2a5678d8160e..977db4c1c079c6 100644 --- a/src/extras/Earcut.js +++ b/src/extras/Earcut.js @@ -1,5 +1,11 @@ import earcut from './lib/earcut.js'; +/** + * An implementation of the earcut polygon triangulation algorithm. + * The code is a port of [mapbox/earcut](https://github.com/mapbox/earcut). + * + * @see https://github.com/mapbox/earcut + */ class Earcut { /** diff --git a/src/extras/core/Interpolations.js b/src/extras/core/Interpolations.js index cfc97d0edcfc45..0d01836e40c519 100644 --- a/src/extras/core/Interpolations.js +++ b/src/extras/core/Interpolations.js @@ -1,4 +1,10 @@ -// Bezier Curves formulas obtained from: https://en.wikipedia.org/wiki/B%C3%A9zier_curve +/** + * Interpolations contains spline and Bézier functions internally used by concrete curve classes. + * + * Bezier Curves formulas obtained from: https://en.wikipedia.org/wiki/B%C3%A9zier_curve + * + * @module Interpolations + */ /** * Computes a point on a Catmull-Rom spline. diff --git a/src/renderers/shaders/UniformsUtils.js b/src/renderers/shaders/UniformsUtils.js index c0b77fbc3b9c4b..fe68b523726603 100644 --- a/src/renderers/shaders/UniformsUtils.js +++ b/src/renderers/shaders/UniformsUtils.js @@ -1,8 +1,20 @@ import { ColorManagement } from '../../math/ColorManagement.js'; import { warn } from '../../utils.js'; -// Uniform Utilities - +/** + * Provides utility functions for managing uniforms. + * + * @module UniformsUtils + */ + +/** + * Clones the given uniform definitions by performing a deep-copy. That means + * if the value of a uniform refers to an object like a Vector3 or Texture, + * the cloned uniform will refer to a new object reference. + * + * @param {Object} src - An object representing uniform definitions. + * @return {Object} The cloned uniforms. + */ export function cloneUniforms( src ) { const dst = {}; @@ -49,6 +61,14 @@ export function cloneUniforms( src ) { } +/** + * Merges the given uniform definitions into a single object. Since the + * method internally uses cloneUniforms(), it performs a deep-copy when + * producing the merged uniform definitions. + * + * @param {Array} uniforms - An array of objects containing uniform definitions. + * @return {Object} The merged uniforms. + */ export function mergeUniforms( uniforms ) { const merged = {}; diff --git a/utils/docs/template/static/scripts/page.js b/utils/docs/template/static/scripts/page.js index a20dda83402bc9..4820be4a6fd501 100644 --- a/utils/docs/template/static/scripts/page.js +++ b/utils/docs/template/static/scripts/page.js @@ -1,3 +1,45 @@ +( function handleLegacyURLs() { + + const hash = window.location.hash; + + if ( hash.startsWith( '#api/' ) || hash.startsWith( '#examples/' ) ) { + + const mappings = { + + '3DMLoader': 'Rhino3dmLoader', + + 'BufferGeometryUtils': 'module-BufferGeometryUtils', + 'CameraUtils': 'module-CameraUtils', + 'SceneUtils': 'module-SceneUtils', + 'SkeletonUtils': 'module-SkeletonUtils', + 'UniformsUtils': 'module-UniformsUtils', + + 'DefaultLoadingManager': 'LoadingManager', + 'Interpolations': 'module-Interpolations', + + 'Animation': 'global', + 'BufferAttributeUsage': 'global', + 'Core': 'global', + 'CustomBlendingEquations': 'global', + 'Materials': 'global', + 'Textures': 'global' + }; + + const parts = hash.split( '/' ); + let className = parts[ parts.length - 1 ]; + + if ( className ) { + + if ( className in mappings ) className = mappings[ className ]; + + window.location.href = `${className}.html`; + + } + + } + +} )(); + const panel = document.getElementById( 'panel' ); const panelScrim = document.getElementById( 'panelScrim' ); const expandButton = document.getElementById( 'expandButton' );