Skip to content
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
0255e15
Addons: initial pass for tree-shaking
CodyJasonBennett Oct 7, 2023
9fe9f6b
Update MaterialXLoader.js
CodyJasonBennett Oct 7, 2023
d593378
Nits
CodyJasonBennett Oct 7, 2023
71e5eb9
CurveModifier, XR
CodyJasonBennett Oct 7, 2023
98a0bd3
Undo export changes to offscreen
CodyJasonBennett Oct 7, 2023
b903a8f
Addons: remove static keyword from members/methods
CodyJasonBennett Oct 7, 2023
4387cde
Addons: cleanup shader chunks, math constants
CodyJasonBennett Oct 7, 2023
9c3e285
ImprovedNoise: don't premultiply kernel
CodyJasonBennett Oct 7, 2023
c8bbc34
fflate: tree-shake as IIFE
CodyJasonBennett Oct 7, 2023
e5b4694
EXRExporter: mark textEncoder as pure
CodyJasonBennett Oct 7, 2023
3a7b8ab
lottie_canvas: tree-shake as IIFE
CodyJasonBennett Oct 7, 2023
ae2e810
opentype: tree-shake as IIFE
CodyJasonBennett Oct 7, 2023
3547f8c
utif: tree-shake as IIFE
CodyJasonBennett Oct 7, 2023
cf1bb22
upng: create and tree-shake lib
CodyJasonBennett Oct 7, 2023
c67d55a
chevrotain: tree-shake as IIFE
CodyJasonBennett Oct 7, 2023
521a9f8
VRMLLoader: use factory method for tree-shaking
CodyJasonBennett Oct 7, 2023
ff8f72d
VRMLLoader: return parser instance in factory
CodyJasonBennett Oct 7, 2023
4b565ae
Keep loader libs inlined
CodyJasonBennett Oct 7, 2023
501ac63
CSMShader: don't self-reference with include
CodyJasonBennett Oct 7, 2023
f1e8ab6
CSMShader: cleanup
CodyJasonBennett Oct 7, 2023
9446f88
utif: hoist namespace
CodyJasonBennett Oct 7, 2023
d5ce35c
OrbitControls: destructure MathUtils for tree-shaking
CodyJasonBennett Oct 7, 2023
4654d8e
offscreen: revert changes
CodyJasonBennett Oct 7, 2023
b4f33bc
mmdparser: tree-shake with IIFE
CodyJasonBennett Oct 7, 2023
2cae69b
Addons: keep static methods
CodyJasonBennett Oct 7, 2023
07ae8d1
MaterialXLoader: revert changes
CodyJasonBennett Oct 7, 2023
f4383e0
XRButton: cleanup
CodyJasonBennett Oct 7, 2023
82db00e
XRButton: fix conflicts
CodyJasonBennett Oct 7, 2023
321ba48
fflate: cleanup
CodyJasonBennett Oct 8, 2023
50d3b3f
Addons: minimize whitespace diff in libs
CodyJasonBennett Oct 8, 2023
6df1cd4
Cleanup
CodyJasonBennett Oct 8, 2023
d9322d6
Cleanup static fields
CodyJasonBennett Oct 8, 2023
e1c95bf
VRMLLoader: cleanup
CodyJasonBennett Oct 8, 2023
6dab494
IFFParser: cleanup
CodyJasonBennett Oct 8, 2023
94602e1
IFFParser: cleanup
CodyJasonBennett Oct 8, 2023
7f7633c
Merge branch 'dev' into addons/tree-shake
CodyJasonBennett Oct 9, 2023
6d46eb4
Addons: use IIFE for static fields
CodyJasonBennett Oct 9, 2023
e4fa50b
Addons: flatten whitespace in IIFEs
CodyJasonBennett Oct 10, 2023
7e3bc69
Addons: cleanup
CodyJasonBennett Oct 10, 2023
4af3121
Merge branch 'dev' into addons/tree-shake
CodyJasonBennett Oct 10, 2023
b9d5666
VRMLLoader: refactor parser back to class from factory
CodyJasonBennett Oct 10, 2023
ab42802
Addons: cleanup
CodyJasonBennett Oct 10, 2023
962b57c
Addons: destructure use of built-in shaders and uniforms
CodyJasonBennett Oct 10, 2023
5b56afd
utif: cleanup
CodyJasonBennett Oct 10, 2023
187ceb0
Addons: cleanup random git formatting
CodyJasonBennett Oct 10, 2023
e0e172a
lottie: typo
CodyJasonBennett Oct 11, 2023
17e52d1
OBB: typo
CodyJasonBennett Oct 11, 2023
f5882ff
Merge branch 'dev' into addons/tree-shake
CodyJasonBennett Oct 11, 2023
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
26 changes: 13 additions & 13 deletions examples/jsm/animation/AnimationClipCreator.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import {
VectorKeyframeTrack
} from 'three';

