Skip to content

Commit

Permalink
r128
Browse files Browse the repository at this point in the history
  • Loading branch information
mrdoob committed Apr 23, 2021
1 parent cc52252 commit e2c5762
Show file tree
Hide file tree
Showing 607 changed files with 106,753 additions and 150,631 deletions.
4,487 changes: 2,408 additions & 2,079 deletions build/three.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion build/three.min.js

Large diffs are not rendered by default.

4,413 changes: 2,190 additions & 2,223 deletions build/three.module.js

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions docs/api/en/helpers/AxesHelper.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ <h2>Properties</h2>
<h2>Methods</h2>
<p>See the base [page:LineSegments] class for common methods.</p>

<h3>[method:AxesHelper dispose]()</h3>
<p>
Disposes of the internally-created [page:Line.material material] and [page:Line.geometry geometry] used by this helper.
</p>

<h2>Source</h2>

<p>
Expand Down
4 changes: 4 additions & 0 deletions docs/api/en/helpers/CameraHelper.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ <h3>[property:Object matrixAutoUpdate]</h3>
<h2>Methods</h2>
<p>See the base [page:LineSegments] class for common methods.</p>

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

<h3>[method:null update]()</h3>
<p>Updates the helper based on the projectionMatrix of the camera.</p>
Expand Down
6 changes: 6 additions & 0 deletions docs/api/en/lights/DirectionalLight.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,12 @@ <h2>Methods</h2>

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

<h3>[method:DirectionalLight dispose]()</h3>
<p>
Override of base class's [page:Light.dispose dispose].
Disposes of this light's [page:DirectionalLightShadow shadow].
</p>

<h3>[method:DirectionalLight copy]( [param:DirectionalLight source] )</h3>
<p>
Copies value of all the properties from the [page:DirectionalLight source] to this
Expand Down
4 changes: 4 additions & 0 deletions docs/api/en/lights/Light.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ <h2>Methods</h2>
See the base [page:Object3D Object3D] class for common methods.
</p>

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

<h3>[method:Light copy]( [param:Light source] )</h3>
<p>
Expand Down
6 changes: 6 additions & 0 deletions docs/api/en/lights/PointLight.html
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,12 @@ <h2>Methods</h2>
See the base [page:Light Light] class for common methods.
</p>

<h3>[method:PointLight dispose]()</h3>
<p>
Override of base class's [page:Light.dispose dispose].
Disposes of this light's [page:PointLightShadow shadow].
</p>

<h3>[method:PointLight copy]( [param:PointLight source] )</h3>
<p>
Copies value of all the properties from the [page:PointLight source] to this
Expand Down
6 changes: 6 additions & 0 deletions docs/api/en/lights/SpotLight.html
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,12 @@ <h2>Methods</h2>

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

<h3>[method:SpotLight dispose]()</h3>
<p>
Override of base class's [page:Light.dispose dispose].
Disposes of this light's [page:SpotLightShadow shadow].
</p>

<h3>[method:SpotLight copy]( [param:SpotLight source] )</h3>
<p>
Copies value of all the properties from the [page:SpotLight source] to this
Expand Down
5 changes: 5 additions & 0 deletions docs/api/en/lights/shadows/LightShadow.html
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,11 @@ <h3>[method:number getViewportCount]()</h3>
Used internally by the renderer to get the number of viewports that need to be rendered for this shadow.
</p>

<h3>[method:LightShadow dispose]()</h3>
<p>
Disposes of this shadow's textures ([page:LightShadow.map map] and [page:LightShadow.mapPass mapPass]).
</p>

<h3>[method:LightShadow copy]( [param:LightShadow source] )</h3>
<p>
Copies value of all the properties from the [page:LightShadow source] to this
Expand Down
2 changes: 1 addition & 1 deletion docs/api/en/math/Color.html
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ <h3>[method:Color setStyle]( [param:String style] ) </h3>
Translucent colors such as "rgba(255, 0, 0, 0.5)" and "hsla(0, 100%, 50%, 0.5)" are also accepted,
but the alpha-channel coordinate will be discarded.<br /><br />

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

