three-zoo 0.5.5 → 0.6.0

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.\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,MAa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+B,EAAO+I,OAASJ,EAAQ3K,IAAIE,EAC5B8B,EAAO/E,MAAQ0N,EAAQvK,IAAID,EAE3B6B,EAAOgJ,MAAQL,EAAQvK,IAAIH,EAC3B+B,EAAOiJ,IAAMN,EAAQvK,IAAIF,EACzB8B,EAAO9E,KAAOyN,EAAQ3K,IAAIG,EAE1B6B,EAAOzB,mBAAkB,GAAM,GAC/ByB,EAAOzE,wBACT,CAWO,0BAAA2N,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,EAxKE,EAED,EAuKtB,IAAK,IAAI9K,EAAI,EAAOsK,EAAK9J,OAATR,EAAiBA,GAAK4K,EAAM,CAC1C,MAGMG,EAxKQ,MAqKJT,EAAKtK,GAnKD,MAoKJsK,EAAKtK,EAAI,GAlKL,MAmKJsK,EAAKtK,EAAI,GAEf+K,EAAYL,IACdA,EAAeK,EACfJ,EAAW3K,EAEf,CAGA,MAAMgL,EAAaL,EAAWC,EACxBzL,EAAI6L,EAAaR,EASvBlO,KAAKgC,SAASoK,uBAAuBP,EAR3B7K,KAAKoD,MAAMsK,EAAaR,GAGpBC,EAEQnN,KAAK2N,GAHjB9L,EAAIqL,GAIOlN,KAAK2N,GAAK,EAAI3N,KAAK2N,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 undefined\n */\n public static getObjectByName(\n object: Object3D,\n name: string,\n ): Object3D | undefined {\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 undefined;\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 undefined\n */\n public static getMaterialByName(\n object: Object3D,\n name: string,\n ): Material | undefined {\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 undefined;\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 /**\n * Clones material by name and replaces all instances with the clone.\n *\n * @param object - Root object to start from\n * @param name - Material name to search for (case-sensitive)\n * @returns Cloned material or undefined if not found\n */\n public static cloneMaterialByName(\n object: Object3D,\n name: string,\n ): Material | undefined {\n const originalMaterial = SceneTraversal.getMaterialByName(object, name);\n\n if (!originalMaterial) {\n return undefined;\n }\n\n const clonedMaterial = originalMaterial.clone();\n\n SceneTraversal.replaceMaterial(object, originalMaterial, clonedMaterial);\n\n return clonedMaterial;\n }\n\n /**\n * Replaces all instances of a material with another material.\n *\n * @param object - Root object to start from\n * @param oldMaterial - Material to replace\n * @param newMaterial - Material to use as replacement\n */\n private static replaceMaterial(\n object: Object3D,\n oldMaterial: Material,\n newMaterial: Material,\n ): void {\n if (object instanceof Mesh) {\n if (Array.isArray(object.material)) {\n object.material = object.material.map((material) =>\n material === oldMaterial ? newMaterial : material,\n );\n } else if (object.material === oldMaterial) {\n object.material = newMaterial;\n }\n }\n\n for (const child of object.children) {\n SceneTraversal.replaceMaterial(child, oldMaterial, newMaterial);\n }\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","cloneMaterialByName","originalMaterial","clonedMaterial","replaceMaterial","oldMaterial","newMaterial","map","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","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,MA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Ae,EACfC,EAAW,EAIf,MAAMC,EACJP,EAAQQ,SAAWC,EAjJE,EAED,EAgJtB,IAAK,IAAItL,EAAI,EAAO8K,EAAKtK,OAATR,EAAiBA,GAAKoL,EAAM,CAC1C,MAGMG,EAjJQ,MA8IJT,EAAK9K,GA5ID,MA6IJ8K,EAAK9K,EAAI,GA3IL,MA4IJ8K,EAAK9K,EAAI,GAEfuL,EAAYL,IACdA,EAAeK,EACfJ,EAAWnL,EAEf,CAGA,MAAMwL,EAAaL,EAAWC,EACxBjM,EAAIqM,EAAaR,EASvB1O,KAAKgC,SAAS4K,uBAAuBP,EAR3BrL,KAAKoD,MAAM8K,EAAaR,GAGpBC,EAEQ3N,KAAKmO,GAHjBtM,EAAI6L,GAIO1N,KAAKmO,GAAK,EAAInO,KAAKmO,GAAK,EAG/C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "three-zoo",
3
- "version": "0.5.5",
3
+ "version": "0.6.0",
4
4
  "description": "Some reusable bits for building things with Three.js ",
5
5
  "scripts": {
6
6
  "clean": "rm -rf dist",