Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SceneUtils: Moved to examples #13026

Merged
merged 2 commits into from
Jan 3, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ <h3>[method:null detach]( [page:Object3D child], [page:Object3D parent], [page:O

<h2>Source</h2>

[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]
</body>
</html>
5 changes: 4 additions & 1 deletion docs/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ var list = {

"Extras": {
"Earcut": "api/extras/Earcut",
"SceneUtils": "api/extras/SceneUtils",
"ShapeUtils": "api/extras/ShapeUtils"
},

Expand Down Expand Up @@ -381,6 +380,10 @@ var list = {

"Renderers": {
"CanvasRenderer": "examples/renderers/CanvasRenderer"
},

"Utils": {
"SceneUtils": "examples/utils/SceneUtils"
}

},
Expand Down
18 changes: 0 additions & 18 deletions editor/js/libs/tern-threejs/threejs.js
Original file line number Diff line number Diff line change
Expand Up @@ -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.<br>\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": {
Expand Down
15 changes: 4 additions & 11 deletions src/extras/SceneUtils.js → examples/js/utils/SceneUtils.js
Original file line number Diff line number Diff line change
@@ -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 ] ) );

}

Expand All @@ -32,14 +28,11 @@ 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 );

}

};


export { SceneUtils };
24 changes: 24 additions & 0 deletions src/Three.Legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );

}

};
1 change: 0 additions & 1 deletion src/Three.js
Original file line number Diff line number Diff line change
Expand Up @@ -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';
1 change: 0 additions & 1 deletion test/three.source.unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
33 changes: 0 additions & 33 deletions test/unit/src/extras/SceneUtils.tests.js

This file was deleted.