Skip to content

Commit e2c5762

Browse files
committed
r128
1 parent cc52252 commit e2c5762

File tree

607 files changed

+106753
-150631
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

607 files changed

+106753
-150631
lines changed

build/three.js

Lines changed: 2408 additions & 2079 deletions
Large diffs are not rendered by default.

build/three.min.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

build/three.module.js

Lines changed: 2190 additions & 2223 deletions
Large diffs are not rendered by default.

docs/api/en/helpers/AxesHelper.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ <h2>Properties</h2>
4444
<h2>Methods</h2>
4545
<p>See the base [page:LineSegments] class for common methods.</p>
4646

47+
<h3>[method:AxesHelper dispose]()</h3>
48+
<p>
49+
Disposes of the internally-created [page:Line.material material] and [page:Line.geometry geometry] used by this helper.
50+
</p>
51+
4752
<h2>Source</h2>
4853

4954
<p>

docs/api/en/helpers/CameraHelper.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,10 @@ <h3>[property:Object matrixAutoUpdate]</h3>
6868
<h2>Methods</h2>
6969
<p>See the base [page:LineSegments] class for common methods.</p>
7070

71+
<h3>[method:CameraHelper dispose]()</h3>
72+
<p>
73+
Disposes of the internally-created [page:Line.material material] and [page:Line.geometry geometry] used by this helper.
74+
</p>
7175

7276
<h3>[method:null update]()</h3>
7377
<p>Updates the helper based on the projectionMatrix of the camera.</p>

docs/api/en/lights/DirectionalLight.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ <h2>Methods</h2>
117117

118118
<p>See the base [page:Light Light] class for common methods.</p>
119119

120+
<h3>[method:DirectionalLight dispose]()</h3>
121+
<p>
122+
Override of base class's [page:Light.dispose dispose].
123+
Disposes of this light's [page:DirectionalLightShadow shadow].
124+
</p>
125+
120126
<h3>[method:DirectionalLight copy]( [param:DirectionalLight source] )</h3>
121127
<p>
122128
Copies value of all the properties from the [page:DirectionalLight source] to this

docs/api/en/lights/Light.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@ <h2>Methods</h2>
5252
See the base [page:Object3D Object3D] class for common methods.
5353
</p>
5454

55+
<h3>[method:Light dispose]()</h3>
56+
<p>
57+
Abstract dispose method for lights; implemented by subclasses that have disposable resources.
58+
</p>
5559

5660
<h3>[method:Light copy]( [param:Light source] )</h3>
5761
<p>

docs/api/en/lights/PointLight.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,12 @@ <h2>Methods</h2>
105105
See the base [page:Light Light] class for common methods.
106106
</p>
107107

108+
<h3>[method:PointLight dispose]()</h3>
109+
<p>
110+
Override of base class's [page:Light.dispose dispose].
111+
Disposes of this light's [page:PointLightShadow shadow].
112+
</p>
113+
108114
<h3>[method:PointLight copy]( [param:PointLight source] )</h3>
109115
<p>
110116
Copies value of all the properties from the [page:PointLight source] to this

docs/api/en/lights/SpotLight.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,12 @@ <h2>Methods</h2>
163163

164164
<p>See the base [page:Light Light] class for common methods.</p>
165165

166+
<h3>[method:SpotLight dispose]()</h3>
167+
<p>
168+
Override of base class's [page:Light.dispose dispose].
169+
Disposes of this light's [page:SpotLightShadow shadow].
170+
</p>
171+
166172
<h3>[method:SpotLight copy]( [param:SpotLight source] )</h3>
167173
<p>
168174
Copies value of all the properties from the [page:SpotLight source] to this

docs/api/en/lights/shadows/LightShadow.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,11 @@ <h3>[method:number getViewportCount]()</h3>
122122
Used internally by the renderer to get the number of viewports that need to be rendered for this shadow.
123123
</p>
124124

