three-zoo 0.5.4 → 0.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -24
- package/dist/DualFovCamera.d.ts +34 -74
- package/dist/SceneTraversal.d.ts +48 -75
- package/dist/SkinnedMeshBaker.d.ts +8 -9
- package/dist/StandardToBasicConverter.d.ts +11 -39
- package/dist/StandardToLambertConverter.d.ts +10 -34
- package/dist/Sun.d.ts +12 -36
- package/dist/index.js +203 -334
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
package/dist/index.min.js.map
CHANGED
|
@@ -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,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EAAO+I,MAAQL,EAAQtK,IAAIH,EAC3B+B,EAAOgJ,IAAMN,EAAQtK,IAAIF,EACzB8B,EAAO9E,KAAOwN,EAAQ1K,IAAIG,EAE1B6B,EAAOzB,mBAAkB,GAAM,GAC/ByB,EAAOzE,wBACT,CAYO,0BAAA0N,CAA2BC,EAAkBlC,EAAW,GAC7D,MAAMmC,EAAOD,EAAQE,MAAMD,KACrBE,EAAQH,EAAQE,MAAMC,MACtBC,EAASJ,EAAQE,MAAME,OAE7B,IAAIC,EAAe,EACfC,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 * Camera with independent horizontal and vertical FOV settings.\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 * @param horizontalFov - Horizontal FOV in degrees (clamped 1-179°)\n * @param verticalFov - Vertical FOV in degrees (clamped 1-179°)\n * @param aspect - 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 * @returns Horizontal FOV in degrees\n */\n public get horizontalFov(): number {\n return this.horizontalFovInternal;\n }\n\n /**\n * @returns Vertical FOV in degrees\n */\n public get verticalFov(): number {\n return this.verticalFovInternal;\n }\n\n /**\n * @param value - Horizontal FOV in degrees (clamped 1-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 * @param value - Vertical FOV in degrees (clamped 1-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 FOV values.\n *\n * @param horizontal - Horizontal FOV in degrees (clamped 1-179°)\n * @param vertical - Vertical FOV in degrees (clamped 1-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 FOV settings from another DualFovCamera.\n *\n * @param source - Source camera to copy 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 projection matrix based on FOV and aspect ratio.\n *\n * Landscape (aspect > 1): preserves horizontal FOV.\n * Portrait (aspect ≤ 1): preserves vertical FOV.\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 actual horizontal FOV after aspect ratio adjustments.\n *\n * @returns 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 actual vertical FOV after aspect ratio adjustments.\n *\n * @returns 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 vertical FOV to fit points within camera view.\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 vertical FOV to fit bounding box within camera view.\n *\n * @param box - 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 vertical FOV to fit skinned mesh within camera view.\n * Updates skeleton and applies bone transformations.\n *\n * @param skinnedMesh - 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 camera to look at skinned mesh center of mass.\n * Uses iterative clustering to find main vertex concentration.\n *\n * @param skinnedMesh - 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 main cluster center using iterative refinement.\n *\n * @param points - Array of 3D points to cluster\n * @param iterations - Number of refinement iterations\n * @returns Center point of 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 camera with identical settings.\n *\n * @returns 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 runtime type checking.\n *\n * @template T - The type that the constructor creates\n */\nexport type Constructor<T> = abstract new (...args: never[]) => T;\n\n/**\n * Static methods for traversing Three.js scene hierarchies.\n *\n * All methods use depth-first traversal.\n */\nexport class SceneTraversal {\n /**\n * Finds first object with exact name match.\n *\n * @param object - Root object to start from\n * @param name - Name to search for (case-sensitive)\n * @returns First matching object or null\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 first material with exact name match from mesh objects.\n *\n * @param object - Root object to start from\n * @param name - Material name to search for (case-sensitive)\n * @returns First matching material or null\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 * Executes callback for all objects of specified type.\n *\n * @template T - Type of objects to process\n * @param object - Root object to start from\n * @param type - Constructor to filter by\n * @param callback - Function to execute for each matching object\n */\n public static enumerateObjectsByType<T extends Object3D>(\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 * Executes callback for all materials of specified type from mesh objects.\n *\n * @template T - Type of materials to process\n * @param object - Root object to start from\n * @param type - Constructor to filter by\n * @param callback - Function to execute for each matching material\n */\n public static enumerateMaterialsByType<T extends Material>(\n object: Object3D,\n type: Constructor<T>,\n callback: (material: T) => void,\n ): void {\n if (object instanceof Mesh) {\n if (Array.isArray(object.material)) {\n for (const material of object.material) {\n if (material instanceof type) {\n callback(material);\n }\n }\n } else if (object.material instanceof type) {\n callback(object.material);\n }\n }\n\n for (const child of object.children) {\n SceneTraversal.enumerateMaterialsByType(child, type, callback);\n }\n }\n\n /**\n * Executes callback for all objects in hierarchy.\n *\n * @param object - Root object to start from\n * @param callback - Function to execute for each object\n */\n public static enumerateObjects(\n object: Object3D,\n callback: (object: Object3D) => void,\n ): void {\n callback(object);\n\n for (const child of object.children) {\n SceneTraversal.enumerateObjects(child, callback);\n }\n }\n\n /**\n * Executes callback for all materials from mesh objects.\n *\n * @param object - Root object to start from\n * @param callback - Function to execute for each material\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 * Returns all objects matching filter criteria.\n *\n * @param object - Root object to start from\n * @param filter - RegExp for object names or predicate function\n * @returns Array of matching objects\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 * Returns all materials matching filter criteria from mesh objects.\n *\n * @param object - Root object to start from\n * @param filter - RegExp for material names or predicate function\n * @returns Array of matching materials\n */\n public static filterMaterials(\n object: Object3D,\n filter: RegExp | ((object: Material) => boolean),\n ): 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 (typeof filter === \"function\") {\n if (filter(material)) {\n result.push(material);\n }\n } else if (filter.test(material.name)) {\n result.push(material);\n }\n }\n } else if (typeof filter === \"function\") {\n if (filter(object.material)) {\n result.push(object.material);\n }\n } else if (filter.test(object.material.name)) {\n result.push(object.material);\n }\n }\n\n for (const child of object.children) {\n result = result.concat(SceneTraversal.filterMaterials(child, filter));\n }\n\n return result;\n }\n\n /**\n * Returns all mesh objects that use any of the specified materials.\n *\n * @param object - Root object to start from\n * @param materials - Array of materials to search for\n * @returns Array of mesh objects using the materials\n */\n public static findMaterialUsers(\n object: Object3D,\n materials: Material[],\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 (materials.includes(material)) {\n hasMatchingMaterial = true;\n break;\n }\n }\n } else {\n if (materials.includes(object.material)) {\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, materials),\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 skinned mesh to static mesh in current pose.\n *\n * @param skinnedMesh - Mesh to convert\n * @returns Static mesh with baked 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 animation frame to static mesh.\n *\n * @param armature - Root object with bones\n * @param skinnedMesh - Mesh to convert\n * @param timeOffset - Time in seconds within animation\n * @param clip - Animation clip for pose\n * @returns Static mesh with baked 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 material conversion.\n */\nexport interface StandardToBasicConverterOptions {\n /**\n * Preserve original material name.\n * @defaultValue true\n */\n preserveName: boolean;\n /**\n * Copy user data from original material.\n * @defaultValue true\n */\n copyUserData: boolean;\n /**\n * Dispose original material after conversion.\n * @defaultValue false\n */\n disposeOriginal: boolean;\n /**\n * Apply emissive color to base color for brightness compensation.\n * @defaultValue true\n */\n combineEmissive: boolean;\n /**\n * Brightness adjustment factor to compensate for loss of lighting.\n * @defaultValue 1.3\n */\n brightnessFactor: number;\n}\n\n/**\n * Converts MeshStandardMaterial to MeshBasicMaterial with brightness compensation.\n */\nexport class StandardToBasicConverter {\n /**\n * Converts MeshStandardMaterial to MeshBasicMaterial.\n *\n * @param standardMaterial - Source material to convert\n * @param options - Conversion options\n * @returns New MeshBasicMaterial with mapped properties\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.\n *\n * @param source - Source material\n * @param target - Target material\n * @param config - 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 properties with lighting compensation.\n *\n * @param source - Source material\n * @param target - Target material\n * @param config - 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 texture properties from Standard to Basic material.\n *\n * @param source - Source material\n * @param target - Target material\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.\n *\n * @param source - Source material\n * @param target - Target material\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 - Source material\n * @param target - Target material\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 material conversion.\n */\nexport interface StandardToLambertConverterOptions {\n /**\n * Preserve original material name.\n * @defaultValue true\n */\n preserveName: boolean;\n /**\n * Copy user data from original material.\n * @defaultValue true\n */\n copyUserData: boolean;\n /**\n * Dispose original material after conversion.\n * @defaultValue false\n */\n disposeOriginal: boolean;\n /**\n * Color adjustment factor for roughness compensation.\n * @defaultValue 0.8\n */\n roughnessColorFactor: number;\n}\n\n/**\n * Converts MeshStandardMaterial to MeshLambertMaterial with PBR compensation.\n */\nexport class StandardToLambertConverter {\n /**\n * Converts MeshStandardMaterial to MeshLambertMaterial.\n *\n * @param material - Source material to convert\n * @param options - Conversion options\n * @returns New MeshLambertMaterial with mapped properties\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.\n *\n * @param source - Source material\n * @param target - Target material\n * @param config - 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 properties with PBR compensation.\n *\n * @param source - Source material\n * @param target - Target material\n * @param config - 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 texture properties from Standard to Lambert material.\n *\n * @param source - Source material\n * @param target - Target material\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.\n *\n * @param source - Source material\n * @param target - Target material\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 - Source material\n * @param target - Target material\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 * Directional light with spherical positioning and HDR environment support.\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 * @returns Distance from light position to origin\n */\n public get distance(): number {\n return this.position.length();\n }\n\n /**\n * @returns Elevation angle in radians (phi angle)\n */\n public get elevation(): number {\n return this.tempSpherical.setFromVector3(this.position).phi;\n }\n\n /**\n * @returns Azimuth angle in radians (theta angle)\n */\n public get azimuth(): number {\n return this.tempSpherical.setFromVector3(this.position).theta;\n }\n\n /**\n * @param value - 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 * @param value - New elevation angle in radians (phi angle)\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 * @param value - New azimuth angle in radians (theta angle)\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 shadow camera frustum to cover bounding box.\n *\n * @param box3 - 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 sun direction based on brightest point in HDR environment map.\n *\n * @param texture - HDR texture to analyze (must have image data)\n * @param distance - Distance to place sun from 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","enumerateMaterialsByType","enumerateObjects","enumerateMaterials","filterObjects","filter","test","concat","filterMaterials","findMaterialUsers","materials","hasMatchingMaterial","includes","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,IAKV,MAAOC,UAAsBC,EAajC,WAAAC,CACEC,EAhC2B,GAiC3BC,EA/ByB,GAgCzBC,EA9BmB,EA+BnBC,EA7BiB,EA8BjBC,EA5BgB,KA8BhBC,MAAMJ,EAAaC,EAAQC,EAAMC,GACjCE,KAAIC,EAAyBP,EAC7BM,KAAIE,EAAuBP,EAC3BK,KAAKG,wBACP,CAKA,iBAAWT,GACT,OAAOM,KAAIC,CACb,CAKA,eAAWN,GACT,OAAOK,KAAIE,CACb,CAKA,iBAAWR,CAAcU,GACvBJ,KAAIC,EAAyBI,EAAUC,MAAMF,EAnDjC,EAmDiDd,GAC7DU,KAAKG,wBACP,CAKA,eAAWR,CAAYS,GACrBJ,KAAIE,EAAuBG,EAAUC,MAAMF,EA3D/B,EA2D+Cd,GAC3DU,KAAKG,wBACP,CAQO,MAAAI,CAAOC,EAAoBC,GAChCT,KAAIC,EAAyBI,EAAUC,MAAME,EAtEjC,EAsEsDlB,GAClEU,KAAIE,EAAuBG,EAAUC,MAAMG,EAvE/B,EAuEkDnB,GAC9DU,KAAKG,wBACP,CAOO,eAAAO,CAAgBC,GACrBX,KAAIC,EAAyBU,EAAOjB,cACpCM,KAAIE,EAAuBS,EAAOhB,YAClCK,KAAKG,wBACP,CAUgB,sBAAAA,GACd,GAA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