three-zoo 0.5.4 → 0.5.5

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 +1 @@
1
- {"version":3,"file":"index.min.js","sources":["../src/DualFovCamera.ts","../src/SceneTraversal.ts","../src/SkinnedMeshBaker.ts","../src/StandardToBasicConverter.ts","../src/StandardToLambertConverter.ts","../src/Sun.ts"],"sourcesContent":["import type { Box3, BufferAttribute, SkinnedMesh } from \"three\";\nimport { MathUtils, PerspectiveCamera, Vector3 } from \"three\";\n\n/** Default horizontal field of view in degrees */\nconst DEFAULT_HORIZONTAL_FOV = 90;\n/** Default vertical field of view in degrees */\nconst DEFAULT_VERTICAL_FOV = 90;\n/** Default aspect ratio (width/height) */\nconst DEFAULT_ASPECT = 1;\n/** Default near clipping plane distance */\nconst DEFAULT_NEAR = 1;\n/** Default far clipping plane distance */\nconst DEFAULT_FAR = 1000;\n\n/** Minimum allowed field of view in degrees */\nconst MIN_FOV = 1;\n/** Maximum allowed field of view in degrees */\nconst MAX_FOV = 179;\n\n/**\n * A camera that supports independent horizontal and vertical FOV settings.\n * Extends Three.js PerspectiveCamera to allow separate control over horizontal\n * and vertical fields of view.\n */\nexport class DualFovCamera extends PerspectiveCamera {\n /** Internal storage for horizontal field of view in degrees */\n private horizontalFovInternal: number;\n /** Internal storage for vertical field of view in degrees */\n private verticalFovInternal: number;\n\n /**\n * Creates a new DualFovCamera instance with independent horizontal and vertical FOV control.\n *\n * @param horizontalFov - Horizontal field of view in degrees. Must be between 1° and 179°. Defaults to 90°.\n * @param verticalFov - Vertical field of view in degrees. Must be between 1° and 179°. Defaults to 90°.\n * @param aspect - Camera aspect ratio (width/height). Defaults to 1.\n * @param near - Near clipping plane distance. Must be greater than 0. Defaults to 1.\n * @param far - Far clipping plane distance. Must be greater than near plane. Defaults to 1000.\n */\n constructor(\n horizontalFov = DEFAULT_HORIZONTAL_FOV,\n verticalFov = DEFAULT_VERTICAL_FOV,\n aspect = DEFAULT_ASPECT,\n near = DEFAULT_NEAR,\n far = DEFAULT_FAR,\n ) {\n super(verticalFov, aspect, near, far);\n this.horizontalFovInternal = horizontalFov;\n this.verticalFovInternal = verticalFov;\n this.updateProjectionMatrix();\n }\n\n /**\n * Gets the current horizontal field of view in degrees.\n *\n * @returns The horizontal FOV value between 1° and 179°\n */\n public get horizontalFov(): number {\n return this.horizontalFovInternal;\n }\n\n /**\n * Gets the current vertical field of view in degrees.\n *\n * @returns The vertical FOV value between 1° and 179°\n */\n public get verticalFov(): number {\n return this.verticalFovInternal;\n }\n\n /**\n * Sets the horizontal field of view in degrees.\n *\n * @param value - The horizontal FOV value in degrees. Will be clamped between 1° and 179°.\n */\n public set horizontalFov(value: number) {\n this.horizontalFovInternal = MathUtils.clamp(value, MIN_FOV, MAX_FOV);\n this.updateProjectionMatrix();\n }\n\n /**\n * Sets the vertical field of view in degrees.\n *\n * @param value - The vertical FOV value in degrees. Will be clamped between 1° and 179°.\n */\n public set verticalFov(value: number) {\n this.verticalFovInternal = MathUtils.clamp(value, MIN_FOV, MAX_FOV);\n this.updateProjectionMatrix();\n }\n\n /**\n * Updates both horizontal and vertical field of view values simultaneously.\n *\n * @param horizontal - Horizontal FOV in degrees. Will be clamped between 1° and 179°.\n * @param vertical - Vertical FOV in degrees. Will be clamped between 1° and 179°.\n */\n public setFov(horizontal: number, vertical: number): void {\n this.horizontalFovInternal = MathUtils.clamp(horizontal, MIN_FOV, MAX_FOV);\n this.verticalFovInternal = MathUtils.clamp(vertical, MIN_FOV, MAX_FOV);\n this.updateProjectionMatrix();\n }\n\n /**\n * Copies the field of view settings from another DualFovCamera instance.\n *\n * @param source - The DualFovCamera instance to copy FOV settings from.\n */\n public copyFovSettings(source: DualFovCamera): void {\n this.horizontalFovInternal = source.horizontalFov;\n this.verticalFovInternal = source.verticalFov;\n this.updateProjectionMatrix();\n }\n\n /**\n * Updates the projection matrix based on current FOV settings and aspect ratio.\n *\n * The behavior differs based on orientation:\n * - **Landscape mode (aspect > 1)**: Preserves horizontal FOV, calculates vertical FOV\n * - **Portrait mode (aspect ≤ 1)**: Preserves vertical FOV, calculates horizontal FOV\n *\n * This method is automatically called when FOV values or aspect ratio changes.\n *\n * @override\n */\n public override updateProjectionMatrix(): void {\n if (this.aspect > 1) {\n // Landscape orientation: preserve horizontal FOV\n const radians = MathUtils.degToRad(this.horizontalFovInternal);\n this.fov = MathUtils.radToDeg(\n Math.atan(Math.tan(radians / 2) / this.aspect) * 2,\n );\n } else {\n // Portrait orientation: preserve vertical FOV\n this.fov = this.verticalFovInternal;\n }\n\n super.updateProjectionMatrix();\n }\n\n /**\n * Gets the actual horizontal field of view after aspect ratio adjustments.\n *\n * In landscape mode, this returns the set horizontal FOV.\n * In portrait mode, this calculates the actual horizontal FOV based on the vertical FOV and aspect ratio.\n *\n * @returns The actual horizontal FOV in degrees\n */\n public getActualHorizontalFov(): number {\n if (this.aspect >= 1) {\n return this.horizontalFovInternal;\n }\n const verticalRadians = MathUtils.degToRad(this.verticalFovInternal);\n return MathUtils.radToDeg(\n Math.atan(Math.tan(verticalRadians / 2) * this.aspect) * 2,\n );\n }\n\n /**\n * Gets the actual vertical field of view after aspect ratio adjustments.\n *\n * In portrait mode, this returns the set vertical FOV.\n * In landscape mode, this calculates the actual vertical FOV based on the horizontal FOV and aspect ratio.\n *\n * @returns The actual vertical FOV in degrees\n */\n public getActualVerticalFov(): number {\n if (this.aspect < 1) {\n return this.verticalFovInternal;\n }\n const horizontalRadians = MathUtils.degToRad(this.horizontalFovInternal);\n return MathUtils.radToDeg(\n Math.atan(Math.tan(horizontalRadians / 2) / this.aspect) * 2,\n );\n }\n\n /**\n * Adjusts the vertical field of view to fit all specified points within the camera's view.\n *\n * This method calculates the required vertical FOV to ensure all provided vertices\n * are visible within the vertical bounds of the camera's frustum.\n *\n * @param vertices - Array of 3D points (in world coordinates) that should fit within the camera's vertical view\n */\n public fitVerticalFovToPoints(vertices: Vector3[]): void {\n const up = new Vector3(0, 1, 0).applyQuaternion(this.quaternion);\n\n let maxVerticalAngle = 0;\n\n for (const vertex of vertices) {\n const vertexToCam = this.position.clone().sub(vertex);\n const vertexDirection = vertexToCam.normalize();\n\n const verticalAngle =\n Math.asin(Math.abs(vertexDirection.dot(up))) *\n Math.sign(vertexDirection.dot(up));\n\n if (Math.abs(verticalAngle) > maxVerticalAngle) {\n maxVerticalAngle = Math.abs(verticalAngle);\n }\n }\n\n const requiredFov = MathUtils.radToDeg(2 * maxVerticalAngle);\n\n this.verticalFovInternal = MathUtils.clamp(requiredFov, MIN_FOV, MAX_FOV);\n this.updateProjectionMatrix();\n }\n\n /**\n * Adjusts the vertical field of view to fit a bounding box within the camera's view.\n *\n * This method calculates the required vertical FOV to ensure the entire bounding box\n * is visible within the vertical bounds of the camera's frustum.\n *\n * @param box - The 3D bounding box (in world coordinates) that should fit within the camera's vertical view\n */\n public fitVerticalFovToBox(box: Box3): void {\n this.fitVerticalFovToPoints([\n new Vector3(box.min.x, box.min.y, box.min.z),\n new Vector3(box.min.x, box.min.y, box.max.z),\n new Vector3(box.min.x, box.max.y, box.min.z),\n new Vector3(box.min.x, box.max.y, box.max.z),\n new Vector3(box.max.x, box.min.y, box.min.z),\n new Vector3(box.max.x, box.min.y, box.max.z),\n new Vector3(box.max.x, box.max.y, box.min.z),\n new Vector3(box.max.x, box.max.y, box.max.z),\n ]);\n }\n\n /**\n * Adjusts the vertical field of view to fit a skinned mesh within the camera's view.\n *\n * This method updates the mesh's skeleton, applies bone transformations to all vertices,\n * and then calculates the required vertical FOV to ensure the entire deformed mesh\n * is visible within the vertical bounds of the camera's frustum.\n *\n * @param skinnedMesh - The skinned mesh (with active skeleton) that should fit within the camera's vertical view\n */\n public fitVerticalFovToMesh(skinnedMesh: SkinnedMesh): void {\n skinnedMesh.updateWorldMatrix(true, true);\n skinnedMesh.skeleton.update();\n\n const bakedGeometry = skinnedMesh.geometry;\n const position = bakedGeometry.attributes[\"position\"] as BufferAttribute;\n const target = new Vector3();\n\n const points = [];\n\n for (let i = 0; i < position.count; i++) {\n target.fromBufferAttribute(position, i);\n skinnedMesh.applyBoneTransform(i, target);\n points.push(target.clone());\n }\n\n this.fitVerticalFovToPoints(points);\n }\n\n /**\n * Points the camera to look at the center of mass of a skinned mesh.\n *\n * This method updates the mesh's skeleton, applies bone transformations to all vertices,\n * calculates the center of mass using a clustering algorithm, and then orients the camera\n * to look at that point.\n *\n * The center of mass calculation uses an iterative clustering approach to find the\n * main concentration of vertices, which provides better results than a simple average\n * for complex meshes.\n *\n * @param skinnedMesh - The skinned mesh (with active skeleton) whose center of mass should be the camera's target\n */\n public lookAtMeshCenterOfMass(skinnedMesh: SkinnedMesh): void {\n skinnedMesh.updateWorldMatrix(true, true);\n skinnedMesh.skeleton.update();\n\n const bakedGeometry = skinnedMesh.geometry;\n const position = bakedGeometry.attributes.position as BufferAttribute;\n const target = new Vector3();\n const points: Vector3[] = [];\n\n for (let i = 0; i < position.count; i++) {\n target.fromBufferAttribute(position, i);\n skinnedMesh.applyBoneTransform(i, target);\n points.push(target.clone());\n }\n\n /**\n * Finds the main cluster center of a set of 3D points using iterative refinement.\n *\n * @param points - Array of 3D points to cluster\n * @param iterations - Number of refinement iterations to perform\n * @returns The calculated center point of the main cluster\n */\n const findMainCluster = (points: Vector3[], iterations = 3): Vector3 => {\n if (points.length === 0) {\n return new Vector3();\n }\n\n let center = points[Math.floor(points.length / 2)].clone();\n\n for (let i = 0; i < iterations; i++) {\n let total = new Vector3();\n let count = 0;\n\n for (const point of points) {\n if (\n point.distanceTo(center) < point.distanceTo(total) ||\n count === 0\n ) {\n total.add(point);\n count++;\n }\n }\n\n if (count > 0) {\n center = total.divideScalar(count);\n }\n }\n\n return center;\n };\n\n const centerOfMass = findMainCluster(points);\n this.lookAt(centerOfMass);\n }\n\n /**\n * Creates a deep copy of this DualFovCamera instance.\n *\n * The cloned camera will have identical FOV settings, position, rotation,\n * and all other camera properties.\n *\n * @returns A new DualFovCamera instance that is an exact copy of this one\n * @override\n */\n public override clone(): this {\n const camera = new DualFovCamera(\n this.horizontalFovInternal,\n this.verticalFovInternal,\n this.aspect,\n this.near,\n this.far,\n ) as this;\n\n camera.copy(this, true);\n return camera;\n }\n}\n","import type { Material, Object3D } from \"three\";\nimport { Mesh } from \"three\";\n\n/**\n * Constructor type for type-safe scene traversal operations.\n *\n * This type represents any constructor function that can be used to create instances of type T.\n * It's used for runtime type checking when filtering objects by their constructor type.\n *\n * @template T - The type that the constructor creates\n */\nexport type Constructor<T> = abstract new (...args: never[]) => T;\n\n/**\n * Utility class for finding and modifying objects in a Three.js scene graph.\n *\n * This class provides static methods for traversing Three.js scene hierarchies,\n * searching for specific objects or materials, and performing batch operations\n * on collections of scene objects.\n *\n * All methods perform depth-first traversal of the scene graph starting from\n * the provided root object and recursively processing all children.\n */\nexport class SceneTraversal {\n /**\n * Finds the first object in the scene hierarchy with an exact name match.\n *\n * Performs a depth-first search through the scene graph starting from the provided\n * root object. Returns the first object encountered whose name property exactly\n * matches the search string.\n *\n * @param object - The root Object3D to start searching from\n * @param name - The exact name to search for (case-sensitive)\n * @returns The first matching Object3D, or null if no match is found\n\n */\n public static getObjectByName(\n object: Object3D,\n name: string,\n ): Object3D | null {\n if (object.name === name) {\n return object;\n }\n\n for (const child of object.children) {\n const result = SceneTraversal.getObjectByName(child, name);\n if (result) {\n return result;\n }\n }\n\n return null;\n }\n\n /**\n * Finds the first material in the scene hierarchy with an exact name match.\n *\n * Performs a depth-first search through the scene graph, examining materials\n * attached to Mesh objects. Handles both single materials and material arrays.\n * Returns the first material encountered whose name property exactly matches\n * the search string.\n *\n * @param object - The root Object3D to start searching from\n * @param name - The exact material name to search for (case-sensitive)\n * @returns The first matching Material, or null if no match is found\n\n */\n public static getMaterialByName(\n object: Object3D,\n name: string,\n ): Material | null {\n if (object instanceof Mesh) {\n if (Array.isArray(object.material)) {\n for (const material of object.material) {\n if (material.name === name) {\n return material;\n }\n }\n } else if (object.material.name === name) {\n return object.material;\n }\n }\n\n for (const child of object.children) {\n const material = SceneTraversal.getMaterialByName(child, name);\n if (material) {\n return material;\n }\n }\n\n return null;\n }\n\n /**\n * Processes all objects of a specific type in the scene hierarchy.\n *\n * Performs a depth-first traversal and executes the provided callback function\n * for every object that is an instance of the specified type. This is useful\n * for batch operations on specific object types (e.g., all lights, all meshes, etc.).\n *\n * @template T - The type of objects to process\n * @param object - The root Object3D to start searching from\n * @param type - The constructor/class to filter by (e.g., DirectionalLight, Mesh)\n * @param callback - Function to execute for each matching object instance\n\n */\n public static enumerateObjectsByType<T>(\n object: Object3D,\n type: Constructor<T>,\n callback: (instance: T) => void,\n ): void {\n if (object instanceof type) {\n callback(object);\n }\n\n for (const child of object.children) {\n SceneTraversal.enumerateObjectsByType(child, type, callback);\n }\n }\n\n /**\n * Processes all materials found in mesh objects within the scene hierarchy.\n *\n * Performs a depth-first traversal, finding all Mesh objects and executing\n * the provided callback function for each material. Handles both single\n * materials and material arrays properly.\n *\n * @param object - The root Object3D to start searching from\n * @param callback - Function to execute for each material found\n\n */\n public static enumerateMaterials(\n object: Object3D,\n callback: (material: Material) => void,\n ): void {\n if (object instanceof Mesh) {\n if (Array.isArray(object.material)) {\n for (const material of object.material) {\n callback(material);\n }\n } else {\n callback(object.material);\n }\n }\n\n for (const child of object.children) {\n SceneTraversal.enumerateMaterials(child, callback);\n }\n }\n\n /**\n * Finds all objects in the scene hierarchy that match the specified filter criteria.\n *\n * Performs a depth-first search and collects all objects that either match\n * a regular expression pattern (applied to the object's name) or satisfy\n * a custom predicate function.\n *\n * @param object - The root Object3D to start searching from\n * @param filter - Either a RegExp to test against object names, or a predicate function\n * @returns Array of all matching Object3D instances\n\n */\n public static filterObjects(\n object: Object3D,\n filter: RegExp | ((object: Object3D) => boolean),\n ): Object3D[] {\n let result: Object3D[] = [];\n\n if (typeof filter === \"function\") {\n if (filter(object)) {\n result.push(object);\n }\n } else {\n if (object.name && filter.test(object.name)) {\n result.push(object);\n }\n }\n\n for (const child of object.children) {\n result = result.concat(SceneTraversal.filterObjects(child, filter));\n }\n\n return result;\n }\n\n /**\n * Finds all materials in the scene hierarchy whose names match a regular expression pattern.\n *\n * Performs a depth-first search through all Mesh objects and collects materials\n * whose name property matches the provided regular expression. Handles both\n * single materials and material arrays properly.\n *\n * @param object - The root Object3D to start searching from\n * @param name - Regular expression pattern to test against material names\n * @returns Array of all matching Material instances\n\n */\n public static filterMaterials(object: Object3D, name: RegExp): Material[] {\n let result: Material[] = [];\n\n if (object instanceof Mesh) {\n if (Array.isArray(object.material)) {\n for (const material of object.material) {\n if (material.name && name.test(material.name)) {\n result.push(material);\n }\n }\n } else {\n if (object.material.name && name.test(object.material.name)) {\n result.push(object.material);\n }\n }\n }\n\n for (const child of object.children) {\n result = result.concat(SceneTraversal.filterMaterials(child, name));\n }\n\n return result;\n }\n\n /**\n * Finds all objects (mesh users) that use materials with names matching a regular expression pattern.\n *\n * Performs a depth-first search through all Mesh objects and collects the mesh objects\n * whose materials have names that match the provided regular expression. This is useful\n * for finding all objects that use specific material types or naming patterns.\n *\n * @param object - The root Object3D to start searching from\n * @param materialName - Regular expression pattern to test against material names\n * @returns Array of all Mesh objects that use materials with matching names\n */\n public static findMaterialUsers(\n object: Object3D,\n materialName: RegExp,\n ): Mesh[] {\n let result: Mesh[] = [];\n\n if (object instanceof Mesh) {\n let hasMatchingMaterial = false;\n\n if (Array.isArray(object.material)) {\n for (const material of object.material) {\n if (material.name && materialName.test(material.name)) {\n hasMatchingMaterial = true;\n break;\n }\n }\n } else {\n if (object.material.name && materialName.test(object.material.name)) {\n hasMatchingMaterial = true;\n }\n }\n\n if (hasMatchingMaterial) {\n result.push(object);\n }\n }\n\n for (const child of object.children) {\n result = result.concat(\n SceneTraversal.findMaterialUsers(child, materialName),\n );\n }\n\n return result;\n }\n}\n","import type { AnimationClip, Object3D, SkinnedMesh } from \"three\";\nimport { AnimationMixer, BufferAttribute, Mesh, Vector3 } from \"three\";\n\n/** Number of components per vertex */\nconst COMPONENT_COUNT = 3;\n\n/** Convert skinned meshes to regular static meshes */\nexport class SkinnedMeshBaker {\n /**\n * Convert a skinned mesh to a regular mesh in its current pose.\n * The resulting mesh will have no bones but look identical.\n *\n * @param skinnedMesh - Mesh to convert\n * @returns Static mesh with baked vertex positions\n */\n public static bakePose(skinnedMesh: SkinnedMesh): Mesh {\n const bakedGeometry = skinnedMesh.geometry.clone();\n const position = bakedGeometry.attributes[\"position\"] as BufferAttribute;\n const newPositions = new Float32Array(position.count * COMPONENT_COUNT);\n const target = new Vector3();\n\n for (let i = 0; i < position.count; i++) {\n target.fromBufferAttribute(position, i);\n skinnedMesh.applyBoneTransform(i, target);\n newPositions[i * COMPONENT_COUNT + 0] = target.x;\n newPositions[i * COMPONENT_COUNT + 1] = target.y;\n newPositions[i * COMPONENT_COUNT + 2] = target.z;\n }\n\n bakedGeometry.setAttribute(\n \"position\",\n new BufferAttribute(newPositions, COMPONENT_COUNT),\n );\n bakedGeometry.computeVertexNormals();\n bakedGeometry.deleteAttribute(\"skinIndex\");\n bakedGeometry.deleteAttribute(\"skinWeight\");\n\n const mesh = new Mesh(bakedGeometry, skinnedMesh.material);\n mesh.name = skinnedMesh.name;\n return mesh;\n }\n\n /**\n * Bake a single frame from an animation into a static mesh.\n *\n * @param armature - Root object with bones (usually from GLTF)\n * @param skinnedMesh - Mesh to convert\n * @param timeOffset - Time in seconds within the animation\n * @param clip - Animation to get the pose from\n * @returns Static mesh with baked vertex positions\n */\n public static bakeAnimationFrame(\n armature: Object3D,\n skinnedMesh: SkinnedMesh,\n timeOffset: number,\n clip: AnimationClip,\n ): Mesh {\n const mixer = new AnimationMixer(armature);\n const action = mixer.clipAction(clip);\n action.play();\n mixer.setTime(timeOffset);\n\n armature.updateWorldMatrix(true, true);\n skinnedMesh.skeleton.update();\n\n return this.bakePose(skinnedMesh);\n }\n}\n","import type { MeshStandardMaterial } from \"three\";\nimport { MeshBasicMaterial } from \"three\";\n\n/**\n * Configuration options for the StandardToBasicConverter\n *\n * @interface StandardToBasicConverterOptions\n */\nexport interface StandardToBasicConverterOptions {\n /**\n * Whether to preserve the original material's name\n * @defaultValue true\n */\n preserveName: boolean;\n /**\n * Whether to copy user data from the original material\n * @defaultValue true\n */\n copyUserData: boolean;\n /**\n * Whether to dispose the original material after conversion\n * @defaultValue false\n */\n disposeOriginal: boolean;\n /**\n * Whether to apply emissive color to the base color for brightness compensation\n * @defaultValue true\n */\n combineEmissive: boolean;\n /**\n * Factor for brightness adjustment to compensate for loss of lighting\n * @defaultValue 1.3\n */\n brightnessFactor: number;\n}\n\n/**\n * Converts Three.js MeshStandardMaterial to MeshBasicMaterial\n *\n * This converter handles the translation from PBR (Physically Based Rendering)\n * StandardMaterial to the unlit BasicMaterial. Since BasicMaterial doesn't respond\n * to lighting, this converter applies various compensation techniques to maintain\n * visual similarity, including brightness adjustments and emissive color combination.\n */\nexport class StandardToBasicConverter {\n /**\n * Converts a MeshStandardMaterial to MeshBasicMaterial\n *\n * This method performs a comprehensive conversion from PBR StandardMaterial to\n * unlit BasicMaterial while attempting to preserve visual similarity through\n * brightness compensation and intelligent property mapping.\n *\n * @param standardMaterial - The source MeshStandardMaterial to convert\n * @param options - Configuration options for the conversion\n * @returns A new MeshBasicMaterial with properties mapped from the standard material\n *\n * @example\n * ```typescript\n * const standardMaterial = new MeshStandardMaterial({\n * color: 0x00ff00,\n * metalness: 0.5,\n * emissive: 0x111111,\n * emissiveIntensity: 0.2\n * });\n *\n * const basicMaterial = StandardToBasicConverter.convert(standardMaterial, {\n * brightnessFactor: 1.4,\n * combineEmissive: true\n * });\n * ```\n *\n * @see {@link StandardToBasicConverterOptions} for available configuration options\n */\n public static convert(\n standardMaterial: MeshStandardMaterial,\n options: Partial<StandardToBasicConverterOptions> = {},\n ): MeshBasicMaterial {\n const config = {\n preserveName: true,\n copyUserData: true,\n disposeOriginal: false,\n combineEmissive: true,\n brightnessFactor: 1.3,\n ...options,\n };\n\n // Create new Basic material\n const basicMaterial = new MeshBasicMaterial();\n\n // Copy basic material properties\n this.copyBasicProperties(standardMaterial, basicMaterial, config);\n\n // Handle color properties with lighting compensation\n this.convertColorProperties(standardMaterial, basicMaterial, config);\n\n // Handle texture maps\n this.convertTextureMaps(standardMaterial, basicMaterial);\n\n // Handle transparency and alpha\n this.convertTransparencyProperties(standardMaterial, basicMaterial);\n\n // Cleanup if requested\n if (config.disposeOriginal) {\n standardMaterial.dispose();\n }\n\n basicMaterial.needsUpdate = true;\n return basicMaterial;\n }\n\n /**\n * Copies basic material properties from source to target material\n *\n * Transfers common material properties including rendering settings,\n * visibility, fog interaction, wireframe settings, and user data.\n *\n * @param source - The source MeshStandardMaterial\n * @param target - The target MeshBasicMaterial\n * @param config - The resolved configuration options\n * @internal\n */\n private static copyBasicProperties(\n source: MeshStandardMaterial,\n target: MeshBasicMaterial,\n config: Required<StandardToBasicConverterOptions>,\n ): void {\n if (config.preserveName) {\n target.name = source.name;\n }\n\n target.side = source.side;\n target.visible = source.visible;\n target.fog = source.fog;\n target.wireframe = source.wireframe;\n target.wireframeLinewidth = source.wireframeLinewidth;\n target.vertexColors = source.vertexColors;\n\n if (config.copyUserData) {\n target.userData = { ...source.userData };\n }\n }\n\n /**\n * Converts color-related properties with lighting compensation\n *\n * Applies brightness compensation and optional emissive color combination\n * to account for BasicMaterial's lack of lighting response. Metallic materials\n * receive additional brightness adjustment, and colors are clamped to valid ranges.\n *\n * @param source - The source MeshStandardMaterial\n * @param target - The target MeshBasicMaterial\n * @param config - The resolved configuration options\n * @internal\n */\n private static convertColorProperties(\n source: MeshStandardMaterial,\n target: MeshBasicMaterial,\n config: Required<StandardToBasicConverterOptions>,\n ): void {\n // Base color conversion with brightness compensation\n target.color = source.color.clone();\n\n // Apply brightness compensation since BasicMaterial doesn't respond to lighting\n target.color.multiplyScalar(config.brightnessFactor);\n\n // Adjust for metalness - metallic materials tend to be darker without lighting\n if (source.metalness > 0) {\n const metalnessBrightness = 1 + source.metalness * 0.3;\n target.color.multiplyScalar(metalnessBrightness);\n }\n\n // Combine emissive color if requested\n if (config.combineEmissive) {\n const emissiveContribution = source.emissive\n .clone()\n .multiplyScalar(source.emissiveIntensity * 0.5);\n target.color.add(emissiveContribution);\n }\n\n // Ensure color doesn't exceed valid range\n target.color.r = Math.min(target.color.r, 1.0);\n target.color.g = Math.min(target.color.g, 1.0);\n target.color.b = Math.min(target.color.b, 1.0);\n }\n\n /**\n * Converts and maps texture properties from Standard to Basic material\n *\n * Handles the transfer of compatible texture maps including diffuse, alpha,\n * environment, light, and AO maps. The metalness map is repurposed as a\n * specular map for some reflective effect, and environment map reflectivity\n * is set based on the original material's metalness value.\n *\n * @param source - The source MeshStandardMaterial\n * @param target - The target MeshBasicMaterial\n * @internal\n */\n private static convertTextureMaps(\n source: MeshStandardMaterial,\n target: MeshBasicMaterial,\n ): void {\n // Main diffuse/albedo map\n if (source.map) {\n target.map = source.map;\n }\n\n // Alpha map\n if (source.alphaMap) {\n target.alphaMap = source.alphaMap;\n }\n\n // Environment map (BasicMaterial supports this for reflections)\n if (source.envMap) {\n target.envMap = source.envMap;\n // Use metalness to determine reflectivity\n target.reflectivity = source.metalness;\n }\n\n // Light map (BasicMaterial supports this)\n if (source.lightMap) {\n target.lightMap = source.lightMap;\n target.lightMapIntensity = source.lightMapIntensity;\n }\n\n // AO map (BasicMaterial supports this)\n if (source.aoMap) {\n target.aoMap = source.aoMap;\n target.aoMapIntensity = source.aoMapIntensity;\n }\n\n // Specular map (BasicMaterial supports this)\n if (source.metalnessMap) {\n // Use metalness map as specular map for some reflective effect\n target.specularMap = source.metalnessMap;\n }\n\n // Copy UV transforms\n this.copyUVTransforms(source, target);\n }\n\n /**\n * Copies UV transformation properties for texture maps\n *\n * Transfers UV offset, repeat, rotation, and center properties from the\n * source material's main texture map to the target material's map.\n *\n * @param source - The source MeshStandardMaterial\n * @param target - The target MeshBasicMaterial\n * @internal\n */\n private static copyUVTransforms(\n source: MeshStandardMaterial,\n target: MeshBasicMaterial,\n ): void {\n // Main texture UV transform\n if (source.map && target.map) {\n target.map.offset.copy(source.map.offset);\n target.map.repeat.copy(source.map.repeat);\n target.map.rotation = source.map.rotation;\n target.map.center.copy(source.map.center);\n }\n }\n\n /**\n * Converts transparency and rendering properties\n *\n * Transfers transparency, opacity, alpha testing, depth testing,\n * depth writing, and blending mode settings from source to target.\n *\n * @param source - The source MeshStandardMaterial\n * @param target - The target MeshBasicMaterial\n * @internal\n */\n private static convertTransparencyProperties(\n source: MeshStandardMaterial,\n target: MeshBasicMaterial,\n ): void {\n target.transparent = source.transparent;\n target.opacity = source.opacity;\n target.alphaTest = source.alphaTest;\n target.depthTest = source.depthTest;\n target.depthWrite = source.depthWrite;\n target.blending = source.blending;\n }\n}\n\nexport default StandardToBasicConverter;\n","import type { MeshStandardMaterial } from \"three\";\nimport { MeshLambertMaterial } from \"three\";\n\n/**\n * Configuration options for the StandardToLambertConverter\n *\n * @interface StandardToLambertConverterOptions\n */\nexport interface StandardToLambertConverterOptions {\n /**\n * Whether to preserve the original material's name\n * @defaultValue true\n */\n preserveName: boolean;\n /**\n * Whether to copy user data from the original material\n * @defaultValue true\n */\n copyUserData: boolean;\n /**\n * Whether to dispose the original material after conversion\n * @defaultValue false\n */\n disposeOriginal: boolean;\n /**\n * Custom color adjustment factor for roughness compensation\n * @defaultValue 0.8\n */\n roughnessColorFactor: number;\n}\n\n/**\n * Converts Three.js MeshStandardMaterial to MeshLambertMaterial\n *\n * This converter handles the translation between PBR (Physically Based Rendering)\n * properties of StandardMaterial and the simpler Lambertian reflectance model\n * used by LambertMaterial. The conversion preserves visual similarity by applying\n * color compensation based on metalness and roughness values.\n */\nexport class StandardToLambertConverter {\n /**\n * Converts a MeshStandardMaterial to MeshLambertMaterial\n *\n * This method performs a comprehensive conversion from PBR StandardMaterial to\n * the simpler Lambert lighting model while attempting to preserve visual similarity\n * through intelligent color compensation.\n *\n * @param material - The source MeshStandardMaterial to convert\n * @param options - Configuration options for the conversion\n * @returns A new MeshLambertMaterial with properties mapped from the standard material\n *\n * @example\n * ```typescript\n * const standardMaterial = new MeshStandardMaterial({\n * color: 0xff0000,\n * metalness: 0.8,\n * roughness: 0.2\n * });\n *\n * const lambertMaterial = StandardToLambertConverter.convert(standardMaterial);\n * ```\n *\n * @see {@link StandardToLambertConverterOptions} for available configuration options\n */\n public static convert(\n material: MeshStandardMaterial,\n options: Partial<StandardToLambertConverterOptions> = {},\n ): MeshLambertMaterial {\n const config = {\n preserveName: true,\n copyUserData: true,\n disposeOriginal: false,\n roughnessColorFactor: 0.8,\n ...options,\n };\n\n // Create new Lambert material\n const lambertMaterial = new MeshLambertMaterial();\n\n // Copy basic material properties\n this.copyBasicProperties(material, lambertMaterial, config);\n\n // Handle color properties with roughness compensation\n this.convertColorProperties(material, lambertMaterial, config);\n\n // Handle texture maps\n this.convertTextureMaps(material, lambertMaterial);\n\n // Handle transparency and alpha\n this.convertTransparencyProperties(material, lambertMaterial);\n\n // Cleanup if requested\n if (config.disposeOriginal) {\n material.dispose();\n }\n\n lambertMaterial.needsUpdate = true;\n return lambertMaterial;\n }\n\n /**\n * Copies basic material properties from source to target material\n *\n * Transfers common material properties including rendering settings,\n * visibility, fog interaction, wireframe settings, and user data.\n *\n * @param source - The source MeshStandardMaterial\n * @param target - The target MeshLambertMaterial\n * @param config - The resolved configuration options\n * @internal\n */\n private static copyBasicProperties(\n source: MeshStandardMaterial,\n target: MeshLambertMaterial,\n config: Required<StandardToLambertConverterOptions>,\n ): void {\n if (config.preserveName) {\n target.name = source.name;\n }\n\n target.side = source.side;\n target.visible = source.visible;\n target.fog = source.fog;\n target.wireframe = source.wireframe;\n target.wireframeLinewidth = source.wireframeLinewidth;\n target.vertexColors = source.vertexColors;\n target.flatShading = source.flatShading;\n\n if (config.copyUserData) {\n target.userData = { ...source.userData };\n }\n }\n\n /**\n * Converts color-related properties with PBR compensation\n *\n * Applies intelligent color adjustments to compensate for the loss of\n * metalness and roughness information when converting to Lambert material.\n * Metallic materials are darkened and rough materials receive additional\n * darkening based on the roughnessColorFactor.\n *\n * @param source - The source MeshStandardMaterial\n * @param target - The target MeshLambertMaterial\n * @param config - The resolved configuration options\n * @internal\n */\n private static convertColorProperties(\n source: MeshStandardMaterial,\n target: MeshLambertMaterial,\n config: Required<StandardToLambertConverterOptions>,\n ): void {\n target.color = source.color.clone();\n\n // Adjust color based on metalness and roughness for better visual match\n if (source.metalness > 0) {\n // Metallic materials tend to be darker in Lambert shading\n const metalnessFactor = 1 - source.metalness * 0.3;\n target.color.multiplyScalar(metalnessFactor);\n }\n\n if (source.roughness > 0.5) {\n // Rough materials appear slightly darker\n const roughnessFactor =\n config.roughnessColorFactor + source.roughness * 0.2;\n target.color.multiplyScalar(roughnessFactor);\n }\n\n target.emissive = source.emissive.clone();\n target.emissiveIntensity = source.emissiveIntensity;\n }\n\n /**\n * Converts and maps texture properties from Standard to Lambert material\n *\n * Handles the transfer of compatible texture maps including diffuse, normal,\n * emissive, AO, light maps, and environment maps. The environment map\n * reflectivity is set based on the original material's metalness value.\n *\n * @param source - The source MeshStandardMaterial\n * @param target - The target MeshLambertMaterial\n * @internal\n */\n private static convertTextureMaps(\n source: MeshStandardMaterial,\n target: MeshLambertMaterial,\n ): void {\n // Diffuse/Albedo map\n if (source.map) {\n target.map = source.map;\n }\n\n // Emissive map\n if (source.emissiveMap) {\n target.emissiveMap = source.emissiveMap;\n }\n\n // Normal map (Lambert materials support normal mapping)\n if (source.normalMap) {\n target.normalMap = source.normalMap;\n target.normalScale = source.normalScale.clone();\n }\n\n // Light map\n if (source.lightMap) {\n target.lightMap = source.lightMap;\n target.lightMapIntensity = source.lightMapIntensity;\n }\n\n // AO map\n if (source.aoMap) {\n target.aoMap = source.aoMap;\n target.aoMapIntensity = source.aoMapIntensity;\n }\n\n // Environment map (for reflections)\n if (source.envMap) {\n target.envMap = source.envMap;\n target.reflectivity = Math.min(source.metalness + 0.1, 1.0);\n }\n\n // Alpha map\n if (source.alphaMap) {\n target.alphaMap = source.alphaMap;\n }\n\n // Copy UV transforms\n this.copyUVTransforms(source, target);\n }\n\n /**\n * Copies UV transformation properties for texture maps\n *\n * Transfers UV offset, repeat, rotation, and center properties from the\n * source material's main texture map to the target material's map.\n *\n * @param source - The source MeshStandardMaterial\n * @param target - The target MeshLambertMaterial\n * @internal\n */\n private static copyUVTransforms(\n source: MeshStandardMaterial,\n target: MeshLambertMaterial,\n ): void {\n // Main texture UV transform\n if (source.map && target.map) {\n target.map.offset.copy(source.map.offset);\n target.map.repeat.copy(source.map.repeat);\n target.map.rotation = source.map.rotation;\n target.map.center.copy(source.map.center);\n }\n }\n\n /**\n * Converts transparency and rendering properties\n *\n * Transfers transparency, opacity, alpha testing, depth testing,\n * depth writing, and blending mode settings from source to target.\n *\n * @param source - The source MeshStandardMaterial\n * @param target - The target MeshLambertMaterial\n * @internal\n */\n private static convertTransparencyProperties(\n source: MeshStandardMaterial,\n target: MeshLambertMaterial,\n ): void {\n target.transparent = source.transparent;\n target.opacity = source.opacity;\n target.alphaTest = source.alphaTest;\n target.depthTest = source.depthTest;\n target.depthWrite = source.depthWrite;\n target.blending = source.blending;\n }\n}\n","import type { Texture } from \"three\";\nimport { Box3, DirectionalLight, RGBAFormat, Spherical, Vector3 } from \"three\";\n\n/** Number of color channels in RGBA format */\nconst RGBA_CHANNEL_COUNT = 4;\n/** Number of color channels in RGB format */\nconst RGB_CHANNEL_COUNT = 3;\n\n/** Red channel weight for luminance calculation (ITU-R BT.709) */\nconst LUMINANCE_R = 0.2126;\n/** Green channel weight for luminance calculation (ITU-R BT.709) */\nconst LUMINANCE_G = 0.7152;\n/** Blue channel weight for luminance calculation (ITU-R BT.709) */\nconst LUMINANCE_B = 0.0722;\n\n/**\n * A directional light with spherical positioning controls and advanced shadow mapping.\n *\n * Extends Three.js DirectionalLight to provide intuitive spherical coordinate control\n * (distance, elevation, azimuth) and automatic shadow map configuration for bounding boxes.\n * Also supports automatic sun direction calculation from HDR environment maps.\n */\nexport class Sun extends DirectionalLight {\n /** Internal vectors to avoid garbage collection during calculations */\n private readonly tempVector3D0 = new Vector3();\n private readonly tempVector3D1 = new Vector3();\n private readonly tempVector3D2 = new Vector3();\n private readonly tempVector3D3 = new Vector3();\n private readonly tempVector3D4 = new Vector3();\n private readonly tempVector3D5 = new Vector3();\n private readonly tempVector3D6 = new Vector3();\n private readonly tempVector3D7 = new Vector3();\n private readonly tempBox3 = new Box3();\n private readonly tempSpherical = new Spherical();\n\n /**\n * Gets the distance from the light to its target (origin).\n *\n * @returns The distance in world units\n */\n public get distance(): number {\n return this.position.length();\n }\n\n /**\n * Gets the elevation angle (vertical angle from the horizontal plane).\n *\n * @returns The elevation angle in radians (0 = horizontal, π/2 = directly above)\n */\n public get elevation(): number {\n return this.tempSpherical.setFromVector3(this.position).phi;\n }\n\n /**\n * Gets the azimuth angle (horizontal rotation around the target).\n *\n * @returns The azimuth angle in radians (0 = positive X axis, π/2 = positive Z axis)\n */\n public get azimuth(): number {\n return this.tempSpherical.setFromVector3(this.position).theta;\n }\n\n /**\n * Sets the distance while preserving current elevation and azimuth angles.\n *\n * @param value - The new distance in world units\n */\n public set distance(value: number) {\n this.tempSpherical.setFromVector3(this.position);\n this.position.setFromSphericalCoords(\n value,\n this.tempSpherical.phi,\n this.tempSpherical.theta,\n );\n }\n\n /**\n * Sets the elevation angle while preserving current distance and azimuth.\n *\n * @param value - The new elevation angle in radians (0 = horizontal, π/2 = directly above)\n */\n public set elevation(value: number) {\n this.tempSpherical.setFromVector3(this.position);\n this.position.setFromSphericalCoords(\n this.tempSpherical.radius,\n value,\n this.tempSpherical.theta,\n );\n }\n\n /**\n * Sets the azimuth angle while preserving current distance and elevation.\n *\n * @param value - The new azimuth angle in radians (0 = positive X axis, π/2 = positive Z axis)\n */\n public set azimuth(value: number) {\n this.tempSpherical.setFromVector3(this.position);\n this.position.setFromSphericalCoords(\n this.tempSpherical.radius,\n this.tempSpherical.phi,\n value,\n );\n }\n\n /**\n * Configures the shadow camera to optimally cover a bounding box.\n *\n * This method automatically adjusts the directional light's shadow camera frustum\n * to perfectly encompass the provided bounding box, ensuring efficient shadow map\n * usage and eliminating shadow clipping issues.\n *\n * @param box3 - The 3D bounding box to cover with shadows\n */\n public configureShadowsForBoundingBox(box3: Box3): void {\n const camera = this.shadow.camera;\n\n this.target.updateWorldMatrix(true, false);\n this.lookAt(this.target.getWorldPosition(this.tempVector3D0));\n\n this.updateWorldMatrix(true, false);\n\n const points: Vector3[] = [\n this.tempVector3D0.set(box3.min.x, box3.min.y, box3.min.z),\n this.tempVector3D1.set(box3.min.x, box3.min.y, box3.max.z),\n this.tempVector3D2.set(box3.min.x, box3.max.y, box3.min.z),\n this.tempVector3D3.set(box3.min.x, box3.max.y, box3.max.z),\n this.tempVector3D4.set(box3.max.x, box3.min.y, box3.min.z),\n this.tempVector3D5.set(box3.max.x, box3.min.y, box3.max.z),\n this.tempVector3D6.set(box3.max.x, box3.max.y, box3.min.z),\n this.tempVector3D7.set(box3.max.x, box3.max.y, box3.max.z),\n ];\n\n const inverseMatrix = this.matrixWorld.clone().invert();\n\n for (const point of points) {\n point.applyMatrix4(inverseMatrix);\n }\n\n const newBox3 = this.tempBox3.setFromPoints(points);\n\n camera.left = newBox3.min.x;\n camera.bottom = newBox3.min.y;\n camera.near = -newBox3.max.z;\n\n camera.right = newBox3.max.x;\n camera.top = newBox3.max.y;\n camera.far = -newBox3.min.z;\n\n camera.updateWorldMatrix(true, false);\n camera.updateProjectionMatrix();\n }\n\n /**\n * Sets the sun's direction based on the brightest point in an HDR environment map.\n *\n * This method analyzes an HDR texture to find the pixel with the highest luminance\n * value and positions the sun to shine from that direction. This is useful for\n * creating realistic lighting that matches HDR environment maps.\n *\n * @param texture - The HDR texture to analyze (must have image data available)\n * @param distance - The distance to place the sun from the origin (defaults to 1)\n */\n public setDirectionFromHDRTexture(texture: Texture, distance = 1): void {\n const data = texture.image.data;\n const width = texture.image.width;\n const height = texture.image.height;\n\n let maxLuminance = 0;\n let maxIndex = 0;\n\n // Find brightest pixel\n\n const step =\n texture.format === RGBAFormat ? RGBA_CHANNEL_COUNT : RGB_CHANNEL_COUNT;\n for (let i = 0; i < data.length; i += step) {\n const r = data[i];\n const g = data[i + 1];\n const b = data[i + 2];\n const luminance = LUMINANCE_R * r + LUMINANCE_G * g + LUMINANCE_B * b;\n if (luminance > maxLuminance) {\n maxLuminance = luminance;\n maxIndex = i;\n }\n }\n\n // Convert to spherical coordinates\n const pixelIndex = maxIndex / step;\n const x = pixelIndex % width;\n const y = Math.floor(pixelIndex / width);\n\n const u = x / width;\n const v = y / height;\n\n const elevation = v * Math.PI;\n const azimuth = u * -Math.PI * 2 - Math.PI / 2;\n\n this.position.setFromSphericalCoords(distance, elevation, azimuth);\n }\n}\n"],"names":["MAX_FOV","DualFovCamera","PerspectiveCamera","constructor","horizontalFov","verticalFov","aspect","near","far","super","this","_private_horizontalFovInternal","_private_verticalFovInternal","updateProjectionMatrix","value","MathUtils","clamp","setFov","horizontal","vertical","copyFovSettings","source","radians","degToRad","fov","radToDeg","Math","atan","tan","getActualHorizontalFov","verticalRadians","getActualVerticalFov","horizontalRadians","fitVerticalFovToPoints","vertices","up","Vector3","applyQuaternion","quaternion","maxVerticalAngle","vertex","vertexDirection","position","clone","sub","normalize","verticalAngle","asin","abs","dot","sign","requiredFov","fitVerticalFovToBox","box","min","x","y","z","max","fitVerticalFovToMesh","skinnedMesh","updateWorldMatrix","skeleton","update","geometry","attributes","target","points","i","count","fromBufferAttribute","applyBoneTransform","push","lookAtMeshCenterOfMass","centerOfMass","iterations","length","center","floor","total","point","distanceTo","add","divideScalar","findMainCluster","lookAt","camera","copy","SceneTraversal","getObjectByName","object","name","child","children","result","getMaterialByName","Mesh","Array","isArray","material","enumerateObjectsByType","type","callback","enumerateMaterials","filterObjects","filter","test","concat","filterMaterials","findMaterialUsers","materialName","hasMatchingMaterial","SkinnedMeshBaker","bakePose","bakedGeometry","newPositions","Float32Array","setAttribute","BufferAttribute","computeVertexNormals","deleteAttribute","mesh","bakeAnimationFrame","armature","timeOffset","clip","mixer","AnimationMixer","clipAction","play","setTime","StandardToBasicConverter","convert","standardMaterial","options","config","preserveName","copyUserData","disposeOriginal","combineEmissive","brightnessFactor","basicMaterial","MeshBasicMaterial","copyBasicProperties","convertColorProperties","convertTextureMaps","convertTransparencyProperties","dispose","needsUpdate","side","visible","fog","wireframe","wireframeLinewidth","vertexColors","userData","color","multiplyScalar","metalness","emissiveContribution","emissive","emissiveIntensity","r","g","b","map","alphaMap","envMap","reflectivity","lightMap","lightMapIntensity","aoMap","aoMapIntensity","metalnessMap","specularMap","copyUVTransforms","offset","repeat","rotation","transparent","opacity","alphaTest","depthTest","depthWrite","blending","StandardToLambertConverter","roughnessColorFactor","lambertMaterial","MeshLambertMaterial","flatShading","roughness","emissiveMap","normalMap","normalScale","Sun","DirectionalLight","Box3","Spherical","distance","elevation","_private_tempSpherical","setFromVector3","phi","azimuth","theta","setFromSphericalCoords","radius","configureShadowsForBoundingBox","box3","shadow","getWorldPosition","_private_tempVector3D0","set","_private_tempVector3D1","_private_tempVector3D2","_private_tempVector3D3","_private_tempVector3D4","_private_tempVector3D5","_private_tempVector3D6","_private_tempVector3D7","inverseMatrix","matrixWorld","invert","applyMatrix4","newBox3","_private_tempBox3","setFromPoints","left","bottom","right","top","setDirectionFromHDRTexture","texture","data","image","width","height","maxLuminance","maxIndex","step","format","RGBAFormat","luminance","pixelIndex","PI"],"mappings":"wOAIA,MAaMA,EAAU,IAOV,MAAOC,UAAsBC,EAejC,WAAAC,CACEC,EApC2B,GAqC3BC,EAnCyB,GAoCzBC,EAlCmB,EAmCnBC,EAjCiB,EAkCjBC,EAhCgB,KAkChBC,MAAMJ,EAAaC,EAAQC,EAAMC,GACjCE,KAAIC,EAAyBP,EAC7BM,KAAIE,EAAuBP,EAC3BK,KAAKG,wBACP,CAOA,iBAAWT,GACT,OAAOM,KAAIC,CACb,CAOA,eAAWN,GACT,OAAOK,KAAIE,CACb,CAOA,iBAAWR,CAAcU,GACvBJ,KAAIC,EAAyBI,EAAUC,MAAMF,EA7DjC,EA6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ACfC,EAAW,EAIf,MAAMC,EACJP,EAAQQ,SAAWC,EAzKE,EAED,EAwKtB,IAAK,IAAI7K,EAAI,EAAOqK,EAAK7J,OAATR,EAAiBA,GAAK2K,EAAM,CAC1C,MAGMG,EAzKQ,MAsKJT,EAAKrK,GApKD,MAqKJqK,EAAKrK,EAAI,GAnKL,MAoKJqK,EAAKrK,EAAI,GAEf8K,EAAYL,IACdA,EAAeK,EACfJ,EAAW1K,EAEf,CAGA,MAAM+K,EAAaL,EAAWC,EACxBxL,EAAI4L,EAAaR,EASvBjO,KAAKgC,SAASmK,uBAAuBP,EAR3B5K,KAAKoD,MAAMqK,EAAaR,GAGpBC,EAEQlN,KAAK0N,GAHjB7L,EAAIoL,GAIOjN,KAAK0N,GAAK,EAAI1N,KAAK0N,GAAK,EAG/C"}
1
+ {"version":3,"file":"index.min.js","sources":["../src/DualFovCamera.ts","../src/SceneTraversal.ts","../src/SkinnedMeshBaker.ts","../src/StandardToBasicConverter.ts","../src/StandardToLambertConverter.ts","../src/Sun.ts"],"sourcesContent":["import type { Box3, BufferAttribute, SkinnedMesh } from \"three\";\nimport { MathUtils, PerspectiveCamera, Vector3 } from \"three\";\n\n/** Default horizontal field of view in degrees */\nconst DEFAULT_HORIZONTAL_FOV = 90;\n/** Default vertical field of view in degrees */\nconst DEFAULT_VERTICAL_FOV = 90;\n/** Default aspect ratio (width/height) */\nconst DEFAULT_ASPECT = 1;\n/** Default near clipping plane distance */\nconst DEFAULT_NEAR = 1;\n/** Default far clipping plane distance */\nconst DEFAULT_FAR = 1000;\n\n/** Minimum allowed field of view in degrees */\nconst MIN_FOV = 1;\n/** Maximum allowed field of view in degrees */\nconst MAX_FOV = 179;\n\n/**\n * A camera that supports independent horizontal and vertical FOV settings.\n * Extends Three.js PerspectiveCamera to allow separate control over horizontal\n * and vertical fields of view.\n */\nexport class DualFovCamera extends PerspectiveCamera {\n /** Internal storage for horizontal field of view in degrees */\n private horizontalFovInternal: number;\n /** Internal storage for vertical field of view in degrees */\n private verticalFovInternal: number;\n\n /**\n * Creates a new DualFovCamera instance.\n *\n * @param horizontalFov - Horizontal field of view in degrees. Clamped between 1° and 179°.\n * @param verticalFov - Vertical field of view in degrees. Clamped between 1° and 179°.\n * @param aspect - Camera aspect ratio (width/height).\n * @param near - Near clipping plane distance.\n * @param far - Far clipping plane distance.\n */\n constructor(\n horizontalFov = DEFAULT_HORIZONTAL_FOV,\n verticalFov = DEFAULT_VERTICAL_FOV,\n aspect = DEFAULT_ASPECT,\n near = DEFAULT_NEAR,\n far = DEFAULT_FAR,\n ) {\n super(verticalFov, aspect, near, far);\n this.horizontalFovInternal = horizontalFov;\n this.verticalFovInternal = verticalFov;\n this.updateProjectionMatrix();\n }\n\n /**\n * Gets the horizontal field of view in degrees.\n *\n * @returns The horizontal FOV value\n */\n public get horizontalFov(): number {\n return this.horizontalFovInternal;\n }\n\n /**\n * Gets the vertical field of view in degrees.\n *\n * @returns The vertical FOV value\n */\n public get verticalFov(): number {\n return this.verticalFovInternal;\n }\n\n /**\n * Sets the horizontal field of view in degrees.\n *\n * @param value - The horizontal FOV value in degrees. Clamped between 1° and 179°.\n */\n public set horizontalFov(value: number) {\n this.horizontalFovInternal = MathUtils.clamp(value, MIN_FOV, MAX_FOV);\n this.updateProjectionMatrix();\n }\n\n /**\n * Sets the vertical field of view in degrees.\n *\n * @param value - The vertical FOV value in degrees. Clamped between 1° and 179°.\n */\n public set verticalFov(value: number) {\n this.verticalFovInternal = MathUtils.clamp(value, MIN_FOV, MAX_FOV);\n this.updateProjectionMatrix();\n }\n\n /**\n * Sets both horizontal and vertical field of view values.\n *\n * @param horizontal - Horizontal FOV in degrees. Clamped between 1° and 179°.\n * @param vertical - Vertical FOV in degrees. Clamped between 1° and 179°.\n */\n public setFov(horizontal: number, vertical: number): void {\n this.horizontalFovInternal = MathUtils.clamp(horizontal, MIN_FOV, MAX_FOV);\n this.verticalFovInternal = MathUtils.clamp(vertical, MIN_FOV, MAX_FOV);\n this.updateProjectionMatrix();\n }\n\n /**\n * Copies the field of view settings from another DualFovCamera.\n *\n * @param source - The DualFovCamera to copy FOV settings from.\n */\n public copyFovSettings(source: DualFovCamera): void {\n this.horizontalFovInternal = source.horizontalFov;\n this.verticalFovInternal = source.verticalFov;\n this.updateProjectionMatrix();\n }\n\n /**\n * Updates the projection matrix based on current FOV settings and aspect ratio.\n *\n * The behavior differs based on orientation:\n * - **Landscape mode (aspect > 1)**: Preserves horizontal FOV, calculates vertical FOV\n * - **Portrait mode (aspect ≤ 1)**: Preserves vertical FOV, calculates horizontal FOV\n *\n * Called when FOV values or aspect ratio changes.\n *\n * @override\n */\n public override updateProjectionMatrix(): void {\n if (this.aspect > 1) {\n // Landscape orientation: preserve horizontal FOV\n const radians = MathUtils.degToRad(this.horizontalFovInternal);\n this.fov = MathUtils.radToDeg(\n Math.atan(Math.tan(radians / 2) / this.aspect) * 2,\n );\n } else {\n // Portrait orientation: preserve vertical FOV\n this.fov = this.verticalFovInternal;\n }\n\n super.updateProjectionMatrix();\n }\n\n /**\n * Gets the horizontal field of view after aspect ratio adjustments.\n *\n * In landscape mode, returns the set horizontal FOV.\n * In portrait mode, calculates the horizontal FOV from vertical FOV and aspect ratio.\n *\n * @returns The horizontal FOV in degrees\n */\n public getActualHorizontalFov(): number {\n if (this.aspect >= 1) {\n return this.horizontalFovInternal;\n }\n const verticalRadians = MathUtils.degToRad(this.verticalFovInternal);\n return MathUtils.radToDeg(\n Math.atan(Math.tan(verticalRadians / 2) * this.aspect) * 2,\n );\n }\n\n /**\n * Gets the vertical field of view after aspect ratio adjustments.\n *\n * In portrait mode, returns the set vertical FOV.\n * In landscape mode, calculates the vertical FOV from horizontal FOV and aspect ratio.\n *\n * @returns The vertical FOV in degrees\n */\n public getActualVerticalFov(): number {\n if (this.aspect < 1) {\n return this.verticalFovInternal;\n }\n const horizontalRadians = MathUtils.degToRad(this.horizontalFovInternal);\n return MathUtils.radToDeg(\n Math.atan(Math.tan(horizontalRadians / 2) / this.aspect) * 2,\n );\n }\n\n /**\n * Adjusts the vertical field of view to fit specified points within the camera's view.\n *\n * Calculates the required vertical FOV to ensure all provided vertices\n * are visible within the vertical bounds of the camera's frustum.\n *\n * @param vertices - Array of 3D points in world coordinates\n */\n public fitVerticalFovToPoints(vertices: Vector3[]): void {\n const up = new Vector3(0, 1, 0).applyQuaternion(this.quaternion);\n\n let maxVerticalAngle = 0;\n\n for (const vertex of vertices) {\n const vertexToCam = this.position.clone().sub(vertex);\n const vertexDirection = vertexToCam.normalize();\n\n const verticalAngle =\n Math.asin(Math.abs(vertexDirection.dot(up))) *\n Math.sign(vertexDirection.dot(up));\n\n if (Math.abs(verticalAngle) > maxVerticalAngle) {\n maxVerticalAngle = Math.abs(verticalAngle);\n }\n }\n\n const requiredFov = MathUtils.radToDeg(2 * maxVerticalAngle);\n\n this.verticalFovInternal = MathUtils.clamp(requiredFov, MIN_FOV, MAX_FOV);\n this.updateProjectionMatrix();\n }\n\n /**\n * Adjusts the vertical field of view to fit a bounding box within the camera's view.\n *\n * Calculates the required vertical FOV to ensure the bounding box\n * is visible within the vertical bounds of the camera's frustum.\n *\n * @param box - The 3D bounding box in world coordinates\n */\n public fitVerticalFovToBox(box: Box3): void {\n this.fitVerticalFovToPoints([\n new Vector3(box.min.x, box.min.y, box.min.z),\n new Vector3(box.min.x, box.min.y, box.max.z),\n new Vector3(box.min.x, box.max.y, box.min.z),\n new Vector3(box.min.x, box.max.y, box.max.z),\n new Vector3(box.max.x, box.min.y, box.min.z),\n new Vector3(box.max.x, box.min.y, box.max.z),\n new Vector3(box.max.x, box.max.y, box.min.z),\n new Vector3(box.max.x, box.max.y, box.max.z),\n ]);\n }\n\n /**\n * Adjusts the vertical field of view to fit a skinned mesh within the camera's view.\n *\n * Updates the mesh's skeleton, applies bone transformations to vertices,\n * and calculates the required vertical FOV to fit the deformed mesh\n * within the vertical bounds of the camera's frustum.\n *\n * @param skinnedMesh - The skinned mesh with active skeleton\n */\n public fitVerticalFovToMesh(skinnedMesh: SkinnedMesh): void {\n skinnedMesh.updateWorldMatrix(true, true);\n skinnedMesh.skeleton.update();\n\n const bakedGeometry = skinnedMesh.geometry;\n const position = bakedGeometry.attributes[\"position\"] as BufferAttribute;\n const target = new Vector3();\n\n const points = [];\n\n for (let i = 0; i < position.count; i++) {\n target.fromBufferAttribute(position, i);\n skinnedMesh.applyBoneTransform(i, target);\n points.push(target.clone());\n }\n\n this.fitVerticalFovToPoints(points);\n }\n\n /**\n * Points the camera to look at the center of mass of a skinned mesh.\n *\n * Updates the mesh's skeleton, applies bone transformations to vertices,\n * calculates the center of mass using a clustering algorithm, and orients the camera\n * to look at that point.\n *\n * The center of mass calculation uses iterative clustering to find the\n * main concentration of vertices.\n *\n * @param skinnedMesh - The skinned mesh with active skeleton\n */\n public lookAtMeshCenterOfMass(skinnedMesh: SkinnedMesh): void {\n skinnedMesh.updateWorldMatrix(true, true);\n skinnedMesh.skeleton.update();\n\n const bakedGeometry = skinnedMesh.geometry;\n const position = bakedGeometry.attributes.position as BufferAttribute;\n const target = new Vector3();\n const points: Vector3[] = [];\n\n for (let i = 0; i < position.count; i++) {\n target.fromBufferAttribute(position, i);\n skinnedMesh.applyBoneTransform(i, target);\n points.push(target.clone());\n }\n\n /**\n * Finds the main cluster center of 3D points using iterative refinement.\n *\n * @param points - Array of 3D points to cluster\n * @param iterations - Number of refinement iterations\n * @returns The center point of the main cluster\n */\n const findMainCluster = (points: Vector3[], iterations = 3): Vector3 => {\n if (points.length === 0) {\n return new Vector3();\n }\n\n let center = points[Math.floor(points.length / 2)].clone();\n\n for (let i = 0; i < iterations; i++) {\n let total = new Vector3();\n let count = 0;\n\n for (const point of points) {\n if (\n point.distanceTo(center) < point.distanceTo(total) ||\n count === 0\n ) {\n total.add(point);\n count++;\n }\n }\n\n if (count > 0) {\n center = total.divideScalar(count);\n }\n }\n\n return center;\n };\n\n const centerOfMass = findMainCluster(points);\n this.lookAt(centerOfMass);\n }\n\n /**\n * Creates a copy of this DualFovCamera.\n *\n * The cloned camera has identical FOV settings, position, rotation,\n * and all other camera properties.\n *\n * @returns A new DualFovCamera instance\n * @override\n */\n public override clone(): this {\n const camera = new DualFovCamera(\n this.horizontalFovInternal,\n this.verticalFovInternal,\n this.aspect,\n this.near,\n this.far,\n ) as this;\n\n camera.copy(this, true);\n return camera;\n }\n}\n","import type { Material, Object3D } from \"three\";\nimport { Mesh } from \"three\";\n\n/**\n * Constructor type for scene traversal operations.\n *\n * Represents a constructor function that creates instances of type T.\n * Used for runtime type checking when filtering objects by constructor type.\n *\n * @template T - The type that the constructor creates\n */\nexport type Constructor<T> = abstract new (...args: never[]) => T;\n\n/**\n * Utility class for finding and modifying objects in a Three.js scene graph.\n *\n * Provides static methods for traversing Three.js scene hierarchies,\n * searching for objects or materials, and performing batch operations.\n *\n * All methods perform depth-first traversal starting from the provided\n * root object and recursively processing all children.\n */\nexport class SceneTraversal {\n /**\n * Finds the first object in the scene hierarchy with an exact name match.\n *\n * Performs depth-first search through the scene graph starting from the\n * root object. Returns the first object whose name property matches\n * the search string.\n *\n * @param object - The root Object3D to start searching from\n * @param name - The exact name to search for (case-sensitive)\n * @returns The first matching Object3D, or null if no match is found\n */\n public static getObjectByName(\n object: Object3D,\n name: string,\n ): Object3D | null {\n if (object.name === name) {\n return object;\n }\n\n for (const child of object.children) {\n const result = SceneTraversal.getObjectByName(child, name);\n if (result) {\n return result;\n }\n }\n\n return null;\n }\n\n /**\n * Finds the first material in the scene hierarchy with an exact name match.\n *\n * Performs depth-first search through the scene graph, examining materials\n * attached to Mesh objects. Handles both single materials and material arrays.\n * Returns the first material whose name property matches the search string.\n *\n * @param object - The root Object3D to start searching from\n * @param name - The exact material name to search for (case-sensitive)\n * @returns The first matching Material, or null if no match is found\n */\n public static getMaterialByName(\n object: Object3D,\n name: string,\n ): Material | null {\n if (object instanceof Mesh) {\n if (Array.isArray(object.material)) {\n for (const material of object.material) {\n if (material.name === name) {\n return material;\n }\n }\n } else if (object.material.name === name) {\n return object.material;\n }\n }\n\n for (const child of object.children) {\n const material = SceneTraversal.getMaterialByName(child, name);\n if (material) {\n return material;\n }\n }\n\n return null;\n }\n\n /**\n * Processes all objects of a specific type in the scene hierarchy.\n *\n * Performs depth-first traversal and executes the callback function\n * for every object that is an instance of the specified type.\n *\n * @template T - The type of objects to process\n * @param object - The root Object3D to start searching from\n * @param type - The constructor/class to filter by (e.g., DirectionalLight, Mesh)\n * @param callback - Function to execute for each matching object instance\n */\n public static enumerateObjectsByType<T>(\n object: Object3D,\n type: Constructor<T>,\n callback: (instance: T) => void,\n ): void {\n if (object instanceof type) {\n callback(object);\n }\n\n for (const child of object.children) {\n SceneTraversal.enumerateObjectsByType(child, type, callback);\n }\n }\n\n /**\n * Processes all materials found in mesh objects within the scene hierarchy.\n *\n * Performs depth-first traversal, finding all Mesh objects and executing\n * the callback function for each material. Handles both single\n * materials and material arrays.\n *\n * @param object - The root Object3D to start searching from\n * @param callback - Function to execute for each material found\n */\n public static enumerateMaterials(\n object: Object3D,\n callback: (material: Material) => void,\n ): void {\n if (object instanceof Mesh) {\n if (Array.isArray(object.material)) {\n for (const material of object.material) {\n callback(material);\n }\n } else {\n callback(object.material);\n }\n }\n\n for (const child of object.children) {\n SceneTraversal.enumerateMaterials(child, callback);\n }\n }\n\n /**\n * Finds all objects in the scene hierarchy that match filter criteria.\n *\n * Performs depth-first search and collects all objects that either match\n * a regular expression pattern (applied to object names) or satisfy\n * a predicate function.\n *\n * @param object - The root Object3D to start searching from\n * @param filter - Either a RegExp to test against object names, or a predicate function\n * @returns Array of all matching Object3D instances\n */\n public static filterObjects(\n object: Object3D,\n filter: RegExp | ((object: Object3D) => boolean),\n ): Object3D[] {\n let result: Object3D[] = [];\n\n if (typeof filter === \"function\") {\n if (filter(object)) {\n result.push(object);\n }\n } else {\n if (object.name && filter.test(object.name)) {\n result.push(object);\n }\n }\n\n for (const child of object.children) {\n result = result.concat(SceneTraversal.filterObjects(child, filter));\n }\n\n return result;\n }\n\n /**\n * Finds all materials in the scene hierarchy whose names match a pattern.\n *\n * Performs depth-first search through all Mesh objects and collects materials\n * whose name property matches the regular expression. Handles both\n * single materials and material arrays.\n *\n * @param object - The root Object3D to start searching from\n * @param name - Regular expression pattern to test against material names\n * @returns Array of all matching Material instances\n */\n public static filterMaterials(object: Object3D, name: RegExp): Material[] {\n let result: Material[] = [];\n\n if (object instanceof Mesh) {\n if (Array.isArray(object.material)) {\n for (const material of object.material) {\n if (material.name !== undefined && name.test(material.name)) {\n result.push(material);\n }\n }\n } else {\n if (\n object.material.name !== undefined &&\n name.test(object.material.name)\n ) {\n result.push(object.material);\n }\n }\n }\n\n for (const child of object.children) {\n result = result.concat(SceneTraversal.filterMaterials(child, name));\n }\n\n return result;\n }\n\n /**\n * Finds all mesh objects that use materials with names matching a pattern.\n *\n * Performs depth-first search through all Mesh objects and collects mesh objects\n * whose materials have names that match the regular expression.\n *\n * @param object - The root Object3D to start searching from\n * @param materialName - Regular expression pattern to test against material names\n * @returns Array of all Mesh objects that use materials with matching names\n */\n public static findMaterialUsers(\n object: Object3D,\n materialName: RegExp,\n ): Mesh[] {\n let result: Mesh[] = [];\n\n if (object instanceof Mesh) {\n let hasMatchingMaterial = false;\n\n if (Array.isArray(object.material)) {\n for (const material of object.material) {\n if (material.name !== undefined && materialName.test(material.name)) {\n hasMatchingMaterial = true;\n break;\n }\n }\n } else {\n if (\n object.material.name !== undefined &&\n materialName.test(object.material.name)\n ) {\n hasMatchingMaterial = true;\n }\n }\n\n if (hasMatchingMaterial) {\n result.push(object);\n }\n }\n\n for (const child of object.children) {\n result = result.concat(\n SceneTraversal.findMaterialUsers(child, materialName),\n );\n }\n\n return result;\n }\n}\n","import type { AnimationClip, Object3D, SkinnedMesh } from \"three\";\nimport { AnimationMixer, BufferAttribute, Mesh, Vector3 } from \"three\";\n\n/** Number of components per vertex */\nconst COMPONENT_COUNT = 3;\n\n/** Converts skinned meshes to static meshes */\nexport class SkinnedMeshBaker {\n /**\n * Converts a skinned mesh to a static mesh in its current pose.\n * The resulting mesh has no bones but looks identical.\n *\n * @param skinnedMesh - Mesh to convert\n * @returns Static mesh with baked vertex positions\n */\n public static bakePose(skinnedMesh: SkinnedMesh): Mesh {\n const bakedGeometry = skinnedMesh.geometry.clone();\n const position = bakedGeometry.attributes[\"position\"] as BufferAttribute;\n const newPositions = new Float32Array(position.count * COMPONENT_COUNT);\n const target = new Vector3();\n\n for (let i = 0; i < position.count; i++) {\n target.fromBufferAttribute(position, i);\n skinnedMesh.applyBoneTransform(i, target);\n newPositions[i * COMPONENT_COUNT + 0] = target.x;\n newPositions[i * COMPONENT_COUNT + 1] = target.y;\n newPositions[i * COMPONENT_COUNT + 2] = target.z;\n }\n\n bakedGeometry.setAttribute(\n \"position\",\n new BufferAttribute(newPositions, COMPONENT_COUNT),\n );\n bakedGeometry.computeVertexNormals();\n bakedGeometry.deleteAttribute(\"skinIndex\");\n bakedGeometry.deleteAttribute(\"skinWeight\");\n\n const mesh = new Mesh(bakedGeometry, skinnedMesh.material);\n mesh.name = skinnedMesh.name;\n return mesh;\n }\n\n /**\n * Bakes a single frame from an animation into a static mesh.\n *\n * @param armature - Root object with bones\n * @param skinnedMesh - Mesh to convert\n * @param timeOffset - Time in seconds within the animation\n * @param clip - Animation to get the pose from\n * @returns Static mesh with baked vertex positions\n */\n public static bakeAnimationFrame(\n armature: Object3D,\n skinnedMesh: SkinnedMesh,\n timeOffset: number,\n clip: AnimationClip,\n ): Mesh {\n const mixer = new AnimationMixer(armature);\n const action = mixer.clipAction(clip);\n action.play();\n mixer.setTime(timeOffset);\n\n armature.updateWorldMatrix(true, true);\n skinnedMesh.skeleton.update();\n\n return this.bakePose(skinnedMesh);\n }\n}\n","import type { MeshStandardMaterial } from \"three\";\nimport { MeshBasicMaterial } from \"three\";\n\n/** Factor for metalness brightness adjustment */\nconst METALNESS_BRIGHTNESS_FACTOR = 0.3;\n/** Factor for emissive color contribution when combining with base color */\nconst EMISSIVE_CONTRIBUTION_FACTOR = 0.5;\n\n/**\n * Configuration options for the StandardToBasicConverter.\n */\nexport interface StandardToBasicConverterOptions {\n /**\n * Whether to preserve the original material's name\n * @defaultValue true\n */\n preserveName: boolean;\n /**\n * Whether to copy user data from the original material\n * @defaultValue true\n */\n copyUserData: boolean;\n /**\n * Whether to dispose the original material after conversion\n * @defaultValue false\n */\n disposeOriginal: boolean;\n /**\n * Whether to apply emissive color to the base color for brightness compensation\n * @defaultValue true\n */\n combineEmissive: boolean;\n /**\n * Factor for brightness adjustment to compensate for loss of lighting\n * @defaultValue 1.3\n */\n brightnessFactor: number;\n}\n\n/**\n * Converts Three.js MeshStandardMaterial to MeshBasicMaterial.\n *\n * Handles translation from PBR StandardMaterial to unlit BasicMaterial.\n * Since BasicMaterial doesn't respond to lighting, applies compensation\n * techniques including brightness adjustments and emissive color combination.\n */\nexport class StandardToBasicConverter {\n /**\n * Converts a MeshStandardMaterial to MeshBasicMaterial.\n *\n * Performs conversion from PBR StandardMaterial to unlit BasicMaterial\n * with brightness compensation and property mapping.\n *\n * @param standardMaterial - The source MeshStandardMaterial to convert\n * @param options - Configuration options for the conversion\n * @returns A new MeshBasicMaterial with properties mapped from the standard material\n *\n * @example\n * ```typescript\n * const standardMaterial = new MeshStandardMaterial({\n * color: 0x00ff00,\n * metalness: 0.5,\n * emissive: 0x111111,\n * emissiveIntensity: 0.2\n * });\n *\n * const basicMaterial = StandardToBasicConverter.convert(standardMaterial, {\n * brightnessFactor: 1.4,\n * combineEmissive: true\n * });\n * ```\n */\n public static convert(\n standardMaterial: MeshStandardMaterial,\n options: Partial<StandardToBasicConverterOptions> = {},\n ): MeshBasicMaterial {\n const config = {\n preserveName: true,\n copyUserData: true,\n disposeOriginal: false,\n combineEmissive: true,\n brightnessFactor: 1.3,\n ...options,\n };\n\n // Create new Basic material\n const basicMaterial = new MeshBasicMaterial();\n\n // Copy basic material properties\n this.copyBasicProperties(standardMaterial, basicMaterial, config);\n\n // Handle color properties with lighting compensation\n this.convertColorProperties(standardMaterial, basicMaterial, config);\n\n // Handle texture maps\n this.convertTextureMaps(standardMaterial, basicMaterial);\n\n // Handle transparency and alpha\n this.convertTransparencyProperties(standardMaterial, basicMaterial);\n\n // Cleanup if requested\n if (config.disposeOriginal) {\n standardMaterial.dispose();\n }\n\n basicMaterial.needsUpdate = true;\n return basicMaterial;\n }\n\n /**\n * Copies basic material properties from source to target material.\n *\n * @param source - The source MeshStandardMaterial\n * @param target - The target MeshBasicMaterial\n * @param config - The resolved configuration options\n * @internal\n */\n private static copyBasicProperties(\n source: MeshStandardMaterial,\n target: MeshBasicMaterial,\n config: Required<StandardToBasicConverterOptions>,\n ): void {\n if (config.preserveName) {\n target.name = source.name;\n }\n\n target.side = source.side;\n target.visible = source.visible;\n target.fog = source.fog;\n target.wireframe = source.wireframe;\n target.wireframeLinewidth = source.wireframeLinewidth;\n target.vertexColors = source.vertexColors;\n\n if (config.copyUserData) {\n target.userData = { ...source.userData };\n }\n }\n\n /**\n * Converts color-related properties with lighting compensation.\n *\n * Applies brightness compensation and optional emissive color combination\n * to account for BasicMaterial's lack of lighting response.\n *\n * @param source - The source MeshStandardMaterial\n * @param target - The target MeshBasicMaterial\n * @param config - The resolved configuration options\n * @internal\n */\n private static convertColorProperties(\n source: MeshStandardMaterial,\n target: MeshBasicMaterial,\n config: Required<StandardToBasicConverterOptions>,\n ): void {\n // Base color conversion with brightness compensation\n target.color = source.color.clone();\n\n // Apply brightness compensation since BasicMaterial doesn't respond to lighting\n target.color.multiplyScalar(config.brightnessFactor);\n\n // Adjust for metalness - metallic materials tend to be darker without lighting\n if (source.metalness > 0) {\n const metalnessBrightness =\n 1 + source.metalness * METALNESS_BRIGHTNESS_FACTOR;\n target.color.multiplyScalar(metalnessBrightness);\n }\n\n // Combine emissive color if requested\n if (config.combineEmissive) {\n const emissiveContribution = source.emissive\n .clone()\n .multiplyScalar(\n source.emissiveIntensity * EMISSIVE_CONTRIBUTION_FACTOR,\n );\n target.color.add(emissiveContribution);\n }\n\n // Ensure color doesn't exceed valid range\n target.color.r = Math.min(target.color.r, 1.0);\n target.color.g = Math.min(target.color.g, 1.0);\n target.color.b = Math.min(target.color.b, 1.0);\n }\n\n /**\n * Converts and maps texture properties from Standard to Basic material.\n *\n * Transfers compatible texture maps including diffuse, alpha, environment,\n * light, and AO maps.\n *\n * @param source - The source MeshStandardMaterial\n * @param target - The target MeshBasicMaterial\n * @internal\n */\n private static convertTextureMaps(\n source: MeshStandardMaterial,\n target: MeshBasicMaterial,\n ): void {\n // Main diffuse/albedo map\n if (source.map) {\n target.map = source.map;\n }\n\n // Alpha map\n if (source.alphaMap) {\n target.alphaMap = source.alphaMap;\n }\n\n // Environment map (BasicMaterial supports this for reflections)\n if (source.envMap) {\n target.envMap = source.envMap;\n // Use metalness to determine reflectivity\n target.reflectivity = source.metalness;\n }\n\n // Light map (BasicMaterial supports this)\n if (source.lightMap) {\n target.lightMap = source.lightMap;\n target.lightMapIntensity = source.lightMapIntensity;\n }\n\n // AO map (BasicMaterial supports this)\n if (source.aoMap) {\n target.aoMap = source.aoMap;\n target.aoMapIntensity = source.aoMapIntensity;\n }\n\n // Specular map (BasicMaterial supports this)\n if (source.metalnessMap) {\n // Use metalness map as specular map for some reflective effect\n target.specularMap = source.metalnessMap;\n }\n\n // Copy UV transforms\n this.copyUVTransforms(source, target);\n }\n\n /**\n * Copies UV transformation properties for texture maps.\n *\n * @param source - The source MeshStandardMaterial\n * @param target - The target MeshBasicMaterial\n * @internal\n */\n private static copyUVTransforms(\n source: MeshStandardMaterial,\n target: MeshBasicMaterial,\n ): void {\n // Main texture UV transform\n if (source.map && target.map) {\n target.map.offset.copy(source.map.offset);\n target.map.repeat.copy(source.map.repeat);\n target.map.rotation = source.map.rotation;\n target.map.center.copy(source.map.center);\n }\n }\n\n /**\n * Converts transparency and rendering properties.\n *\n * @param source - The source MeshStandardMaterial\n * @param target - The target MeshBasicMaterial\n * @internal\n */\n private static convertTransparencyProperties(\n source: MeshStandardMaterial,\n target: MeshBasicMaterial,\n ): void {\n target.transparent = source.transparent;\n target.opacity = source.opacity;\n target.alphaTest = source.alphaTest;\n target.depthTest = source.depthTest;\n target.depthWrite = source.depthWrite;\n target.blending = source.blending;\n }\n}\n\nexport default StandardToBasicConverter;\n","import type { MeshStandardMaterial } from \"three\";\nimport { MeshLambertMaterial } from \"three\";\n\n/** Factor for metalness darkness adjustment */\nconst METALNESS_DARKNESS_FACTOR = 0.3;\n/** Roughness threshold for additional darkening */\nconst ROUGHNESS_THRESHOLD = 0.5;\n/** Factor for roughness color adjustment */\nconst ROUGHNESS_COLOR_ADJUSTMENT = 0.2;\n/** Minimum reflectivity boost for environment maps */\nconst REFLECTIVITY_BOOST = 0.1;\n\n/**\n * Configuration options for the StandardToLambertConverter.\n */\nexport interface StandardToLambertConverterOptions {\n /**\n * Whether to preserve the original material's name\n * @defaultValue true\n */\n preserveName: boolean;\n /**\n * Whether to copy user data from the original material\n * @defaultValue true\n */\n copyUserData: boolean;\n /**\n * Whether to dispose the original material after conversion\n * @defaultValue false\n */\n disposeOriginal: boolean;\n /**\n * Custom color adjustment factor for roughness compensation\n * @defaultValue 0.8\n */\n roughnessColorFactor: number;\n}\n\n/**\n * Converts Three.js MeshStandardMaterial to MeshLambertMaterial.\n *\n * Handles translation between PBR properties of StandardMaterial and\n * the Lambertian reflectance model used by LambertMaterial. Applies\n * color compensation based on metalness and roughness values.\n */\nexport class StandardToLambertConverter {\n /**\n * Converts a MeshStandardMaterial to MeshLambertMaterial.\n *\n * Performs conversion from PBR StandardMaterial to Lambert lighting model\n * with color compensation based on metalness and roughness values.\n *\n * @param material - The source MeshStandardMaterial to convert\n * @param options - Configuration options for the conversion\n * @returns A new MeshLambertMaterial with properties mapped from the standard material\n *\n * @example\n * ```typescript\n * const standardMaterial = new MeshStandardMaterial({\n * color: 0xff0000,\n * metalness: 0.8,\n * roughness: 0.2\n * });\n *\n * const lambertMaterial = StandardToLambertConverter.convert(standardMaterial);\n * ```\n */\n public static convert(\n material: MeshStandardMaterial,\n options: Partial<StandardToLambertConverterOptions> = {},\n ): MeshLambertMaterial {\n const config = {\n preserveName: true,\n copyUserData: true,\n disposeOriginal: false,\n roughnessColorFactor: 0.8,\n ...options,\n };\n\n // Create new Lambert material\n const lambertMaterial = new MeshLambertMaterial();\n\n // Copy basic material properties\n this.copyBasicProperties(material, lambertMaterial, config);\n\n // Handle color properties with roughness compensation\n this.convertColorProperties(material, lambertMaterial, config);\n\n // Handle texture maps\n this.convertTextureMaps(material, lambertMaterial);\n\n // Handle transparency and alpha\n this.convertTransparencyProperties(material, lambertMaterial);\n\n // Cleanup if requested\n if (config.disposeOriginal) {\n material.dispose();\n }\n\n lambertMaterial.needsUpdate = true;\n return lambertMaterial;\n }\n\n /**\n * Copies basic material properties from source to target material.\n *\n * @param source - The source MeshStandardMaterial\n * @param target - The target MeshLambertMaterial\n * @param config - The resolved configuration options\n * @internal\n */\n private static copyBasicProperties(\n source: MeshStandardMaterial,\n target: MeshLambertMaterial,\n config: Required<StandardToLambertConverterOptions>,\n ): void {\n if (config.preserveName) {\n target.name = source.name;\n }\n\n target.side = source.side;\n target.visible = source.visible;\n target.fog = source.fog;\n target.wireframe = source.wireframe;\n target.wireframeLinewidth = source.wireframeLinewidth;\n target.vertexColors = source.vertexColors;\n target.flatShading = source.flatShading;\n\n if (config.copyUserData) {\n target.userData = { ...source.userData };\n }\n }\n\n /**\n * Converts color-related properties with PBR compensation.\n *\n * Applies color adjustments to compensate for the loss of metalness and\n * roughness information when converting to Lambert material.\n *\n * @param source - The source MeshStandardMaterial\n * @param target - The target MeshLambertMaterial\n * @param config - The resolved configuration options\n * @internal\n */\n private static convertColorProperties(\n source: MeshStandardMaterial,\n target: MeshLambertMaterial,\n config: Required<StandardToLambertConverterOptions>,\n ): void {\n target.color = source.color.clone();\n\n // Adjust color based on metalness and roughness for better visual match\n if (source.metalness > 0) {\n // Metallic materials tend to be darker in Lambert shading\n const metalnessFactor = 1 - source.metalness * METALNESS_DARKNESS_FACTOR;\n target.color.multiplyScalar(metalnessFactor);\n }\n\n if (source.roughness > ROUGHNESS_THRESHOLD) {\n // Rough materials appear slightly darker\n const roughnessFactor =\n config.roughnessColorFactor +\n source.roughness * ROUGHNESS_COLOR_ADJUSTMENT;\n target.color.multiplyScalar(roughnessFactor);\n }\n\n target.emissive = source.emissive.clone();\n target.emissiveIntensity = source.emissiveIntensity;\n }\n\n /**\n * Converts and maps texture properties from Standard to Lambert material.\n *\n * Transfers compatible texture maps including diffuse, normal, emissive,\n * AO, light maps, and environment maps.\n *\n * @param source - The source MeshStandardMaterial\n * @param target - The target MeshLambertMaterial\n * @internal\n */\n private static convertTextureMaps(\n source: MeshStandardMaterial,\n target: MeshLambertMaterial,\n ): void {\n // Diffuse/Albedo map\n if (source.map) {\n target.map = source.map;\n }\n\n // Emissive map\n if (source.emissiveMap) {\n target.emissiveMap = source.emissiveMap;\n }\n\n // Normal map (Lambert materials support normal mapping)\n if (source.normalMap) {\n target.normalMap = source.normalMap;\n target.normalScale = source.normalScale.clone();\n }\n\n // Light map\n if (source.lightMap) {\n target.lightMap = source.lightMap;\n target.lightMapIntensity = source.lightMapIntensity;\n }\n\n // AO map\n if (source.aoMap) {\n target.aoMap = source.aoMap;\n target.aoMapIntensity = source.aoMapIntensity;\n }\n\n // Environment map (for reflections)\n if (source.envMap) {\n target.envMap = source.envMap;\n target.reflectivity = Math.min(\n source.metalness + REFLECTIVITY_BOOST,\n 1.0,\n );\n }\n\n // Alpha map\n if (source.alphaMap) {\n target.alphaMap = source.alphaMap;\n }\n\n // Copy UV transforms\n this.copyUVTransforms(source, target);\n }\n\n /**\n * Copies UV transformation properties for texture maps.\n *\n * @param source - The source MeshStandardMaterial\n * @param target - The target MeshLambertMaterial\n * @internal\n */\n private static copyUVTransforms(\n source: MeshStandardMaterial,\n target: MeshLambertMaterial,\n ): void {\n // Main texture UV transform\n if (source.map && target.map) {\n target.map.offset.copy(source.map.offset);\n target.map.repeat.copy(source.map.repeat);\n target.map.rotation = source.map.rotation;\n target.map.center.copy(source.map.center);\n }\n }\n\n /**\n * Converts transparency and rendering properties.\n *\n * @param source - The source MeshStandardMaterial\n * @param target - The target MeshLambertMaterial\n * @internal\n */\n private static convertTransparencyProperties(\n source: MeshStandardMaterial,\n target: MeshLambertMaterial,\n ): void {\n target.transparent = source.transparent;\n target.opacity = source.opacity;\n target.alphaTest = source.alphaTest;\n target.depthTest = source.depthTest;\n target.depthWrite = source.depthWrite;\n target.blending = source.blending;\n }\n}\n","import type { Texture } from \"three\";\nimport { Box3, DirectionalLight, RGBAFormat, Spherical, Vector3 } from \"three\";\n\n/** Number of color channels in RGBA format */\nconst RGBA_CHANNEL_COUNT = 4;\n/** Number of color channels in RGB format */\nconst RGB_CHANNEL_COUNT = 3;\n\n/** Red channel weight for luminance calculation (ITU-R BT.709) */\nconst LUMINANCE_R = 0.2126;\n/** Green channel weight for luminance calculation (ITU-R BT.709) */\nconst LUMINANCE_G = 0.7152;\n/** Blue channel weight for luminance calculation (ITU-R BT.709) */\nconst LUMINANCE_B = 0.0722;\n\n/**\n * A directional light with spherical positioning controls.\n *\n * Extends Three.js DirectionalLight to provide spherical coordinate control\n * (distance, elevation, azimuth) and shadow map configuration for bounding boxes.\n * Also supports sun direction calculation from HDR environment maps.\n */\nexport class Sun extends DirectionalLight {\n /** Internal vectors to avoid garbage collection during calculations */\n private readonly tempVector3D0 = new Vector3();\n private readonly tempVector3D1 = new Vector3();\n private readonly tempVector3D2 = new Vector3();\n private readonly tempVector3D3 = new Vector3();\n private readonly tempVector3D4 = new Vector3();\n private readonly tempVector3D5 = new Vector3();\n private readonly tempVector3D6 = new Vector3();\n private readonly tempVector3D7 = new Vector3();\n private readonly tempBox3 = new Box3();\n private readonly tempSpherical = new Spherical();\n\n /**\n * Gets the distance from the light's position to the origin.\n *\n * @returns The distance in world units\n */\n public get distance(): number {\n return this.position.length();\n }\n\n /**\n * Gets the elevation angle from the spherical coordinates.\n *\n * @returns The elevation angle in radians (phi angle from Three.js Spherical coordinates)\n */\n public get elevation(): number {\n return this.tempSpherical.setFromVector3(this.position).phi;\n }\n\n /**\n * Gets the azimuth angle from the spherical coordinates.\n *\n * @returns The azimuth angle in radians (theta angle from Three.js Spherical coordinates)\n */\n public get azimuth(): number {\n return this.tempSpherical.setFromVector3(this.position).theta;\n }\n\n /**\n * Sets the distance while preserving current elevation and azimuth angles.\n *\n * @param value - The new distance in world units\n */\n public set distance(value: number) {\n this.tempSpherical.setFromVector3(this.position);\n this.position.setFromSphericalCoords(\n value,\n this.tempSpherical.phi,\n this.tempSpherical.theta,\n );\n }\n\n /**\n * Sets the elevation angle while preserving current distance and azimuth.\n *\n * @param value - The new elevation angle in radians (phi angle for Three.js Spherical coordinates)\n */\n public set elevation(value: number) {\n this.tempSpherical.setFromVector3(this.position);\n this.position.setFromSphericalCoords(\n this.tempSpherical.radius,\n value,\n this.tempSpherical.theta,\n );\n }\n\n /**\n * Sets the azimuth angle while preserving current distance and elevation.\n *\n * @param value - The new azimuth angle in radians (theta angle for Three.js Spherical coordinates)\n */\n public set azimuth(value: number) {\n this.tempSpherical.setFromVector3(this.position);\n this.position.setFromSphericalCoords(\n this.tempSpherical.radius,\n this.tempSpherical.phi,\n value,\n );\n }\n\n /**\n * Configures the shadow camera frustum to cover a bounding box.\n *\n * Adjusts the directional light's shadow camera frustum to encompass the\n * provided bounding box by transforming box corners to light space and\n * setting camera bounds accordingly.\n *\n * @param box3 - The 3D bounding box to cover with shadows\n */\n public configureShadowsForBoundingBox(box3: Box3): void {\n const camera = this.shadow.camera;\n\n this.target.updateWorldMatrix(true, false);\n this.lookAt(this.target.getWorldPosition(this.tempVector3D0));\n\n this.updateWorldMatrix(true, false);\n\n const points: Vector3[] = [\n this.tempVector3D0.set(box3.min.x, box3.min.y, box3.min.z),\n this.tempVector3D1.set(box3.min.x, box3.min.y, box3.max.z),\n this.tempVector3D2.set(box3.min.x, box3.max.y, box3.min.z),\n this.tempVector3D3.set(box3.min.x, box3.max.y, box3.max.z),\n this.tempVector3D4.set(box3.max.x, box3.min.y, box3.min.z),\n this.tempVector3D5.set(box3.max.x, box3.min.y, box3.max.z),\n this.tempVector3D6.set(box3.max.x, box3.max.y, box3.min.z),\n this.tempVector3D7.set(box3.max.x, box3.max.y, box3.max.z),\n ];\n\n const inverseMatrix = this.matrixWorld.clone().invert();\n\n for (const point of points) {\n point.applyMatrix4(inverseMatrix);\n }\n\n const newBox3 = this.tempBox3.setFromPoints(points);\n\n camera.left = newBox3.min.x;\n camera.bottom = newBox3.min.y;\n camera.near = -newBox3.max.z;\n\n camera.right = newBox3.max.x;\n camera.top = newBox3.max.y;\n camera.far = -newBox3.min.z;\n\n camera.updateWorldMatrix(true, false);\n camera.updateProjectionMatrix();\n }\n\n /**\n * Sets the sun's direction based on the brightest point in an HDR environment map.\n *\n * Analyzes an HDR texture to find the pixel with the highest luminance value\n * and positions the sun to shine from that direction using spherical coordinates.\n *\n * @param texture - The HDR texture to analyze (must have image data available)\n * @param distance - The distance to place the sun from the origin\n */\n public setDirectionFromHDRTexture(texture: Texture, distance = 1): void {\n const data = texture.image.data;\n const width = texture.image.width;\n const height = texture.image.height;\n\n let maxLuminance = 0;\n let maxIndex = 0;\n\n // Find brightest pixel\n\n const step =\n texture.format === RGBAFormat ? RGBA_CHANNEL_COUNT : RGB_CHANNEL_COUNT;\n for (let i = 0; i < data.length; i += step) {\n const r = data[i];\n const g = data[i + 1];\n const b = data[i + 2];\n const luminance = LUMINANCE_R * r + LUMINANCE_G * g + LUMINANCE_B * b;\n if (luminance > maxLuminance) {\n maxLuminance = luminance;\n maxIndex = i;\n }\n }\n\n // Convert to spherical coordinates\n const pixelIndex = maxIndex / step;\n const x = pixelIndex % width;\n const y = Math.floor(pixelIndex / width);\n\n const u = x / width;\n const v = y / height;\n\n const elevation = v * Math.PI;\n const azimuth = u * -Math.PI * 2 - Math.PI / 2;\n\n this.position.setFromSphericalCoords(distance, elevation, azimuth);\n }\n}\n"],"names":["MAX_FOV","DualFovCamera","PerspectiveCamera","constructor","horizontalFov","verticalFov","aspect","near","far","super","this","_private_horizontalFovInternal","_private_verticalFovInternal","updateProjectionMatrix","value","MathUtils","clamp","setFov","horizontal","vertical","copyFovSettings","source","radians","degToRad","fov","radToDeg","Math","atan","tan","getActualHorizontalFov","verticalRadians","getActualVerticalFov","horizontalRadians","fitVerticalFovToPoints","vertices","up","Vector3","applyQuaternion","quaternion","maxVerticalAngle","vertex","vertexDirection","position","clone","sub","normalize","verticalAngle","asin","abs","dot","sign","requiredFov","fitVerticalFovToBox","box","min","x","y","z","max","fitVerticalFovToMesh","skinnedMesh","updateWorldMatrix","skeleton","update","geometry","attributes","target","points","i","count","fromBufferAttribute","applyBoneTransform","push","lookAtMeshCenterOfMass","centerOfMass","iterations","length","center","floor","total","point","distanceTo","add","divideScalar","findMainCluster","lookAt","camera","copy","SceneTraversal","getObjectByName","object","name","child","children","result","getMaterialByName","Mesh","Array","isArray","material","enumerateObjectsByType","type","callback","enumerateMaterials","filterObjects","filter","test","concat","filterMaterials","undefined","findMaterialUsers","materialName","hasMatchingMaterial","SkinnedMeshBaker","bakePose","bakedGeometry","newPositions","Float32Array","setAttribute","BufferAttribute","computeVertexNormals","deleteAttribute","mesh","bakeAnimationFrame","armature","timeOffset","clip","mixer","AnimationMixer","clipAction","play","setTime","StandardToBasicConverter","convert","standardMaterial","options","config","preserveName","copyUserData","disposeOriginal","combineEmissive","brightnessFactor","basicMaterial","MeshBasicMaterial","copyBasicProperties","convertColorProperties","convertTextureMaps","convertTransparencyProperties","dispose","needsUpdate","side","visible","fog","wireframe","wireframeLinewidth","vertexColors","userData","color","multiplyScalar","metalness","emissiveContribution","emissive","emissiveIntensity","r","g","b","map","alphaMap","envMap","reflectivity","lightMap","lightMapIntensity","aoMap","aoMapIntensity","metalnessMap","specularMap","copyUVTransforms","offset","repeat","rotation","transparent","opacity","alphaTest","depthTest","depthWrite","blending","StandardToLambertConverter","roughnessColorFactor","lambertMaterial","MeshLambertMaterial","flatShading","roughness","emissiveMap","normalMap","normalScale","Sun","DirectionalLight","Box3","Spherical","distance","elevation","_private_tempSpherical","setFromVector3","phi","azimuth","theta","setFromSphericalCoords","radius","configureShadowsForBoundingBox","box3","shadow","getWorldPosition","_private_tempVector3D0","set","_private_tempVector3D1","_private_tempVector3D2","_private_tempVector3D3","_private_tempVector3D4","_private_tempVector3D5","_private_tempVector3D6","_private_tempVector3D7","inverseMatrix","matrixWorld","invert","applyMatrix4","newBox3","_private_tempBox3","setFromPoints","left","bottom","right","top","setDirectionFromHDRTexture","texture","data","image","width","height","maxLuminance","maxIndex","step","format","RGBAFormat","luminance","pixelIndex","PI"],"mappings":"wOAIA,MAaMA,EAAU,IAOV,MAAOC,UAAsBC,EAejC,WAAAC,CACEC,EApC2B,GAqC3BC,EAnCyB,GAoCzBC,EAlCmB,EAmCnBC,EAjCiB,EAkCjBC,EAhCgB,KAkChBC,MAAMJ,EAAaC,EAAQC,EAAMC,GACjCE,KAAIC,EAAyBP,EAC7BM,KAAIE,EAAuBP,EAC3BK,KAAKG,wBACP,CAOA,iBAAWT,GACT,OAAOM,KAAIC,CACb,CAOA,eAAWN,GACT,OAAOK,KAAIE,CACb,CAOA,iBAAWR,CAAcU,GACvBJ,KAAIC,EAAyBI,EAAUC,MAAMF,EA7DjC,EA6DiDd,GAC7DU,KAAKG,wBACP,CAOA,eAAWR,CAAYS,GACrBJ,KAAIE,EAAuBG,EAAUC,MAAMF,EAvE/B,EAuE+Cd,GAC3DU,KAAKG,wBACP,CAQO,MAAAI,CAAOC,EAAoBC,GAChCT,KAAIC,EAAyBI,EAAUC,MAAME,EAlFjC,EAkFsDlB,GAClEU,KAAIE,EAAuBG,EAAUC,MAAMG,EAnF/B,EAmFkDnB,GAC9DU,KAAKG,wBACP,CAOO,eAAAO,CAAgBC,GACrBX,KAAIC,EAAyBU,EAAOjB,cACpCM,KAAIE,EAAuBS,EAAOhB,YAClCK,KAAKG,wBACP,CAagB,sBAAAA,GACd,GAAIH,KAAKJ,OAAS,EAAG,CAEnB,MAAMgB,EAAUP,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HjB9L,EAAIqL,GAIOlN,KAAK2N,GAAK,EAAI3N,KAAK2N,GAAK,EAG/C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "three-zoo",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "description": "Some reusable bits for building things with Three.js ",
5
5
  "scripts": {
6
6
  "clean": "rm -rf dist",