125+
<h3>[method:LightShadow dispose]()</h3>
126+
<p>
127+
Disposes of this shadow's textures ([page:LightShadow.map map] and [page:LightShadow.mapPass mapPass]).
128+
</p>
129+
125130
<h3>[method:LightShadow copy]( [param:LightShadow source] )</h3>
126131
<p>
127132
Copies value of all the properties from the [page:LightShadow source] to this

docs/api/en/math/Color.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ <h3>[method:Color setStyle]( [param:String style] ) </h3>
310310
Translucent colors such as "rgba(255, 0, 0, 0.5)" and "hsla(0, 100%, 50%, 0.5)" are also accepted,
311311
but the alpha-channel coordinate will be discarded.<br /><br />
312312

313-
Note that for X11 color names, multiple words such as Dark Orange become the string 'darkorange' (all lowercase).
313+
Note that for X11 color names, multiple words such as Dark Orange become the string 'darkorange'.
314314
</p>
315315

316316
<h3>[method:Color setColorName]( [param:String style] ) </h3>

docs/api/en/objects/SkinnedMesh.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,11 @@ <h3>[method:null updateMatrixWorld]( [param:Boolean force] )</h3>
153153
Updates the [page:Matrix4 MatrixWorld].
154154
</p>
155155

156+
<h3>[method:Vector3 boneTransform]( [index:Integer], [target:Vector3] )</h3>
157+
<p>
158+
Calculates the position of the vertex at the given index relative to the current bone transformations.
159+
</p>
160+
156161
<h2>Source</h2>
157162

158163
<p>