<h3>[method:Color setColorName]( [param:String style] ) </h3>
Expand Down
5 changes: 5 additions & 0 deletions docs/api/en/objects/SkinnedMesh.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,11 @@ <h3>[method:null updateMatrixWorld]( [param:Boolean force] )</h3>
Updates the [page:Matrix4 MatrixWorld].
</p>

<h3>[method:Vector3 boneTransform]( [index:Integer], [target:Vector3] )</h3>
<p>
Calculates the position of the vertex at the given index relative to the current bone transformations.
</p>

<h2>Source</h2>

<p>
Expand Down
4 changes: 2 additions & 2 deletions docs/api/en/renderers/WebGLRenderer.html
Original file line number Diff line number Diff line change
Expand Up @@ -298,8 +298,8 @@ <h3>[method:null copyFramebufferToTexture]( [param:Vector2 position], [param:Tex
<h3>[method:null copyTextureToTexture]( [param:Vector2 position], [param:Texture srcTexture], [param:Texture dstTexture], [param:Number level] )</h3>
<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>

<h3>[method:null copyTextureToTexture3D]( [param:Box3 sourceBox], [param:Vector2 position], [param:Texture srcTexture], [param:Texture dstTexture], [param:Number level] )</h3>
<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>
<h3>[method:null copyTextureToTexture3D]( [param:Box3 sourceBox], [param:Vector3 position], [param:Texture srcTexture], [param:Texture dstTexture], [param:Number level] )</h3>
<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>

<h3>[method:null dispose]( )</h3>
<p>Dispose of the current rendering context.</p>
Expand Down
2 changes: 1 addition & 1 deletion docs/api/zh/math/Color.html
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ <h3>[method:Color setStyle]( [param:String style] ) </h3>
半透明颜色例如 "rgba(255, 0, 0, 0.5)" and "hsla(0, 100%, 50%, 0.5)" 也能支持,
但是alpha通道的值将会被丢弃。<br /><br />

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

<h3>[method:Color setColorName]( [param:String style] ) </h3>
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/en/controls/TrackballControls.html
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ <h3>[property:Camera object]</h3>

<h3>[property:Number panSpeed]</h3>
<p>
The zoom speed. Default is *0.3*.
The pan speed. Default is *0.3*.
</p>

<h3>[property:Number rotateSpeed]</h3>
Expand Down
19 changes: 19 additions & 0 deletions docs/manual/en/introduction/How-to-run-things-locally.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ <h3>Plugins for popular code editors</h3>
<div>
<p>Some code editors have plugins which will spawn a simple server on demand.</p>
<ul>
<li>[link:https://marketplace.visualstudio.com/items?itemName=yandeu.five-server Five Server] for Visual Studio Code.</li>
<li>[link:https://marketplace.visualstudio.com/items?itemName=ritwickdey.LiveServer Live Server] for Visual Studio Code.</li>
<li>[link:https://atom.io/packages/atom-live-server Live Server] for Atom.</li>
</ul>
Expand All @@ -64,6 +65,24 @@ <h3>Servez</h3>
</p>
</div>

<h3>Node.js five-server</h3>
<div>
<p>Development server with live reload capability. To install:</p>
<code>
# Remove live-server (if you have it)
npm -g rm live-server

# Install five-server
npm -g i five-server

# Update five-server (from time to time)
npm -g i five-server@latest
</code>

<p>To run (from your local directory):</p>
<code>five-server . -p 8000</code>
</div>

<h3>Node.js http-server</h3>
<div>
<p>Node.js has a simple HTTP server package. To install:</p>
Expand Down
4 changes: 2 additions & 2 deletions editor/js/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function Editor() {
transformModeChanged: new Signal(),
snapChanged: new Signal(),
spaceChanged: new Signal(),
rendererChanged: new Signal(),
rendererCreated: new Signal(),
rendererUpdated: new Signal(),

sceneBackgroundChanged: new Signal(),
Expand Down Expand Up @@ -414,7 +414,7 @@ Editor.prototype = {

} else if ( object.isSpotLight ) {

helper = new THREE.SpotLightHelper( object, 1 );
helper = new THREE.SpotLightHelper( object );

} else if ( object.isHemisphereLight ) {

Expand Down
2 changes: 1 addition & 1 deletion editor/js/Loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { SetSceneCommand } from './commands/SetSceneCommand.js';

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

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

function Loader( editor ) {

Expand Down
2 changes: 1 addition & 1 deletion editor/js/Menubar.File.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as THREE from '../../build/three.module.js';

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

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

Expand Down
2 changes: 1 addition & 1 deletion editor/js/Script.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function Script( editor ) {

var renderer;

signals.rendererChanged.add( function ( newRenderer ) {
signals.rendererCreated.add( function ( newRenderer ) {

renderer = newRenderer;

Expand Down
3 changes: 2 additions & 1 deletion editor/js/Sidebar.Project.Renderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,8 @@ function SidebarProjectRenderer( editor ) {
currentRenderer.toneMapping = parseFloat( toneMappingSelect.getValue() );
currentRenderer.toneMappingExposure = toneMappingExposure.getValue();

signals.rendererChanged.dispatch( currentRenderer );
signals.rendererCreated.dispatch( currentRenderer );
signals.rendererUpdated.dispatch();

}

Expand Down
10 changes: 10 additions & 0 deletions editor/js/Sidebar.Project.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { SidebarProjectVideo } from './Sidebar.Project.Video.js';
function SidebarProject( editor ) {

var config = editor.config;
var signals = editor.signals;
var strings = editor.strings;

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

}

// Signals

signals.editorCleared.add( function () {

title.setValue( '' );
config.setKey( 'project/title', '' );

} );

return container;

}
Expand Down
56 changes: 10 additions & 46 deletions editor/js/Viewport.VR.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import * as THREE from '../../build/three.module.js';

import { HTMLMesh } from './libs/three.html.js';
import { HTMLMesh } from '../../examples/jsm/interactive/HTMLMesh.js';
import { InteractiveGroup } from '../../examples/jsm/interactive/InteractiveGroup.js';

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

Expand Down Expand Up @@ -29,31 +30,29 @@ class VR {

if ( group === null ) {

group = new THREE.Group();
group = new InteractiveGroup( renderer );
editor.sceneHelpers.add( group );

const mesh = new HTMLMesh( sidebar );
mesh.position.set( 1, 1.5, - 0.5 );
mesh.rotation.y = - 0.5;
mesh.scale.setScalar( 2 );
group.add( mesh );

intersectables.push( mesh );

// controllers

const controller1 = renderer.xr.getController( 0 );
controller1.addEventListener( 'select', onSelect );
group.add( controller1 );

const controller2 = renderer.xr.getController( 1 );
controller2.addEventListener( 'selectstart', onSelect );
group.add( controller2 );

const geometry = new THREE.BufferGeometry();
geometry.setFromPoints( [ new THREE.Vector3( 0, 0, 0 ), new THREE.Vector3( 0, 0, - 5 ) ] );

const controller1 = renderer.xr.getController( 0 );
controller1.add( new THREE.Line( geometry ) );
group.add( controller1 );

const controller2 = renderer.xr.getController( 1 );
controller2.add( new THREE.Line( geometry ) );
group.add( controller2 );

//

Expand Down Expand Up @@ -101,41 +100,6 @@ class VR {

};

//

function onSelect( event ) {

const controller = event.target;

const intersections = getIntersections( controller );

if ( intersections.length > 0 ) {

const intersection = intersections[ 0 ];

const object = intersection.object;
const uv = intersection.uv;

object.material.map.click( uv.x, 1 - uv.y );

}

}

const raycaster = new THREE.Raycaster();
const tempMatrix = new THREE.Matrix4();

function getIntersections( controller ) {

tempMatrix.identity().extractRotation( controller.matrixWorld );

raycaster.ray.origin.setFromMatrixPosition( controller.matrixWorld );
raycaster.ray.direction.set( 0, 0, - 1 ).applyMatrix4( tempMatrix );

return raycaster.intersectObjects( intersectables );

}

// signals

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

} );

signals.rendererChanged.add( ( value ) => {
signals.rendererCreated.add( ( value ) => {

renderer = value;
renderer.xr.enabled = true;
Expand Down
Loading

0 comments on commit e2c5762

Please sign in to comment.