Skip to content
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
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ test/treeshake/index.webgpu.nodes.bundle.min.js
test/e2e/chromium
test/e2e/output-screenshots

**/node_modules
**/docs_new
**/node_modules
6 changes: 6 additions & 0 deletions src/extras/Earcut.js
Original file line number Diff line number Diff line change
@@ -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 {

/**
Expand Down
8 changes: 7 additions & 1 deletion src/extras/core/Interpolations.js
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
24 changes: 22 additions & 2 deletions src/renderers/shaders/UniformsUtils.js
Original file line number Diff line number Diff line change
@@ -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 = {};
Expand Down Expand Up @@ -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 = {};
Expand Down
42 changes: 42 additions & 0 deletions utils/docs/template/static/scripts/page.js
Original file line number Diff line number Diff line change
@@ -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' );
Expand Down