three-stdlib 2.10.1 → 2.10.2

Sign up to get free protection for your applications and to get access to all the features.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "three-stdlib",
3
- "version": "2.10.1",
3
+ "version": "2.10.2",
4
4
  "private": false,
5
5
  "description": "stand-alone library of threejs examples",
6
6
  "main": "index.cjs.js",
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three"),t={createMeshesFromInstancedMesh:function(t){var a=new e.Group,r=t.count,n=t.geometry,c=t.material;for(let s=0;s<r;s++){var o=new e.Mesh(n,c);t.getMatrixAt(s,o.matrix),o.matrix.decompose(o.position,o.quaternion,o.scale),a.add(o)}return a.copy(t),a.updateMatrixWorld(),a},createMultiMaterialObject:function(t,a){var r=new e.Group;for(let n=0,c=a.length;n<c;n++)r.add(new e.Mesh(t,a[n]));return r},detach:function(e,t,a){console.warn("THREE.SceneUtils: detach() has been deprecated. Use scene.attach( child ) instead."),a.attach(e)},attach:function(e,t,a){console.warn("THREE.SceneUtils: attach() has been deprecated. Use parent.attach( child ) instead."),a.attach(e)}};exports.SceneUtils=t;
1
+ "use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("three");const t={createMeshesFromInstancedMesh:function(t){const a=new e.Group,n=t.count,c=t.geometry,r=t.material;for(let o=0;o<n;o++){const n=new e.Mesh(c,r);t.getMatrixAt(o,n.matrix),n.matrix.decompose(n.position,n.quaternion,n.scale),a.add(n)}return a.copy(t),a.updateMatrixWorld(),a},createMultiMaterialObject:function(t,a){const n=new e.Group;for(let c=0,r=a.length;c<r;c++)n.add(new e.Mesh(t,a[c]));return n},detach:function(e,t,a){console.warn("THREE.SceneUtils: detach() has been deprecated. Use scene.attach( child ) instead."),a.attach(e)},attach:function(e,t,a){console.warn("THREE.SceneUtils: attach() has been deprecated. Use parent.attach( child ) instead."),a.attach(e)}};exports.SceneUtils=t;
@@ -1,12 +1,9 @@
1
- import { BufferGeometry, Group, InstancedMesh, Material, Object3D, Scene } from 'three';
2
-
3
- export function createMeshesFromInstancedMesh(instancedMesh: InstancedMesh): Group;
4
- export function createMultiMaterialObject(geometry: BufferGeometry, materials: Material[]): Group;
5
- /**
6
- * @deprecated Use scene.attach( child ) instead.
7
- */
8
- export function detach(child: Object3D, parent: Object3D, scene: Scene): void;
9
- /**
10
- * @deprecated Use parent.attach( child ) instead.
11
- */
12
- export function attach(child: Object3D, scene: Scene, parent: Object3D): void;
1
+ import { Group } from 'three';
2
+ import type { BufferGeometry, InstancedMesh, Material, Object3D, Scene } from 'three';
3
+ declare const SceneUtils: {
4
+ createMeshesFromInstancedMesh: (instancedMesh: InstancedMesh) => Group;
5
+ createMultiMaterialObject: (geometry: BufferGeometry, materials: Material[]) => Group;
6
+ detach: (child: Object3D, parent: Object3D, scene: Scene) => void;
7
+ attach: (child: Object3D, scene: Scene, parent: Object3D) => void;
8
+ };
9
+ export { SceneUtils };
@@ -1,14 +1,14 @@
1
1
  import { Group, Mesh } from 'three';
2
2
 
3
- var SceneUtils = {
3
+ const SceneUtils = {
4
4
  createMeshesFromInstancedMesh: function (instancedMesh) {
5
- var group = new Group();
6
- var count = instancedMesh.count;
7
- var geometry = instancedMesh.geometry;
8
- var material = instancedMesh.material;
5
+ const group = new Group();
6
+ const count = instancedMesh.count;
7
+ const geometry = instancedMesh.geometry;
8
+ const material = instancedMesh.material;
9
9
 
10
10
  for (let i = 0; i < count; i++) {
11
- var mesh = new Mesh(geometry, material);
11
+ const mesh = new Mesh(geometry, material);
12
12
  instancedMesh.getMatrixAt(i, mesh.matrix);
13
13
  mesh.matrix.decompose(mesh.position, mesh.quaternion, mesh.scale);
14
14
  group.add(mesh);
@@ -20,7 +20,7 @@ var SceneUtils = {
20
20
  return group;
21
21
  },
22
22
  createMultiMaterialObject: function (geometry, materials) {
23
- var group = new Group();
23
+ const group = new Group();
24
24
 
25
25
  for (let i = 0, l = materials.length; i < l; i++) {
26
26
  group.add(new Mesh(geometry, materials[i]));