SceneUtils.js 766 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. /**
  2. * @author alteredq / http://alteredqualia.com/
  3. */
  4. import {
  5. Group,
  6. Mesh
  7. } from "../../../build/three.module.js";
  8. var SceneUtils = {
  9. createMultiMaterialObject: function ( geometry, materials ) {
  10. var group = new Group();
  11. for ( var i = 0, l = materials.length; i < l; i ++ ) {
  12. group.add( new Mesh( geometry, materials[ i ] ) );
  13. }
  14. return group;
  15. },
  16. detach: function ( child, parent, scene ) {
  17. console.warn( 'THREE.SceneUtils: detach() has been deprecated. Use scene.attach( child ) instead.' );
  18. scene.attach( child );
  19. },
  20. attach: function ( child, scene, parent ) {
  21. console.warn( 'THREE.SceneUtils: attach() has been deprecated. Use parent.attach( child ) instead.' );
  22. parent.attach( child );
  23. }
  24. };
  25. export { SceneUtils };