diff --git a/docs/api/extras/SceneUtils.html b/docs/examples/utils/SceneUtils.html similarity index 94% rename from docs/api/extras/SceneUtils.html rename to docs/examples/utils/SceneUtils.html index 8bd05c465f2260..96739bb9da232e 100644 --- a/docs/api/extras/SceneUtils.html +++ b/docs/examples/utils/SceneUtils.html @@ -48,6 +48,6 @@

[method:null detach]( [page:Object3D child], [page:Object3D parent], [page:O

Source

- [link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js] + [link:https://github.com/mrdoob/three.js/blob/master/examples/js/utils/SceneUtils.js examples/js/utils/SceneUtils.js] diff --git a/docs/list.js b/docs/list.js index 7c1f1ed376e2e6..5657c5bb599dc3 100644 --- a/docs/list.js +++ b/docs/list.js @@ -105,7 +105,6 @@ var list = { "Extras": { "Earcut": "api/extras/Earcut", - "SceneUtils": "api/extras/SceneUtils", "ShapeUtils": "api/extras/ShapeUtils" }, @@ -381,6 +380,10 @@ var list = { "Renderers": { "CanvasRenderer": "examples/renderers/CanvasRenderer" + }, + + "Utils": { + "SceneUtils": "examples/utils/SceneUtils" } }, diff --git a/editor/js/libs/tern-threejs/threejs.js b/editor/js/libs/tern-threejs/threejs.js index 675f2dd5c169fc..044d4411e034cc 100644 --- a/editor/js/libs/tern-threejs/threejs.js +++ b/editor/js/libs/tern-threejs/threejs.js @@ -805,24 +805,6 @@ "prototype": {}, "!doc": "Contains handy functions geometry manipulations." }, - "SceneUtils": { - "!url": "http://threejs.org/docs/#Reference/extras/SceneUtils", - "prototype": { - "createMultiMaterialObject": { - "!type": "fn(geometry: +THREE.Geometry, materials: []) -> +THREE.Object3D", - "!doc": "Creates an new Object3D an new mesh for each material defined in materials. Beware that this is not the same as MultiMaterial which defines multiple material for 1 mesh.
\n\t\tThis is mostly useful for object that need a material and a wireframe implementation." - }, - "attach": { - "!type": "fn(child: +THREE.Object3D, scene: +THREE.Object3D, parent: +THREE.Object3D)", - "!doc": "Attaches the object to the parent without the moving the object in the worldspace." - }, - "detach": { - "!type": "fn(child: +THREE.Object3D, parent: +THREE.Object3D, scene: +THREE.Object3D)", - "!doc": "Detaches the object from the parent and adds it back to the scene without moving in worldspace." - } - }, - "!doc": "A class containing useful utility functions for scene manipulation." - }, "Curve": { "!url": "http://threejs.org/docs/#Reference/extras/core/Curve", "prototype": { diff --git a/src/extras/SceneUtils.js b/examples/js/utils/SceneUtils.js similarity index 57% rename from src/extras/SceneUtils.js rename to examples/js/utils/SceneUtils.js index b2e10d78128674..faaed8a9791c30 100644 --- a/src/extras/SceneUtils.js +++ b/examples/js/utils/SceneUtils.js @@ -1,20 +1,16 @@ -import { Matrix4 } from '../math/Matrix4.js'; -import { Mesh } from '../objects/Mesh.js'; -import { Group } from '../objects/Group.js'; - /** * @author alteredq / http://alteredqualia.com/ */ -var SceneUtils = { +THREE.SceneUtils = { createMultiMaterialObject: function ( geometry, materials ) { - var group = new Group(); + var group = new THREE.Group(); for ( var i = 0, l = materials.length; i < l; i ++ ) { - group.add( new Mesh( geometry, materials[ i ] ) ); + group.add( new THREE.Mesh( geometry, materials[ i ] ) ); } @@ -32,7 +28,7 @@ var SceneUtils = { attach: function ( child, scene, parent ) { - child.applyMatrix( new Matrix4().getInverse( parent.matrixWorld ) ); + child.applyMatrix( new THREE.Matrix4().getInverse( parent.matrixWorld ) ); scene.remove( child ); parent.add( child ); @@ -40,6 +36,3 @@ var SceneUtils = { } }; - - -export { SceneUtils }; diff --git a/src/Three.Legacy.js b/src/Three.Legacy.js index bf3dca7d939a81..c45413e4d33fa8 100644 --- a/src/Three.Legacy.js +++ b/src/Three.Legacy.js @@ -1722,3 +1722,27 @@ export function CanvasRenderer() { this.setSize = function () {}; } + +// + +export var SceneUtils = { + + createMultiMaterialObject: function ( /* geometry, materials */ ) { + + console.error( 'THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js' ); + + }, + + detach: function ( /* child, parent, scene */ ) { + + console.error( 'THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js' ); + + }, + + attach: function ( /* child, scene, parent */ ) { + + console.error( 'THREE.SceneUtils has been moved to /examples/js/utils/SceneUtils.js' ); + + } + +}; diff --git a/src/Three.js b/src/Three.js index 601e7d05b855f6..72b50d27d82b8e 100644 --- a/src/Three.js +++ b/src/Three.js @@ -147,7 +147,6 @@ export { Font } from './extras/core/Font.js'; export { CurvePath } from './extras/core/CurvePath.js'; export { Curve } from './extras/core/Curve.js'; export { ShapeUtils } from './extras/ShapeUtils.js'; -export { SceneUtils } from './extras/SceneUtils.js'; export { WebGLUtils } from './renderers/webgl/WebGLUtils.js'; export * from './constants.js'; export * from './Three.Legacy.js'; diff --git a/test/three.source.unit.js b/test/three.source.unit.js index 2c58a5eaf1d977..ab0fee9ba58407 100644 --- a/test/three.source.unit.js +++ b/test/three.source.unit.js @@ -64,7 +64,6 @@ import './unit/src/core/Uniform.tests'; //src/extras -import './unit/src/extras/SceneUtils.tests'; import './unit/src/extras/ShapeUtils.tests'; //src/extras/core diff --git a/test/unit/src/extras/SceneUtils.tests.js b/test/unit/src/extras/SceneUtils.tests.js deleted file mode 100644 index 64789451415740..00000000000000 --- a/test/unit/src/extras/SceneUtils.tests.js +++ /dev/null @@ -1,33 +0,0 @@ -/** - * @author TristanVALCKE / https://github.com/Itee - */ -/* global QUnit */ - -import { SceneUtils } from '../../../../src/extras/SceneUtils'; - -export default QUnit.module( 'Extras', () => { - - QUnit.module( 'SceneUtils', () => { - - // PUBLIC STUFF - QUnit.todo( "createMultiMaterialObject", ( assert ) => { - - assert.ok( false, "everything's gonna be alright" ); - - } ); - - QUnit.todo( "detach", ( assert ) => { - - assert.ok( false, "everything's gonna be alright" ); - - } ); - - QUnit.todo( "attach", ( assert ) => { - - assert.ok( false, "everything's gonna be alright" ); - - } ); - - } ); - -} );