class AnimationClipCreator {
const AnimationClipCreator = {

static CreateRotationAnimation( period, axis = 'x' ) {
CreateRotationAnimation( period, axis = 'x' ) {

const times = [ 0, period ], values = [ 0, 360 ];

Expand All @@ -19,9 +19,9 @@ class AnimationClipCreator {

return new AnimationClip( null, period, [ track ] );

}
},

static CreateScaleAxisAnimation( period, axis = 'x' ) {
CreateScaleAxisAnimation( period, axis = 'x' ) {

const times = [ 0, period ], values = [ 0, 1 ];

Expand All @@ -31,9 +31,9 @@ class AnimationClipCreator {

return new AnimationClip( null, period, [ track ] );

}
},

static CreateShakeAnimation( duration, shakeScale ) {
CreateShakeAnimation( duration, shakeScale ) {

const times = [], values = [], tmp = new Vector3();

Expand All @@ -53,9 +53,9 @@ class AnimationClipCreator {

return new AnimationClip( null, duration, [ track ] );

}
},

static CreatePulsationAnimation( duration, pulseScale ) {
CreatePulsationAnimation( duration, pulseScale ) {

const times = [], values = [], tmp = new Vector3();

Expand All @@ -75,9 +75,9 @@ class AnimationClipCreator {

return new AnimationClip( null, duration, [ track ] );

}
},

static CreateVisibilityAnimation( duration ) {
CreateVisibilityAnimation( duration ) {

const times = [ 0, duration / 2, duration ], values = [ true, false, true ];

Expand All @@ -87,9 +87,9 @@ class AnimationClipCreator {

return new AnimationClip( null, duration, [ track ] );

}
},

static CreateMaterialColorAnimation( duration, colors ) {
CreateMaterialColorAnimation( duration, colors ) {

const times = [], values = [],
timeStep = duration / colors.length;
Expand All @@ -111,6 +111,6 @@ class AnimationClipCreator {

}

}
};

export { AnimationClipCreator };
22 changes: 11 additions & 11 deletions examples/jsm/animation/CCDIKSolver.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ import {
Vector3
} from 'three';

const _q = new Quaternion();
const _targetPos = new Vector3();
const _targetVec = new Vector3();
const _effectorPos = new Vector3();
const _effectorVec = new Vector3();
const _linkPos = new Vector3();
const _invLinkQ = new Quaternion();
const _linkScale = new Vector3();
const _axis = new Vector3();
const _vector = new Vector3();
const _matrix = new Matrix4();
const _q = /* @__PURE__ */ new Quaternion();
const _targetPos = /* @__PURE__ */ new Vector3();
const _targetVec = /* @__PURE__ */ new Vector3();
const _effectorPos = /* @__PURE__ */ new Vector3();
const _effectorVec = /* @__PURE__ */ new Vector3();
const _linkPos = /* @__PURE__ */ new Vector3();
const _invLinkQ = /* @__PURE__ */ new Quaternion();
const _linkScale = /* @__PURE__ */ new Vector3();
const _axis = /* @__PURE__ */ new Vector3();
const _vector = /* @__PURE__ */ new Vector3();
const _matrix = /* @__PURE__ */ new Matrix4();


/**
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/animation/MMDAnimationHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,7 @@ class AudioManager {

}

const _q = new Quaternion();
const _q = /* @__PURE__ */ new Quaternion();

/**
* Solver for Grant (Fuyo in Japanese. I just google translated because
Expand Down
8 changes: 4 additions & 4 deletions examples/jsm/animation/MMDPhysics.js
Original file line number Diff line number Diff line change
Expand Up @@ -1230,10 +1230,10 @@ class Constraint {

//

const _position = new Vector3();
const _quaternion = new Quaternion();
const _scale = new Vector3();
const _matrixWorldInv = new Matrix4();
const _position = /* @__PURE__ */ new Vector3();
const _quaternion = /* @__PURE__ */ new Quaternion();
const _scale = /* @__PURE__ */ new Vector3();
const _matrixWorldInv = /* @__PURE__ */ new Matrix4();

class MMDPhysicsHelper extends Object3D {

Expand Down
26 changes: 13 additions & 13 deletions examples/jsm/capabilities/WebGL.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
class WebGL {
const WebGL = {

static isWebGLAvailable() {
isWebGLAvailable() {

try {

Expand All @@ -13,9 +13,9 @@ class WebGL {

}

}
},

static isWebGL2Available() {
isWebGL2Available() {

try {

Expand All @@ -28,9 +28,9 @@ class WebGL {

}

}
},

static isColorSpaceAvailable( colorSpace ) {
isColorSpaceAvailable( colorSpace ) {

try {

Expand All @@ -45,21 +45,21 @@ class WebGL {

}

}
},

static getWebGLErrorMessage() {
getWebGLErrorMessage() {

return this.getErrorMessage( 1 );

}
},

static getWebGL2ErrorMessage() {
getWebGL2ErrorMessage() {

return this.getErrorMessage( 2 );

}
},

static getErrorMessage( version ) {
getErrorMessage( version ) {

const names = {
1: 'WebGL',
Expand Down Expand Up @@ -103,6 +103,6 @@ class WebGL {

}

}
};

export default WebGL;
10 changes: 5 additions & 5 deletions examples/jsm/capabilities/WebGPU.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ if ( navigator.gpu !== undefined ) {

}

class WebGPU {
const WebGPU = {

static isAvailable() {
isAvailable() {

return isAvailable;

}
},

static getErrorMessage() {
getErrorMessage() {

const message = 'Your browser does not support <a href="https://gpuweb.github.io/gpuweb/" style="color:blue">WebGPU</a> yet';

Expand All @@ -48,6 +48,6 @@ class WebGPU {

}

}
};

export default WebGPU;
14 changes: 7 additions & 7 deletions examples/jsm/controls/ArcballControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ const _center = {
//transformation matrices for gizmos and camera
const _transformation = {

camera: new Matrix4(),
gizmos: new Matrix4()
camera: /* @__PURE__ */ new Matrix4(),
gizmos: /* @__PURE__ */ new Matrix4()

};

Expand All @@ -64,12 +64,12 @@ const _changeEvent = { type: 'change' };
const _startEvent = { type: 'start' };
const _endEvent = { type: 'end' };

const _raycaster = new Raycaster();
const _offset = new Vector3();
const _raycaster = /* @__PURE__ */ new Raycaster();
const _offset = /* @__PURE__ */ new Vector3();

const _gizmoMatrixStateTemp = new Matrix4();
const _cameraMatrixStateTemp = new Matrix4();
const _scalePointTemp = new Vector3();
const _gizmoMatrixStateTemp = /* @__PURE__ */ new Matrix4();
const _cameraMatrixStateTemp = /* @__PURE__ */ new Matrix4();
const _scalePointTemp = /* @__PURE__ */ new Vector3();
/**
*
* @param {Camera} camera Virtual camera used in the scene
Expand Down
16 changes: 8 additions & 8 deletions examples/jsm/controls/DragControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ import {
Vector3
} from 'three';

const _plane = new Plane();
const _raycaster = new Raycaster();

const _pointer = new Vector2();
const _offset = new Vector3();
const _intersection = new Vector3();
const _worldPosition = new Vector3();
const _inverseMatrix = new Matrix4();
const _plane = /* @__PURE__ */ new Plane();
const _raycaster = /* @__PURE__ */ new Raycaster();

const _pointer = /* @__PURE__ */ new Vector2();
const _offset = /* @__PURE__ */ new Vector3();
const _intersection = /* @__PURE__ */ new Vector3();
const _worldPosition = /* @__PURE__ */ new Vector3();
const _inverseMatrix = /* @__PURE__ */ new Matrix4();

class DragControls extends EventDispatcher {

Expand Down
6 changes: 3 additions & 3 deletions examples/jsm/controls/FirstPersonControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import {
Vector3
} from 'three';

const _lookDirection = new Vector3();
const _spherical = new Spherical();
const _target = new Vector3();
const _lookDirection = /* @__PURE__ */ new Vector3();
const _spherical = /* @__PURE__ */ new Spherical();
const _target = /* @__PURE__ */ new Vector3();

class FirstPersonControls {

Expand Down
7 changes: 3 additions & 4 deletions examples/jsm/controls/OrbitControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
Vector3,
Plane,
Ray,
MathUtils
} from 'three';

// OrbitControls performs orbiting, dollying (zooming), and panning.
Expand All @@ -21,9 +20,9 @@ import {
const _changeEvent = { type: 'change' };
const _startEvent = { type: 'start' };
const _endEvent = { type: 'end' };
const _ray = new Ray();
const _plane = new Plane();
const TILT_LIMIT = Math.cos( 70 * MathUtils.DEG2RAD );
const _ray = /* @__PURE__ */ new Ray();
const _plane = /* @__PURE__ */ new Plane();
const TILT_LIMIT = Math.cos( 70 * ( Math.PI / 180 ) );

class OrbitControls extends EventDispatcher {

Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/controls/PointerLockControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {
Vector3
} from 'three';

const _euler = new Euler( 0, 0, 0, 'YXZ' );
const _vector = new Vector3();
const _euler = /* @__PURE__ */ new Euler( 0, 0, 0, 'YXZ' );
const _vector = /* @__PURE__ */ new Vector3();

const _changeEvent = { type: 'change' };
const _lockEvent = { type: 'lock' };
Expand Down
46 changes: 23 additions & 23 deletions examples/jsm/controls/TransformControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ import {
Vector3
} from 'three';

const _raycaster = new Raycaster();
const _raycaster = /* @__PURE__ */ new Raycaster();

const _tempVector = new Vector3();
const _tempVector2 = new Vector3();
const _tempQuaternion = new Quaternion();
const _tempVector = /* @__PURE__ */ new Vector3();
const _tempVector2 = /* @__PURE__ */ new Vector3();
const _tempQuaternion = /* @__PURE__ */ new Quaternion();
const _unit = {
X: new Vector3( 1, 0, 0 ),
Y: new Vector3( 0, 1, 0 ),
Z: new Vector3( 0, 0, 1 )
X: /* @__PURE__ */ new Vector3( 1, 0, 0 ),
Y: /* @__PURE__ */ new Vector3( 0, 1, 0 ),
Z: /* @__PURE__ */ new Vector3( 0, 0, 1 )
};

const _changeEvent = { type: 'change' };
Expand Down Expand Up @@ -745,22 +745,22 @@ function intersectObjectWithRay( object, raycaster, includeInvisible ) {

// Reusable utility variables

const _tempEuler = new Euler();
const _alignVector = new Vector3( 0, 1, 0 );
const _zeroVector = new Vector3( 0, 0, 0 );
const _lookAtMatrix = new Matrix4();
const _tempQuaternion2 = new Quaternion();
const _identityQuaternion = new Quaternion();
const _dirVector = new Vector3();
const _tempMatrix = new Matrix4();

const _unitX = new Vector3( 1, 0, 0 );
const _unitY = new Vector3( 0, 1, 0 );
const _unitZ = new Vector3( 0, 0, 1 );

const _v1 = new Vector3();
const _v2 = new Vector3();
const _v3 = new Vector3();
const _tempEuler = /* @__PURE__ */ new Euler();
const _alignVector = /* @__PURE__ */ new Vector3( 0, 1, 0 );
const _zeroVector = /* @__PURE__ */ new Vector3( 0, 0, 0 );
const _lookAtMatrix = /* @__PURE__ */ new Matrix4();
const _tempQuaternion2 = /* @__PURE__ */ new Quaternion();
const _identityQuaternion = /* @__PURE__ */ new Quaternion();
const _dirVector = /* @__PURE__ */ new Vector3();
const _tempMatrix = /* @__PURE__ */ new Matrix4();

const _unitX = /* @__PURE__ */ new Vector3( 1, 0, 0 );
const _unitY = /* @__PURE__ */ new Vector3( 0, 1, 0 );
const _unitZ = /* @__PURE__ */ new Vector3( 0, 0, 1 );

const _v1 = /* @__PURE__ */ new Vector3();
const _v2 = /* @__PURE__ */ new Vector3();
const _v3 = /* @__PURE__ */ new Vector3();

class TransformControlsGizmo extends Object3D {

Expand Down
Loading