From 968c7befb271f5e2c14bb57f0bf38c98337f120d Mon Sep 17 00:00:00 2001 From: Patrick Schroen Date: Mon, 11 Jul 2022 23:31:56 -0400 Subject: [PATCH] Pure annotations house cleaning: Webpack --- src/animation/AnimationMixer.js | 2 +- src/extras/DataUtils.js | 24 ++++++++---------------- src/geometries/CylinderGeometry.js | 1 + src/geometries/EdgesGeometry.js | 1 + src/geometries/PlaneGeometry.js | 1 + src/geometries/ShapeGeometry.js | 1 + src/geometries/SphereGeometry.js | 1 + src/geometries/TorusGeometry.js | 1 + src/geometries/TorusKnotGeometry.js | 1 + src/geometries/TubeGeometry.js | 1 + src/geometries/WireframeGeometry.js | 1 + src/helpers/DirectionalLightHelper.js | 1 + src/helpers/HemisphereLightHelper.js | 1 + src/helpers/SpotLightHelper.js | 1 + src/loaders/LoadingManager.js | 2 +- 15 files changed, 22 insertions(+), 18 deletions(-) diff --git a/src/animation/AnimationMixer.js b/src/animation/AnimationMixer.js index bfa3cbea897977..e7e0f3ea55c369 100644 --- a/src/animation/AnimationMixer.js +++ b/src/animation/AnimationMixer.js @@ -7,7 +7,7 @@ import { AnimationClip } from './AnimationClip.js'; import { NormalAnimationBlendMode } from '../constants.js'; -const _controlInterpolantsResultBuffer = /*@__PURE__*/ new Float32Array( 1 ); +const _controlInterpolantsResultBuffer = new Float32Array( 1 ); class AnimationMixer extends EventDispatcher { diff --git a/src/extras/DataUtils.js b/src/extras/DataUtils.js index 542f9cecdbb709..ec3910b5231a1b 100644 --- a/src/extras/DataUtils.js +++ b/src/extras/DataUtils.js @@ -2,15 +2,7 @@ import { clamp } from '../math/MathUtils.js'; // Fast Half Float Conversions, http://www.fox-toolkit.org/ftp/fasthalffloatconversion.pdf -const { - floatView: _floatView, - uint32View: _uint32View, - baseTable: _baseTable, - shiftTable: _shiftTable, - mantissaTable: _mantissaTable, - exponentTable: _exponentTable, - offsetTable: _offsetTable -} = /*@__PURE__*/ _generateTables(); +const _tables = /*@__PURE__*/ _generateTables(); function _generateTables() { @@ -142,7 +134,7 @@ function _generateTables() { shiftTable: shiftTable, mantissaTable: mantissaTable, exponentTable: exponentTable, - offsetTable: offsetTable, + offsetTable: offsetTable }; } @@ -155,10 +147,10 @@ function toHalfFloat( val ) { val = clamp( val, - 65504, 65504 ); - _floatView[ 0 ] = val; - const f = _uint32View[ 0 ]; + _tables.floatView[ 0 ] = val; + const f = _tables.uint32View[ 0 ]; const e = ( f >> 23 ) & 0x1ff; - return _baseTable[ e ] + ( ( f & 0x007fffff ) >> _shiftTable[ e ] ); + return _tables.baseTable[ e ] + ( ( f & 0x007fffff ) >> _tables.shiftTable[ e ] ); } @@ -167,12 +159,12 @@ function toHalfFloat( val ) { function fromHalfFloat( val ) { const m = val >> 10; - _uint32View[ 0 ] = _mantissaTable[ _offsetTable[ m ] + ( val & 0x3ff ) ] + _exponentTable[ m ]; - return _floatView[ 0 ]; + _tables.uint32View[ 0 ] = _tables.mantissaTable[ _tables.offsetTable[ m ] + ( val & 0x3ff ) ] + _tables.exponentTable[ m ]; + return _tables.floatView[ 0 ]; } export { toHalfFloat, - fromHalfFloat, + fromHalfFloat }; diff --git a/src/geometries/CylinderGeometry.js b/src/geometries/CylinderGeometry.js index 6e4fc01562dbdc..c865131bbb10a3 100644 --- a/src/geometries/CylinderGeometry.js +++ b/src/geometries/CylinderGeometry.js @@ -8,6 +8,7 @@ class CylinderGeometry extends BufferGeometry { constructor( radiusTop = 1, radiusBottom = 1, height = 1, radialSegments = 8, heightSegments = 1, openEnded = false, thetaStart = 0, thetaLength = Math.PI * 2 ) { super(); + this.type = 'CylinderGeometry'; this.parameters = { diff --git a/src/geometries/EdgesGeometry.js b/src/geometries/EdgesGeometry.js index f40eb300028608..73af2d96973eac 100644 --- a/src/geometries/EdgesGeometry.js +++ b/src/geometries/EdgesGeometry.js @@ -14,6 +14,7 @@ class EdgesGeometry extends BufferGeometry { constructor( geometry = null, thresholdAngle = 1 ) { super(); + this.type = 'EdgesGeometry'; this.parameters = { diff --git a/src/geometries/PlaneGeometry.js b/src/geometries/PlaneGeometry.js index 658d904e5f7e3a..bad96d0a3cbe56 100644 --- a/src/geometries/PlaneGeometry.js +++ b/src/geometries/PlaneGeometry.js @@ -6,6 +6,7 @@ class PlaneGeometry extends BufferGeometry { constructor( width = 1, height = 1, widthSegments = 1, heightSegments = 1 ) { super(); + this.type = 'PlaneGeometry'; this.parameters = { diff --git a/src/geometries/ShapeGeometry.js b/src/geometries/ShapeGeometry.js index fd884c7ddeed15..d204b0c55f64c2 100644 --- a/src/geometries/ShapeGeometry.js +++ b/src/geometries/ShapeGeometry.js @@ -9,6 +9,7 @@ class ShapeGeometry extends BufferGeometry { constructor( shapes = new Shape( [ new Vector2( 0, 0.5 ), new Vector2( - 0.5, - 0.5 ), new Vector2( 0.5, - 0.5 ) ] ), curveSegments = 12 ) { super(); + this.type = 'ShapeGeometry'; this.parameters = { diff --git a/src/geometries/SphereGeometry.js b/src/geometries/SphereGeometry.js index 13d166f8e3edbf..0d5a33dff4df66 100644 --- a/src/geometries/SphereGeometry.js +++ b/src/geometries/SphereGeometry.js @@ -7,6 +7,7 @@ class SphereGeometry extends BufferGeometry { constructor( radius = 1, widthSegments = 32, heightSegments = 16, phiStart = 0, phiLength = Math.PI * 2, thetaStart = 0, thetaLength = Math.PI ) { super(); + this.type = 'SphereGeometry'; this.parameters = { diff --git a/src/geometries/TorusGeometry.js b/src/geometries/TorusGeometry.js index f7e0aa14af5dc3..63696384b368de 100644 --- a/src/geometries/TorusGeometry.js +++ b/src/geometries/TorusGeometry.js @@ -7,6 +7,7 @@ class TorusGeometry extends BufferGeometry { constructor( radius = 1, tube = 0.4, radialSegments = 8, tubularSegments = 6, arc = Math.PI * 2 ) { super(); + this.type = 'TorusGeometry'; this.parameters = { diff --git a/src/geometries/TorusKnotGeometry.js b/src/geometries/TorusKnotGeometry.js index 3704e79341d4e1..8a3324ee0c4ed5 100644 --- a/src/geometries/TorusKnotGeometry.js +++ b/src/geometries/TorusKnotGeometry.js @@ -7,6 +7,7 @@ class TorusKnotGeometry extends BufferGeometry { constructor( radius = 1, tube = 0.4, tubularSegments = 64, radialSegments = 8, p = 2, q = 3 ) { super(); + this.type = 'TorusKnotGeometry'; this.parameters = { diff --git a/src/geometries/TubeGeometry.js b/src/geometries/TubeGeometry.js index 25e026120c29d4..273a069fb0d914 100644 --- a/src/geometries/TubeGeometry.js +++ b/src/geometries/TubeGeometry.js @@ -9,6 +9,7 @@ class TubeGeometry extends BufferGeometry { constructor( path = new Curves[ 'QuadraticBezierCurve3' ]( new Vector3( - 1, - 1, 0 ), new Vector3( - 1, 1, 0 ), new Vector3( 1, 1, 0 ) ), tubularSegments = 64, radius = 1, radialSegments = 8, closed = false ) { super(); + this.type = 'TubeGeometry'; this.parameters = { diff --git a/src/geometries/WireframeGeometry.js b/src/geometries/WireframeGeometry.js index 28d69be711f7ad..743787609c7b23 100644 --- a/src/geometries/WireframeGeometry.js +++ b/src/geometries/WireframeGeometry.js @@ -7,6 +7,7 @@ class WireframeGeometry extends BufferGeometry { constructor( geometry = null ) { super(); + this.type = 'WireframeGeometry'; this.parameters = { diff --git a/src/helpers/DirectionalLightHelper.js b/src/helpers/DirectionalLightHelper.js index 143dd77b142971..9818f4aa51c511 100644 --- a/src/helpers/DirectionalLightHelper.js +++ b/src/helpers/DirectionalLightHelper.js @@ -14,6 +14,7 @@ class DirectionalLightHelper extends Object3D { constructor( light, size, color ) { super(); + this.light = light; this.light.updateMatrixWorld(); diff --git a/src/helpers/HemisphereLightHelper.js b/src/helpers/HemisphereLightHelper.js index 10166bc80ef0c7..609c9e75c43731 100644 --- a/src/helpers/HemisphereLightHelper.js +++ b/src/helpers/HemisphereLightHelper.js @@ -15,6 +15,7 @@ class HemisphereLightHelper extends Object3D { constructor( light, size, color ) { super(); + this.light = light; this.light.updateMatrixWorld(); diff --git a/src/helpers/SpotLightHelper.js b/src/helpers/SpotLightHelper.js index 1618dda1d7489a..a364801c4baf03 100644 --- a/src/helpers/SpotLightHelper.js +++ b/src/helpers/SpotLightHelper.js @@ -12,6 +12,7 @@ class SpotLightHelper extends Object3D { constructor( light, color ) { super(); + this.light = light; this.light.updateMatrixWorld(); diff --git a/src/loaders/LoadingManager.js b/src/loaders/LoadingManager.js index f3643c5a8a5986..4d53e5768a22b1 100644 --- a/src/loaders/LoadingManager.js +++ b/src/loaders/LoadingManager.js @@ -137,6 +137,6 @@ class LoadingManager { } -const DefaultLoadingManager = new LoadingManager(); +const DefaultLoadingManager = /*@__PURE__*/ new LoadingManager(); export { DefaultLoadingManager, LoadingManager };