Forráskód Böngészése

SceneUtils: Moved to examples

Mugen87 7 éve
szülő
commit
7a86f938b3

+ 1 - 1
docs/api/extras/SceneUtils.html → docs/examples/utils/SceneUtils.html

@@ -48,6 +48,6 @@
 
 		<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>

+ 4 - 1
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",
 		}
 
 	},

+ 0 - 18
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.<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": {

+ 4 - 11
src/extras/SceneUtils.js → 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 };

+ 24 - 0
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' );
+
+	}
+
+};

+ 0 - 1
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';

+ 0 - 1
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

+ 0 - 33
test/unit/src/extras/SceneUtils.tests.js

@@ -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" );
-
-		} );
-
-	} );
-
-} );