three-zoo 0.5.4 → 0.5.6

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.
@@ -1,64 +1,40 @@
1
1
  import type { MeshStandardMaterial } from "three";
2
2
  import { MeshLambertMaterial } from "three";
3
3
  /**
4
- * Configuration options for the StandardToLambertConverter
5
- *
6
- * @interface StandardToLambertConverterOptions
4
+ * Configuration options for material conversion.
7
5
  */
8
6
  export interface StandardToLambertConverterOptions {
9
7
  /**
10
- * Whether to preserve the original material's name
8
+ * Preserve original material name.
11
9
  * @defaultValue true
12
10
  */
13
11
  preserveName: boolean;
14
12
  /**
15
- * Whether to copy user data from the original material
13
+ * Copy user data from original material.
16
14
  * @defaultValue true
17
15
  */
18
16
  copyUserData: boolean;
19
17
  /**
20
- * Whether to dispose the original material after conversion
18
+ * Dispose original material after conversion.
21
19
  * @defaultValue false
22
20
  */
23
21
  disposeOriginal: boolean;
24
22
  /**
25
- * Custom color adjustment factor for roughness compensation
23
+ * Color adjustment factor for roughness compensation.
26
24
  * @defaultValue 0.8
27
25
  */
28
26
  roughnessColorFactor: number;
29
27
  }
30
28
  /**
31
- * Converts Three.js MeshStandardMaterial to MeshLambertMaterial
32
- *
33
- * This converter handles the translation between PBR (Physically Based Rendering)
34
- * properties of StandardMaterial and the simpler Lambertian reflectance model
35
- * used by LambertMaterial. The conversion preserves visual similarity by applying
36
- * color compensation based on metalness and roughness values.
29
+ * Converts MeshStandardMaterial to MeshLambertMaterial with PBR compensation.
37
30
  */
38
31
  export declare class StandardToLambertConverter {
39
32
  /**
40
- * Converts a MeshStandardMaterial to MeshLambertMaterial
33
+ * Converts MeshStandardMaterial to MeshLambertMaterial.
41
34
  *
42
- * This method performs a comprehensive conversion from PBR StandardMaterial to
43
- * the simpler Lambert lighting model while attempting to preserve visual similarity
44
- * through intelligent color compensation.
45
- *
46
- * @param material - The source MeshStandardMaterial to convert
47
- * @param options - Configuration options for the conversion
48
- * @returns A new MeshLambertMaterial with properties mapped from the standard material
49
- *
50
- * @example
51
- * ```typescript
52
- * const standardMaterial = new MeshStandardMaterial({
53
- * color: 0xff0000,
54
- * metalness: 0.8,
55
- * roughness: 0.2
56
- * });
57
- *
58
- * const lambertMaterial = StandardToLambertConverter.convert(standardMaterial);
59
- * ```
60
- *
61
- * @see {@link StandardToLambertConverterOptions} for available configuration options
35
+ * @param material - Source material to convert
36
+ * @param options - Conversion options
37
+ * @returns New MeshLambertMaterial with mapped properties
62
38
  */
63
39
  static convert(material: MeshStandardMaterial, options?: Partial<StandardToLambertConverterOptions>): MeshLambertMaterial;
64
40
  }
package/dist/Sun.d.ts CHANGED
@@ -1,11 +1,7 @@
1
1
  import type { Texture } from "three";
2
2
  import { Box3, DirectionalLight } from "three";
3
3
  /**
4
- * A directional light with spherical positioning controls and advanced shadow mapping.
5
- *
6
- * Extends Three.js DirectionalLight to provide intuitive spherical coordinate control
7
- * (distance, elevation, azimuth) and automatic shadow map configuration for bounding boxes.
8
- * Also supports automatic sun direction calculation from HDR environment maps.
4
+ * Directional light with spherical positioning and HDR environment support.
9
5
  */
10
6
  export declare class Sun extends DirectionalLight {
11
7
  /** Internal vectors to avoid garbage collection during calculations */
@@ -20,60 +16,40 @@ export declare class Sun extends DirectionalLight {
20
16
  private readonly tempBox3;
21
17
  private readonly tempSpherical;
22
18
  /**
23
- * Gets the distance from the light to its target (origin).
24
- *
25
- * @returns The distance in world units
19
+ * @returns Distance from light position to origin
26
20
  */
27
21
  get distance(): number;
28
22
  /**
29
- * Gets the elevation angle (vertical angle from the horizontal plane).
30
- *
31
- * @returns The elevation angle in radians (0 = horizontal, π/2 = directly above)
23
+ * @returns Elevation angle in radians (phi angle)
32
24
  */
33
25
  get elevation(): number;
34
26
  /**
35
- * Gets the azimuth angle (horizontal rotation around the target).
36
- *
37
- * @returns The azimuth angle in radians (0 = positive X axis, π/2 = positive Z axis)
27
+ * @returns Azimuth angle in radians (theta angle)
38
28
  */
39
29
  get azimuth(): number;
40
30
  /**
41
- * Sets the distance while preserving current elevation and azimuth angles.
42
- *
43
- * @param value - The new distance in world units
31
+ * @param value - New distance in world units
44
32
  */
45
33
  set distance(value: number);
46
34
  /**
47
- * Sets the elevation angle while preserving current distance and azimuth.
48
- *
49
- * @param value - The new elevation angle in radians (0 = horizontal, π/2 = directly above)
35
+ * @param value - New elevation angle in radians (phi angle)
50
36
  */
51
37
  set elevation(value: number);
52
38
  /**
53
- * Sets the azimuth angle while preserving current distance and elevation.
54
- *
55
- * @param value - The new azimuth angle in radians (0 = positive X axis, π/2 = positive Z axis)
39
+ * @param value - New azimuth angle in radians (theta angle)
56
40
  */
57
41
  set azimuth(value: number);
58
42
  /**
59
- * Configures the shadow camera to optimally cover a bounding box.
43
+ * Configures shadow camera frustum to cover bounding box.
60
44
  *
61
- * This method automatically adjusts the directional light's shadow camera frustum
62
- * to perfectly encompass the provided bounding box, ensuring efficient shadow map
63
- * usage and eliminating shadow clipping issues.
64
- *
65
- * @param box3 - The 3D bounding box to cover with shadows
45
+ * @param box3 - 3D bounding box to cover with shadows
66
46
  */
67
47
  configureShadowsForBoundingBox(box3: Box3): void;
68
48
  /**
69
- * Sets the sun's direction based on the brightest point in an HDR environment map.
70
- *
71
- * This method analyzes an HDR texture to find the pixel with the highest luminance
72
- * value and positions the sun to shine from that direction. This is useful for
73
- * creating realistic lighting that matches HDR environment maps.
49
+ * Sets sun direction based on brightest point in HDR environment map.
74
50
  *
75
- * @param texture - The HDR texture to analyze (must have image data available)
76
- * @param distance - The distance to place the sun from the origin (defaults to 1)
51
+ * @param texture - HDR texture to analyze (must have image data)
52
+ * @param distance - Distance to place sun from origin
77
53
  */
78
54
  setDirectionFromHDRTexture(texture: Texture, distance?: number): void;
79
55
  }