提交 7a86f938 编写于 作者: M Mugen87

SceneUtils: Moved to examples

上级 fb225b3e
......@@ -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>
......@@ -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",
}
},
......
......@@ -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": {
......
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 };
......@@ -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' );
}
};
......@@ -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';
......@@ -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
......
/**
* @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" );
} );
} );
} );
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册