docs/api/en/renderers/WebGLRenderer.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,8 +298,8 @@ <h3>[method:null copyFramebufferToTexture]( [param:Vector2 position], [param:Tex
298298
<h3>[method:null copyTextureToTexture]( [param:Vector2 position], [param:Texture srcTexture], [param:Texture dstTexture], [param:Number level] )</h3>
299299
<p>Copies all pixels of a texture to an existing texture starting from the given position. Enables access to [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGLRenderingContext/texSubImage2D WebGLRenderingContext.texSubImage2D].</p>
300300

301-
<h3>[method:null copyTextureToTexture3D]( [param:Box3 sourceBox], [param:Vector2 position], [param:Texture srcTexture], [param:Texture dstTexture], [param:Number level] )</h3>
302-
<p>Copies the pixels of a texture in the bounds '[page:Box3 sourceBox]' in the desination texture starting from the given position. Enables access to [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texSubImage3D WebGL2RenderingContext.texSubImage3D].</p>
301+
<h3>[method:null copyTextureToTexture3D]( [param:Box3 sourceBox], [param:Vector3 position], [param:Texture srcTexture], [param:Texture dstTexture], [param:Number level] )</h3>
302+
<p>Copies the pixels of a texture in the bounds '[page:Box3 sourceBox]' in the destination texture starting from the given position. Enables access to [link:https://developer.mozilla.org/en-US/docs/Web/API/WebGL2RenderingContext/texSubImage3D WebGL2RenderingContext.texSubImage3D].</p>
303303

304304
<h3>[method:null dispose]( )</h3>
305305
<p>Dispose of the current rendering context.</p>

docs/api/zh/math/Color.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ <h3>[method:Color setStyle]( [param:String style] ) </h3>
303303
半透明颜色例如 "rgba(255, 0, 0, 0.5)" and "hsla(0, 100%, 50%, 0.5)" 也能支持,
304304
但是alpha通道的值将会被丢弃。<br /><br />
305305

306-
注意,对于X11颜色名称,多个单词(如暗橙色)变成字符串“darkorange”(全部是小写字母)
306+
注意,对于X11颜色名称,多个单词(如暗橙色)变成字符串“darkorange”。
307307
</p>
308308

309309
<h3>[method:Color setColorName]( [param:String style] ) </h3>

docs/examples/en/controls/TrackballControls.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ <h3>[property:Camera object]</h3>
126126

127127
<h3>[property:Number panSpeed]</h3>
128128
<p>
129-
The zoom speed. Default is *0.3*.
129+
The pan speed. Default is *0.3*.
130130
</p>
131131

132132
<h3>[property:Number rotateSpeed]</h3>

docs/manual/en/introduction/How-to-run-things-locally.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ <h3>Plugins for popular code editors</h3>
5252
<div>
5353
<p>Some code editors have plugins which will spawn a simple server on demand.</p>
5454
<ul>
55+
<li>[link:https://marketplace.visualstudio.com/items?itemName=yandeu.five-server Five Server] for Visual Studio Code.</li>
5556
<li>[link:https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer Live Server] for Visual Studio Code.</li>
5657
<li>[link:https://atom.io/packages/atom-live-server Live Server] for Atom.</li>
5758
</ul>
@@ -64,6 +65,24 @@ <h3>Servez</h3>
6465
</p>
6566
</div>
6667

68+
<h3>Node.js five-server</h3>
69+
<div>
70+
<p>Development server with live reload capability. To install:</p>
71+
<code>
72+
# Remove live-server (if you have it)
73+
npm -g rm live-server
74+
75+
# Install five-server
76+
npm -g i five-server
77+
78+
# Update five-server (from time to time)
79+
npm -g i five-server@latest
80+
</code>
81+
82+
<p>To run (from your local directory):</p>
83+
<code>five-server . -p 8000</code>
84+
</div>
85+
6786
<h3>Node.js http-server</h3>
6887
<div>
6988
<p>Node.js has a simple HTTP server package. To install:</p>

editor/js/Editor.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function Editor() {
4141
transformModeChanged: new Signal(),
4242
snapChanged: new Signal(),
4343
spaceChanged: new Signal(),
44-
rendererChanged: new Signal(),
44+
rendererCreated: new Signal(),
4545
rendererUpdated: new Signal(),
4646

4747
sceneBackgroundChanged: new Signal(),
@@ -414,7 +414,7 @@ Editor.prototype = {
414414

415415
} else if ( object.isSpotLight ) {
416416

417-
helper = new THREE.SpotLightHelper( object, 1 );
417+
helper = new THREE.SpotLightHelper( object );
418418

419419
} else if ( object.isHemisphereLight ) {
420420

editor/js/Loader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { SetSceneCommand } from './commands/SetSceneCommand.js';
77

88
import { LoaderUtils } from './LoaderUtils.js';
99

10-
import { unzipSync, strFromU8 } from '../../examples/jsm/libs/fflate.module.min.js';
10+
import { unzipSync, strFromU8 } from '../../examples/jsm/libs/fflate.module.js';
1111

1212
function Loader( editor ) {
1313

editor/js/Menubar.File.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import * as THREE from '../../build/three.module.js';
22

3-
import { zipSync, strToU8 } from '../../examples/jsm/libs/fflate.module.min.js';
3+
import { zipSync, strToU8 } from '../../examples/jsm/libs/fflate.module.js';
44

55
import { UIPanel, UIRow, UIHorizontalRule } from './libs/ui.js';
66

editor/js/Script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function Script( editor ) {
4848

4949
var renderer;
5050

51-
signals.rendererChanged.add( function ( newRenderer ) {
51+
signals.rendererCreated.add( function ( newRenderer ) {
5252

5353
renderer = newRenderer;
5454

editor/js/Sidebar.Project.Renderer.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ function SidebarProjectRenderer( editor ) {
116116
currentRenderer.toneMapping = parseFloat( toneMappingSelect.getValue() );
117117
currentRenderer.toneMappingExposure = toneMappingExposure.getValue();
118118

119-
signals.rendererChanged.dispatch( currentRenderer );
119+
signals.rendererCreated.dispatch( currentRenderer );
120+
signals.rendererUpdated.dispatch();
120121

121122
}
122123

editor/js/Sidebar.Project.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { SidebarProjectVideo } from './Sidebar.Project.Video.js';
77
function SidebarProject( editor ) {
88

99
var config = editor.config;
10+
var signals = editor.signals;
1011
var strings = editor.strings;
1112

1213
var container = new UISpan();
@@ -69,6 +70,15 @@ function SidebarProject( editor ) {
6970

7071
}
7172

73+
// Signals
74+
75+
signals.editorCleared.add( function () {
76+
77+
title.setValue( '' );
78+
config.setKey( 'project/title', '' );
79+
80+
} );
81+
7282
return container;
7383

7484
}

editor/js/Viewport.VR.js

Lines changed: 10 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as THREE from '../../build/three.module.js';
22

3-
import { HTMLMesh } from './libs/three.html.js';
3+
import { HTMLMesh } from '../../examples/jsm/interactive/HTMLMesh.js';
4+
import { InteractiveGroup } from '../../examples/jsm/interactive/InteractiveGroup.js';
45

56
import { XRControllerModelFactory } from '../../examples/jsm/webxr/XRControllerModelFactory.js';
67

@@ -29,31 +30,29 @@ class VR {
2930

3031
if ( group === null ) {
3132

32-
group = new THREE.Group();
33+
group = new InteractiveGroup( renderer );
3334
editor.sceneHelpers.add( group );
3435

3536
const mesh = new HTMLMesh( sidebar );
3637
mesh.position.set( 1, 1.5, - 0.5 );
3738
mesh.rotation.y = - 0.5;
39+
mesh.scale.setScalar( 2 );
3840
group.add( mesh );
3941

4042
intersectables.push( mesh );
4143

4244
// controllers
4345

44-
const controller1 = renderer.xr.getController( 0 );
45-
controller1.addEventListener( 'select', onSelect );
46-
group.add( controller1 );
47-
48-
const controller2 = renderer.xr.getController( 1 );
49-
controller2.addEventListener( 'selectstart', onSelect );
50-
group.add( controller2 );
51-
5246
const geometry = new THREE.BufferGeometry();
5347
geometry.setFromPoints( [ new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 0, 0, - 5 ) ] );
5448

49+
const controller1 = renderer.xr.getController( 0 );
5550
controller1.add( new THREE.Line( geometry ) );
51+
group.add( controller1 );
52+
53+
const controller2 = renderer.xr.getController( 1 );
5654
controller2.add( new THREE.Line( geometry ) );
55+
group.add( controller2 );
5756

5857
//
5958

@@ -101,41 +100,6 @@ class VR {
101100

102101
};
103102

104-
//
105-
106-
function onSelect( event ) {
107-
108-
const controller = event.target;
109-
110-
const intersections = getIntersections( controller );
111-
112-
if ( intersections.length > 0 ) {
113-
114-
const intersection = intersections[ 0 ];
115-
116-
const object = intersection.object;
117-
const uv = intersection.uv;
118-
119-
object.material.map.click( uv.x, 1 - uv.y );
120-
121-
}
122-
123-
}
124-
125-
const raycaster = new THREE.Raycaster();
126-
const tempMatrix = new THREE.Matrix4();
127-
128-
function getIntersections( controller ) {
129-
130-
tempMatrix.identity().extractRotation( controller.matrixWorld );
131-
132-
raycaster.ray.origin.setFromMatrixPosition( controller.matrixWorld );
133-
raycaster.ray.direction.set( 0, 0, - 1 ).applyMatrix4( tempMatrix );
134-
135-
return raycaster.intersectObjects( intersectables );
136-
137-
}
138-
139103
// signals
140104

141105
signals.toggleVR.add( () => {
@@ -153,7 +117,7 @@ class VR {
153117

154118
} );
155119

156-
signals.rendererChanged.add( ( value ) => {
120+
signals.rendererCreated.add( ( value ) => {
157121

158122
renderer = value;
159123
renderer.xr.enabled = true;

0 commit comments

Comments
 (0)