three-zoo 0.0.6 → 0.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,8 @@
1
+ import { Box3 } from "three";
2
+ export declare class Bounds extends Box3 {
3
+ private readonly tempVector3;
4
+ get width(): number;
5
+ get height(): number;
6
+ get depth(): number;
7
+ get diagonal(): number;
8
+ }
@@ -0,0 +1,10 @@
1
+ import { Material, Object3D } from "three";
2
+ type Constructor<T> = abstract new (...args: never[]) => T;
3
+ export declare class Enumerator {
4
+ static getObjectByName(object: Object3D, name: string): Object3D | null;
5
+ static getMaterialByName(object: Object3D, name: string): Material | null;
6
+ static enumerateObjectsByType<T>(object: Object3D, type: Constructor<T>, callback: (instance: T) => void): void;
7
+ static enumerateMaterials(object: Object3D, callback: (material: Material) => void): void;
8
+ static setShadowRecursive(object: Object3D, castShadow?: boolean, receiveShadow?: boolean): void;
9
+ }
10
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Mesh, Object3D } from "three";
2
+ interface IOptions {
3
+ container: Object3D;
4
+ filter?: (child: Mesh) => boolean;
5
+ disposeOriginal?: boolean;
6
+ }
7
+ export declare class InstanceAssembler {
8
+ static assemble(options: IOptions): void;
9
+ }
10
+ export {};
@@ -0,0 +1,14 @@
1
+ import { Object3D } from "three";
2
+ type IPattern = string | RegExp;
3
+ interface IOptions {
4
+ asset: Object3D;
5
+ castShadowMeshNames?: IPattern[];
6
+ receiveShadowMeshNames?: IPattern[];
7
+ transparentMaterialNames?: IPattern[];
8
+ noDepthWriteMaterialNames?: IPattern[];
9
+ }
10
+ export declare class SceneProcessor {
11
+ static process(options: IOptions): Object3D[];
12
+ private static matchesAny;
13
+ }
14
+ export {};
package/dist/Sun.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ import { Box3, DirectionalLight, Texture } from "three";
2
+ export declare class Sun extends DirectionalLight {
3
+ private tempVector3D0;
4
+ private tempVector3D1;
5
+ private tempVector3D2;
6
+ private tempVector3D3;
7
+ private tempVector3D4;
8
+ private tempVector3D5;
9
+ private tempVector3D6;
10
+ private tempVector3D7;
11
+ private tempBox3;
12
+ private tempSpherical;
13
+ get distance(): number;
14
+ get elevation(): number;
15
+ get azimuth(): number;
16
+ set distance(value: number);
17
+ set elevation(value: number);
18
+ set azimuth(value: number);
19
+ setShadowMapFromBox3(box3: Box3): void;
20
+ setDirectionFromHDR(texture: Texture, distance?: number): void;
21
+ }
@@ -0,0 +1,5 @@
1
+ export * from "./Bounds";
2
+ export * from "./Enumerator";
3
+ export * from "./InstanceAssembler";
4
+ export * from "./SceneProcessor";
5
+ export * from "./Sun";
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "three-zoo",
3
- "version": "0.0.6",
3
+ "version": "0.0.7",
4
4
  "description": "zoo of tiny three js tools",
5
5
  "scripts": {
6
- "build": "rollup -c"
6
+ "clean": "rm -rf dist",
7
+ "build": "npm run clean && rollup -c"
7
8
  },
8
9
  "main": "dist/index.js",
9
10
  "types": "dist/index.d.ts",